Skip to content

Instantly share code, notes, and snippets.

@jcPOLO
Last active January 27, 2023 11:41
Show Gist options
  • Save jcPOLO/1ad33071f240bdc58995f0e186ab8bf1 to your computer and use it in GitHub Desktop.
Save jcPOLO/1ad33071f240bdc58995f0e186ab8bf1 to your computer and use it in GitHub Desktop.
tcpdump captures HTTP Headers
sudo tcpdump -A -s 10240 'tcp port 4080 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'
# https://serverfault.com/questions/504431/human-readable-format-for-http-headers-with-tcpdump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment