use python to probe 802.11 wifi traffic in the air
first set the wireless network card to moniter mode
root@kali:~/dc# iwconfiglo no wireless extensions.wlan0 IEEE 802.11 ESSID:"zeta" Mode:Managed Frequency:2.462 GHz Access Point: 00:6B:8E:C8:BA:B4 Bit Rate=72.2 Mb/s Tx-Power=22 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on Link Quality=70/70 Signal level=-32 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:16 Missed beacon:0eth0 no wireless extensions.root@kali:~/dc# airmon-ng start wlan0Found 3 processes that could cause trouble.If airodump-ng, aireplay-ng or airtun-ng stops working aftera short period of time, you may want to run 'airmon-ng check kill' PID Name 521 NetworkManager 716 wpa_supplicant 1735 dhclientPHY Interface Driver Chipsetphy0 wlan0 iwlwifi Intel Corporation Wireless 3160 (rev 83) (mac80211 monitor mode vif enabled for [phy0]wlan0 on [phy0]wlan0mon) (mac80211 station mode vif disabled for [phy0]wlan0)root@kali:~/dc# iwconfiglo no wireless extensions.wlan0mon IEEE 802.11 Mode:Monitor Frequency:2.457 GHz Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:on eth0 no wireless extensions.
from scapy.all import *def pktPrint(pkt): if pkt.haslayer(Dot11Beacon): print '[+] Detedted 802.11 Beacon Frame' elif pkt.haslayer(Dot11ProbeReq): print '[+] Detected 802.11 Probe Request Frame' elif pkt.haslayer(TCP): print '[+] Detected a TCP Packet' elif pkt.haslayer(DNS): print '[+] Dected a DNS Packet' conf.iface = 'wlan0mon'sniff(prn=pktPrint)
notice to set conf.iface to wlan0mon.
finally it will print out the infomation in the air.
like this:
[+] Detected 802.11 Probe Request Frame[+] Detected 802.11 Probe Request Frame[+] Detedted 802.11 Beacon Frame[+] Detedted 802.11 Beacon Frame[+] Detedted 802.11 Beacon Frame[+] Detedted 802.11 Beacon Frame
after that do not forget to stop the moniter mode of the wireless card.
root@kali:~/dc# airmon-ng stop wlan0monPHY Interface Driver Chipsetphy0 wlan0mon iwlwifi Intel Corporation Wireless 3160 (rev 83) (mac80211 station mode vif enabled on [phy0]wlan0) (mac80211 monitor mode vif disabled for [phy0]wlan0mon)root@kali:~/dc# iwconfiglo no wireless extensions.wlan0 IEEE 802.11 ESSID:"zeta" Mode:Managed Frequency:2.462 GHz Access Point: 00:6B:8E:C8:BA:B4 Bit Rate=72.2 Mb/s Tx-Power=22 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on Link Quality=70/70 Signal level=-36 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:1 Missed beacon:0eth0 no wireless extensions.