Я пытаюсь запустить сканер диапазона портов TCP код, найденный на этом веб-сайте:
https://thepacketgeek.com/scapy-p-10-emulating-nmap-functions/
- Я не сделал изменения к нему. Но каждый раз, когда я запускаю этот или любой другой код с помощью scapy, я получаю следующую ошибку:
File "./PSCAN.py", line 15, in <module>
verbose=0,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/sendrecv.py", line 488, in sr1
nofilter=nofilter, iface=iface)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 234, in __init__
super(L2bpfListenSocket, self).__init__(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 57, in __init__
(self.ins, self.dev_bpf) = get_dev_bpf()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/arch/bpf/core.py", line 115, in get_dev_bpf
raise Scapy_Exception("No /dev/bpf handle is available !")
scapy.error.Scapy_Exception: No /dev/bpf handle is available !
Exception ignored in: <function _L2bpfSocket.__del__ at 0x10a5083b0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 131, in __del__
self.close()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scapy/arch/bpf/supersocket.py", line 203, in close
if not self.closed and self.ins is not None:
AttributeError: 'L3bpfSocket' object has no attribute 'ins'
Я запускаю python 3 на linux. Я скачал scapy с pip install --pre scapy[complete]