O Wireshark pode ser compilado com o suporte zlib , para que o aplicativo gráfico Wireshark e o aplicativo de linha de comando tshark
possam ler o gzip arquivos.
Aqui estou eu capturando tráfego:
# tcpdump -n -i br0 -w tcpdump.pcap
tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 65535 bytes
^C281 packets captured
281 packets received by filter
0 packets dropped by kernel
depois, compactando-o:
$ gzip tcpdump.pcap
$ ls -lgo
total 88
-rw-r--r--. 1 89875 Jul 24 22:11 tcpdump.pcap.gz
e lendo diretamente do arquivo compactado:
$ tshark -nr tcpdump.pcap.gz | head -n5
1 0.000000 192.168.1.69 41342 192.168.1.1 53 DNS 75 Standard query 0x1716 A plus.google.com
2 0.004990 192.168.1.1 53 192.168.1.69 41342 DNS 251 Standard query response 0x1716 A 74.125.237.134 A 74.125.237.135 A 74.125.237.136 A 74.125.237.137 A 74.125.237.132 A 74.125.237.129 A 74.125.237.128 A 74.125.237.130 A 74.125.237.133 A 74.125.237.142 A 74.125.237.131
3 0.005274 192.168.1.69 54794 74.125.237.134 443 TCP 74 54794 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=612252515 TSecr=0 WS=128
4 0.024052 74.125.237.134 443 192.168.1.69 54794 TCP 74 443 > 54794 [SYN, ACK] Seq=0 Ack=1 Win=42540 Len=0 MSS=1376 SACK_PERM=1 TSval=639245311 TSecr=612252515 WS=64
5 0.024078 192.168.1.69 54794 74.125.237.134 443 TCP 66 54794 > 443 [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=612252534 TSecr=639245311