Scapy Error sending packet (promiscuous mode)

96 Views Asked by At

I want to play a bit with scapy to get familiar with crafting and working with packets. So for so good. But when I want to send a packet an OS error appears: Saying that it can not set hardware filter to promiscuous mode. My OS is Windows 11. I am using the interactive mode of Scapy with admin rights. I am connected to my router through LAN.

I am trying to do this:

b = Ether(dst = "ff:ff:ff:ff:ff:ff")
send(b)

Error:

Traceback (most recent call last):
File "<console>", line 1, in <module>
  File "C:\Users\****\AppData\Roaming\Python\Python311\site-packages\scapy\sendrecv.py", line 445, in send
    return _send(
           ^^^^^^
  File "C:\Users\****\AppData\Roaming\Python\Python311\site-packages\scapy\sendrecv.py", line 414, in _send
    socket = socket or _func(iface)(iface=iface, **kargs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\****\AppData\Roaming\Python\Python311\site-packages\scapy\arch\libpcap.py", line 529, in __init__
    fd = open_pcap(iface, MTU, self.promisc, 100,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\****\AppData\Roaming\Python\Python311\site-packages\scapy\arch\windows\__init__.py", line 770, in open_pcap
    return _orig_open_pcap(iface_network_name, *args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\****\AppData\Roaming\Python\Python311\site-packages\scapy\arch\libpcap.py", line 338, in __init__
    raise OSError(error)
OSError: \Device\NPF_{21330BA1-83F1-4778-B42D-89E43A29CE77}: failed to set hardware filter to promiscuous mode: Ein an das System angeschlossenes Gerät funktioniert nicht.  (31)

It does not matter how I specify the packet (different dst etc.) and even if I manually set the interface it still throws the error.

1

There are 1 best solutions below

0
Cukic0d On

There are two options:

conf.sniff_promisc = False