We know that Python Allows enabling promiscuous mode under Windows through
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
However, The RCVAL
There is another way I thought of. Maybe not as elegant but seems to work fine.
In linux (with root permissions), one can use :
# ifconfig eth0 promisc
# ifconfig eth0 -promisc
To enable/ disable promisc mode on your interface (eth0 in this case).
So, in python (with root permissions) one could use :
import os
ret = os.system("ifconfig eth0 promisc")
if ret == 0:
Comments are welcome on this way of doing it.