Skip to content

Instantly share code, notes, and snippets.

@glennzw
Created December 2, 2013 06:18
Show Gist options
  • Save glennzw/7745838 to your computer and use it in GitHub Desktop.
Save glennzw/7745838 to your computer and use it in GitHub Desktop.
Simple Scapy code to detect APs
from scapy.all import Dot11Beacon, Dot11Elt, sniff
aps={}
def proc_packet(p):
if p.haslayer(Dot11Beacon) and p[Dot11Elt].info != '':
bssid = p.addr2
ssid = p.info
if (bssid) not in aps:
print "New AP: '%s' (%s)" % (ssid, bssid)
aps[bssid] = ssid
sniff(iface="mon0", prn = proc_packet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment