Table of Contents

tcpdump

sniff packets in your terminal

Usually, you’ll run tcpdump like this:

tcpdump -t -n -i any port 53 → this shows packets sent to and from port 53.

TODO colored output

useful options

-A view packet contents
-c 3 to limit the amount of packets captured
-i eth0 specifies interface
-n displays IP addreses in place of hostnames
-p omits packets not adressed to your computer
-v be verbose
-w file.pcap saves output to a file for later

Time

-ttt start time at 0, shows difference between packets
-t omits timestamps

Layer 2

-e includes ethernet info (MAC & plen) when relevant

TCP

-S always output original sequence numbers (instead of at conversation start, then offsets)

BPF filters

You can filter packets with BPF like this: