Hey, I would like to know how can I parse network packets in python, there’s any kind of library which makes my work easier?
This is my simple code for sniffing network packets:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
while 1:
print s.recvfrom(65565)
And here’s a tiny piece of my output
('E\x00\x004\x8bj@\x004\x06\xce;U\x9f\xd5e\xc0\xa8\x01q\x01\xbb\xbb\x8aq\xb3\xe3i\x97?\xf1^\x80\x10\x02\x16O\xa1\x00\x00\x01\x01\x08\n\nl\x87\xe0\x00\x07\n\x93', ('85.159.213.101', 0))
Thank you in advance :)