Created
December 2, 2013 06:18
-
-
Save glennzw/7745838 to your computer and use it in GitHub Desktop.
Simple Scapy code to detect APs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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