November 2017
Intermediate to advanced
226 pages
5h 59m
English
Here are the steps to create a basic packet sniffer with socket module:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
Both reading and writing to a raw socket require creating a raw socket first. Here we use the INET family raw socket. The family parameter for a socket describes the address family of the socket. The following are the address family constants:
Read now
Unlock full access