I am trying to use scapy and netfilterqueue with python 3.6.1. I created an environment with these installed.. as netfilterqueue will not work on python 3.9.
When I try to run my script:
pipenv run python3 test.py
it runs in the correct environment but I get:
PermissionError: [Errno 1] Operation not permitted
When I try to run with sudo: sudo pipenv run python3 test.py
I get:
Warning: Python 3.6.1 was not found on your system…
You can specify specific versions of Python with:
$ pipenv --python path/to/python
I've verified my libraries are correctly installed on the environment but am just not sure how to pass permissions to run a script. Thanks!
──(kali㉿bad)-[~/Desktop/env]
└─$ pipenv shell
Launching subshell in virtual environment...
. /home/kali/.local/share/virtualenvs/env-_HkHVbK0/bin/activate
WARNING: `pyenv init -` no longer sets PATH.
Run `pyenv init` to see the necessary changes to make to your configuration.
┌──(kali㉿bad)-[~/Desktop/env]
└─$ . /home/kali/.local/share/virtualenvs/env-_HkHVbK0/bin/activate
┌──(env-_HkHVbK0)(kali㉿bad)-[~/Desktop/env]
└─$ python3
Python 3.6.1 (default, May 12 2021, 17:05:21)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scapy
>>> import netfilterqueue
>>> import sys
>>> sys.path
['', '/home/kali/.pyenv/versions/3.6.1/lib/python36.zip', '/home/kali/.pyenv/versions/3.6.1/lib/python3.6', '/home/kali/.pyenv/versions/3.6.1/lib/python3.6/lib-dynload', '/home/kali/.local/share/virtualenvs/env-_HkHVbK0/lib/python3.6/site-packages']
>>>