Created
April 2, 2013 12:49
-
-
Save securitytube/5291959 to your computer and use it in GitHub Desktop.
WLAN SSID Sniffer in Python using Scapy
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
#!/usr/bin/env python | |
from scapy.all import * | |
ap_list = [] | |
def PacketHandler(pkt) : | |
if pkt.haslayer(Dot11) : | |
if pkt.type == 0 and pkt.subtype == 8 : | |
if pkt.addr2 not in ap_list : | |
ap_list.append(pkt.addr2) | |
print "AP MAC: %s with SSID: %s " %(pkt.addr2, pkt.info) | |
sniff(iface="mon0", prn = PacketHandler) |
Hello,
Thanks for this script, I'm using it for a personal project!
I don't know if it's currently obsolete or not, the if condition which tests the type and the subtype never returns positive value to me. So I changed if pkt.haslayer (Dot11):
so that it becomes if pkt.haslayer (Dot11ProbeReq):
I was then able to delete the if type && subtype
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'am rather new by using python (lotst ofe experience with other languages). I bougth a raspberry and know tries to find out if I can use my Pi for notifying if a dedicated person is in the neighbouhood. I.e. by detecting Wifi, bluetooth or other specifc signal (also for automatic opening doors; get ligths on etc.)
I loaded the code and tried to run the application.
it just gave me the error it could not find scapy
--> I did install the scapy modules by PIP
What did probably go wrong?
Dick