Created
April 2, 2013 14:56
-
-
Save securitytube/5292856 to your computer and use it in GitHub Desktop.
WLAN SSID Sniffer in Python using Raw Sockets
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 | |
import socket | |
rawSocket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(0x0003)) | |
rawSocket.bind(("mon0", 0x0003)) | |
ap_list = set() | |
while True : | |
pkt = rawSocket.recvfrom(2048)[0] | |
if pkt[26] == "\x80" : | |
if pkt[36:42] not in ap_list and ord(pkt[63]) > 0: | |
ap_list.add(pkt[36:42]) | |
print "SSID: %s AP MAC: %s" % (pkt[64:64 +ord(pkt[63])], pkt[36:42].encode('hex')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blog post with full details: http://hackoftheday.securitytube.net/2013/04/wi-fi-ssid-sniffer-in-12-lines-of.html