Accessing 802.11 Wireless Management Frames from Python
问题 From Python on Linux I would like to sniff 802.11 management 'probe-request' frames. This is possible from Scapy like so: # -*- coding: utf-8 -*- from scapy.all import * def proc(p): if ( p.haslayer(Dot11ProbeReq) ): mac=re.sub(':','',p.addr2) ssid=p[Dot11Elt].info ssid=ssid.decode('utf-8','ignore') if ssid == "": ssid="<BROADCAST>" print "%s:%s" %(mac,ssid) sniff(iface="mon0",prn=proc) Or from tshark like so: tshark -n -i mon0 subtype probereq -R 'wlan.fc.type_subtype eq 4' -T fields -e wlan