Захват в файл tcpdump
Сохранить пакеты в PCAP файл для анализа в Wireshark
tcpdump -i eth0 -w /tmp/capture.pcap
more tcpdump
all 18 commands →
Читать PCAP файл
tcpdump -r /tmp/capture.pcap -n | head -50
Фильтр по хосту
tcpdump -i any host 10.0.0.5 -n
Фильтр по порту
tcpdump -i eth0 port 443 -n
Захват DNS запросов
tcpdump -i any -n port 53
HTTP GET запросы
tcpdump -i any -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep 'GET /'