测试无线网卡嗅探功能

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_43776408/article/details/102735897

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 Probe Request Frame'
    elif pkt.haslayer(TCP):
        print '[+] Detected a TCP Packet'
    elif pkt.haslayer(DNS):
        print '[+] Detected a DNS Packet'


conf.iface = 'wlan0mon'  #此处写处于监听模式的网卡的名字
sniff(prn=pktPrint)  #监听网络中流量的,抓到的每一个参数都传给pktPrint函数

///////////////

上面这段脚本是侦测无线网络的流量
在此之前你要插入网卡,并且将网卡设为监听模式
airmon-ng start wlan0

启动脚本,他会检测四种类型的数据包

猜你喜欢

转载自blog.csdn.net/qq_43776408/article/details/102735897