|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 :|
|print "AP MAC: %s with SSID: %s " %(pkt.addr2, pkt.info)|
|sniff(iface="mon0", prn = PacketHandler)|
Hi, I wanted to know how I can leverage Scapy to tell me the Encryption type as well (WEP, WPA, WPA2, WPS Enabled). I am doing some research on Wifi security and I really need to code something using python and scapy that would tell me the ENC type. Can you help please?
Would checking the packet for the Dot11Beacon layer be the same as checking the packet type for 0x00 and subtype for 0x08, as in your script above?
I wrote a similar script where I was getting strange results on occasion and unfortunately never logged the complete packet to debug the issue, but it appeared as the value in the packet's info var would sometimes appear empty or with unexpected ascii chars.
If you want to sniff SSID then why you only catch beacon packets? Correct version https://github.com/adamziaja/python/blob/master/ssid_sniffer.py and probe request sniffer https://github.com/adamziaja/python/blob/master/probe_request_sniffer.py . Also please try keep your script running a long period of time and look your cpu/mem... all packets will be in memory.