Skip to content

Instantly share code, notes, and snippets.

@lrivallain
Created August 21, 2017 12:42
Show Gist options
  • Select an option

  • Save lrivallain/0d9ca010a8d0e8911ef13470c7634a3e to your computer and use it in GitHub Desktop.

Select an option

Save lrivallain/0d9ca010a8d0e8911ef13470c7634a3e to your computer and use it in GitHub Desktop.
Sniff HTTP(s) hosts on a gateway
#/bin/bash
#
# Use this script to sniff the HOST requested by a single IP for HTTP(s) requests
#
# Usage : ./sniff.sh XX.XX.XX.XX
#
tcpdump -Alfq -s 1024 "
(tcp dst port 443 or tcp dst port 80 or tcp dst port 8080)
and ip[2:2] > 40
and src host $1
and tcp[tcpflags] & tcp-push != 0" \
| grep -i " > \|get\|host"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment