pythonscapyeel

python eel is not working when run as root


I am working on a project with eel and scapy. for scapy sniff, root access is required. I've created virtual environment. scapy part runs fine with root. eel part runs fine without root. but when I tried running eel part with root, nothing is displayed. on terminating and running again, it gives following error:

OSError: [Errno 98] Address already in use: ('localhost', 8000)

It is creating a zombie process. to run I first switched to root, then activated virtual environment and then run eel.py Even when port is changed, same thing happens.

f any of you could help me, I'd very much appreciate it.


Solution

  • I managed to resolve the issue by elevating privileges of python by using setcap so I won't have to use sudo to run scapy
    to elevate privileges I used

    setcap cap_net_raw=eip /usr/bin/python3.8
    

    to revoke the privileges I used

    setcap -r /usr/bin/python3.8