Python Forum
Permission issue when using scapy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Permission issue when using scapy
#1
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:

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.
Reply


Messages In This Thread
Permission issue when using scapy - by jao - Feb-05-2022, 02:53 PM
RE: Permission issue when using scapy - by snippsat - Feb-05-2022, 03:14 PM
RE: Permission issue when using scapy - by jao - Feb-05-2022, 03:30 PM
RE: Permission issue when using scapy - by snippsat - Feb-05-2022, 06:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  KivyMD android app - problem with permission polak7gt 0 333 Jan-18-2024, 01:27 PM
Last Post: polak7gt
  Potential Permission error on Mac OSX Catalina OWOLLC 1 774 Nov-02-2023, 07:52 AM
Last Post: unjnsacih
  logging: change log file permission with RotatingFileHandler erg 0 1,110 Aug-09-2023, 01:24 PM
Last Post: erg
  The INSERT permission was denied on the object Steven5055 2 1,543 Feb-25-2023, 11:37 PM
Last Post: Steven5055
  Error no 13: Permission denied in python shantanu97 1 6,263 Mar-31-2021, 02:15 PM
Last Post: snippsat
  error in scapy attribute 'haslayer' evilcode1 5 6,629 Mar-02-2021, 11:19 AM
Last Post: evilcode1
  How a Mac OS software can restart itself with admin permission in Python 3.7? Formationgrowthhacking 0 1,809 Sep-03-2020, 05:29 PM
Last Post: Formationgrowthhacking
  Error 13 permission tpolim008 2 3,525 Apr-09-2020, 06:22 PM
Last Post: tpolim008
  Fixing "PermissionError: [Errno 13] Permission denied" puredata 17 73,018 Mar-09-2020, 03:20 PM
Last Post: syssy
  Help Importing Protocol Library Into Scapy joedirgy 0 2,096 May-02-2019, 07:31 PM
Last Post: joedirgy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020