Last active
June 14, 2017 05:54
-
-
Save RunnerRick/6554392 to your computer and use it in GitHub Desktop.
Using TCPDUMP to monitor incoming HTTP traffic (poor man's Wireshark).
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
#!/usr/bin/env bash | |
echo $1 | grep -E -q "^[0-9]+$" || (echo "Please specify a port number to listen to." ; exit 1) | |
PORT=$1 | |
TCPDUMPARG="tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | |
sudo tcpdump -s 0 -A -i lo0 $TCPDUMPARG | |
# See also http://naleid.com/blog/2008/04/03/monitoring-http-traffic-to-debug-your-grails-application/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amazing stuff! Thanks for sharing!