Feb-05-2022, 02:53 PM
Hello, I'm learning the Scapy tool and right from the start I'm having a problem i can't solve
Here's the Python code:
Environment
OS: Linux Mint 20.2 x86_64
Scapy 2.4.5
Python 3.8.10
I'm using virtualenv so that script frameworks don't mix with s.o.
Here's the Python code:
from scapy.all import sr1, IP, ICMP p = sr1(IP(src = '8.8.8.8')/ICMP()) p.show()A permission error is returned:
Error:Traceback (most recent call last):
File "testes.py", line 3, in <module>
p = sr1(IP(dst='8.8.8.8')/ICMP())
File "/home/jao/Documentos/teste-scapy/scapy/lib/python3.8/site-packages/scapy/sendrecv.py", line 648, in sr1
s = conf.L3socket(promisc=promisc, filter=filter,
File "/home/jao/Documentos/teste-scapy/scapy/lib/python3.8/site-packages/scapy/arch/linux.py", line 486, in __init__
self.ins = socket.socket(
File "/usr/lib/python3.8/socket.py", line 231, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 1] Operation not permitted
With this, I executed the script with sudo sudo python3 script.py
and an import error was posted:Error:Traceback (most recent call last):
File "testes.py", line 1, in <module>
from scapy.all import sr1,IP,ICMP
ModuleNotFoundError: No module named 'scapy.all'
Why does this happen? Does this problem have a solution?Environment
OS: Linux Mint 20.2 x86_64
Scapy 2.4.5
Python 3.8.10
I'm using virtualenv so that script frameworks don't mix with s.o.