Created
October 8, 2014 07:34
-
-
Save Filirom1/a513ca8323ddcf8a7b59 to your computer and use it in GitHub Desktop.
debug http headers with tcpdump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=$1 | |
tcpdump -i lo -A -s 10240 "tcp port $PORT 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