0

I have written a python script that uses from scapy.all import * and the sniff() function requires elevated privilege, so when I run python3 scapyScript.py I receive the error PermissionError: [Errno 1] Operation not permitted which makes sense.

However, when I run sudo python3 scapyScript.py I receive ModuleNotFoundError: No module named 'scapy'.

I believe it's because I didn't install scapy using sudo access, but when I attempt to sudo pip3 install scapy it says there is no recognized command.

I can't seem to find anything about this specifically, does anybody have any ideas?

I am using Debian 9.3.0-10 distro.

Thank you for your time.

FeralShadow
  • 111
  • 1
  • 1
  • 4

1 Answers1

1

The PYTHON sys.path variable was different between regular and SUDO use (and SUDO is required for scapy module).
There were a couple different approaches I found to solve it: This ended up solving it with the .bashrc suggestion. Essentially, the python module paths needed to be added to the sudo user or environment. Good luck to anybody else who has this issue!

FeralShadow
  • 111
  • 1
  • 1
  • 4