0

i have the following code :

import socket

sniffer = socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_IP)
sniffer.bind(("",0))
sniffer.ioctl(socket.SIO_RCVALL,socket.RCVALL_ON)
data = sniffer.recvfrom(65535)
print(f"RECVD : {data}")
sniffer.ioctl(socket.SIO_RCVALL,socket.RCVALL_OFF)
    

in which ,I try to enable promiscuous in windows in the line

sniffer.ioctl(socket.SIO_RCVALL,socket.RCVALL_ON)

but when I run the code, I get the following OSError:

[WinError 10022] An invalid argument was supplied

Just a quick note: I am running the code via a privileged shell.

PS : please excuse me if this question has been asked in some implicit form by someone else earlier, as I have done my part and did not find anythin relevant

JA3G3R
  • 1
  • 2

0 Answers0