kirin@pwnlab:~/projects$cat pcap-tcp-sniffer.md
PCAP TCP Sniffer
A network security exercise focused on computing in C what Wireshark shows automatically.
Ethernet Header -> IPv4 Header -> TCP Header -> Payload- Live capture filtered to TCP with a BPF
tcpexpression - Prints source/destination MAC, IP and port
- Handles variable-length headers using IPv4 IHL and TCP Data Offset
- Shows up to 1024 bytes of plaintext payload
- Defensive parsing that skips truncated packets and invalid header lengths
Code and report are in the repository.