Search code examples
pythonlinuxpcapfuzzing

pcapy.findalldevs() No valid interfaces to open


I am trying to run Sulley's (the fuzzer) "network_monitor.py" on an Ubuntu vm. Everytime I do, I get the following error.

pcapy.PcapError: No valid interfaces to open

I believe that this has little to do with the code I am running it in, because when I run

python
>>> import pcapy
>>> devices = pcapy.findalldevs()

I get the same error

Any hints on what's going on would be amazing. Thanks so much in advance


Solution

  • Try to use it with sudo.

    Pcapy, AFAIK, needs special rights to access interfaces.

    mycode.py:
        import pcapy
        devices = pcapy.findalldevs()
    
    sudo python mycode.py