WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
File "wifi_founder.py", line 9, in <module>
sniff(iface="mon0", prn=PacketHandler)
File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 561, in sniff
s = L2socket(type=ETH_P_ALL, *arg, **karg)
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 455, in __init__
self.ins.bind((iface, type))
File "/home/etai/PycharmProjects/wifi_founder/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 19] No such device
当我尝试使用scapy调试此代码时,我得到了上面的错误,我根本不知道如何解决它。代码是用python编写的:
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:
ap_list.append(pkt.addr2)
print "AP MAC: %s with SSID: %s" % (pkt.addr2, pkt.info)
sniff(iface="mon0", prn=PacketHandler)
答案 0 :(得分:0)
如果你不能使用'mon0',你可以考虑使用:
sniff(iface=conf.iface, prn=PacketHandler)
相反,因为它会自动选择最佳界面(默认界面)