send probe requests in the air 01-26-2014, 01:42 PM
#1
This is a script that will allow you to counter someone sniffing probe requests
tested it in a cybersec forum against a group of guys sniffing probe requests and that was very funny to see them like WTF O_O 
tested it in a cybersec forum against a group of guys sniffing probe requests and that was very funny to see them like WTF O_O 
Code:
#!/usr/bin/env python
#RUN WITH python sendprobereq.py
import os
import random
from scapy.all import *
conf.verb=0 # no verbose
def check_wireless_interfaces():
chk_wl_int=os.popen("ifconfig | sed 's/[ \t].*//;/^\(lo\|\)$/d;/eth/d' | grep wlan").read() #Check if wlan interfaces are activated
if not chk_wl_int:
print ("[+] No wireless interface available. You must turn on a wireless interface.")
print ("[+] Closing")
exit()
else:
print ("[+] Wireless interface detected")
def check_monitor():
chk_mon=os.popen("ifconfig | sed 's/[ \t].*//;/^\(lo\|\)$/d;/eth/d' | grep mon").read() #Check if monitor mode has been enabled
if not chk_mon:
print ("[+] No monitoring interface detected")
print ("[+] Available wireless interface(s)\n")
wl_int_list=os.popen("ifconfig | sed 's/[ \t].*//;/^\(lo\|\)$/d;/eth/d' | grep wlan").read() #Listing wlan interfaces
print wl_int_list
int_mon=raw_input("[+] Which interface do you want to monitor?: ")
while (int_mon != "wlan0") and (int_mon != "wlan1") and (int_mon != "wlan2") and (int_mon != "wlan3"):
int_mon=raw_input("[+] Choose an interface from the list: ")
print ("[+] Trying to enable monitoring on interface "+int_mon)
os.system("airmon-ng start "+int_mon+" > /dev/null 2>&1") #Activate monitoring on choosen interface
chk_mon=os.popen("ifconfig | sed 's/[ \t].*//;/^\(lo\|\)$/d;/eth/d' | grep mon").read() #Checking again if monitor mode is enabled
if not chk_mon:
print ("[+] Monitoring couldn't be enabled on interface "+int_mon)
print ("[+] Closing")
else:
print ("[+] Monitoring enabled on interface "+int_mon)
else:
print ("[+] Monitoring interface detected")
def send_probe():
i=0
ssid=raw_input("SSID that will be sent: ")
while 1:
try:
sendp(RadioTap()/Dot11(type=0,subtype=4,addr1="ff:ff:ff:ff:ff:ff", addr2=RandMAC(),addr3="ff:ff:ff:ff:ff:ff")/Dot11Elt(ID=0,info=ssid)/Dot11Elt(ID=1,info="\x82\x84\x8b\x96"), iface='mon0')
i+=1
except KeyboardInterrupt:
print 'packets sent:',i
print ("[+] Checking wireless interfaces")
check_wireless_interfaces()
print ("[+] Checking monitoring interface")
check_monitor()
print ("[+] Start sending - CTRL + C to stop")
send_probe()
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)