Last active
September 7, 2019 02:47
-
-
Save Adarshreddyash/3b25f6768d7712ab51cc839f7584c247 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
HOST = socket.gethostbyname(socket.gethostname()) | |
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) | |
s.bind((HOST, 0)) | |
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) | |
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) | |
print(s.recvfrom(65565)) | |
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment