标签:request down class monitor ges layer from ifconfig ima
代码
#!/usr/share/env python #--*--coding=utf-8--*-- from scapy.all import * def pktPrint(pkt): if pkt.haslayer(Dot11Beacon): print ‘[+] Detected 802.11 Beacon Frame‘ elif pkt.haslayer(Dot11ProbeReq): print ‘[+] Detected 802.11 Beacon Probe Request Frame‘ elif pkt.haslayer(TCP): print ‘[+] Detected a TCP Packet‘ elif pkt.haslayer(DNS): print ‘[+] Detected a DNS Packet‘ conf.iface = ‘wlan1‘ sniff(prn=pktPrint)
运行需要先将网卡设置为混杂模式,如wlan1:
sudo ifconfig wlan1 down sudo iwconfig wlan1 mode monitor sudo ifconfig wlan1 up
然后以管理员权限运行脚本
运行结果
我们能够捕捉到指引流量的802.11信标帧,TCP,DNS等数据包,这说明我们的无线网卡在正常工作
标签:request down class monitor ges layer from ifconfig ima
原文地址:http://www.cnblogs.com/ssooking/p/6095145.html