Skip to content

Instantly share code, notes, and snippets.

@mamashin
Created March 23, 2017 08:15
Show Gist options
  • Save mamashin/afb0e31999b1615428dede37883ef186 to your computer and use it in GitHub Desktop.
Save mamashin/afb0e31999b1615428dede37883ef186 to your computer and use it in GitHub Desktop.
tcpdump show only HTTP headers
tcpdump -i eth0 -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment