29 Jun 2011, 08:00

Number of Host headers in a TCPDump

Share

One-Liner: Get the number of Host: headers from a TCPDump:

ngrep -I /tmp/tcpdump | grep "Host:" | perl -e'while(<>){if(m/\.\.Host: (.*?)\.\./){$h{$1}++}};for $h(keys%h){print"$h - $h{$h}\n";}'