[Python] Simple network Sniffer - Part 1

Опубликовано: 30 Май 2026
на канале: Ana Banana
54,805
307

3:30 press Shift+Ctrl+Enter (not Shift+Alt+Enter) in order to open any program in administrator mode.

4:46 IP header is 32 x 5 = 160 bits = 20 bytes. Each line has 32 bits.

This tutorial shows how to write a simple network sniffer that can capture an IP packet, parse it and print it on the screen in the human readable form.

Raw sockets - http://docs.python.org/library/socket...
Struct module - http://docs.python.org/library/struct...
IP header - http://www.networksorcery.com/enp/pro...
Regular expressions - http://gskinner.com/RegExr/

Network sniffer code - http://pastebin.com/e8iGvVZR