Skip to content

Instantly share code, notes, and snippets.

@christian-korneck
Last active August 6, 2025 16:06
Show Gist options
  • Select an option

  • Save christian-korneck/6ca21cb668049e78f5f0daa731dc6c4a to your computer and use it in GitHub Desktop.

Select an option

Save christian-korneck/6ca21cb668049e78f5f0daa731dc6c4a to your computer and use it in GitHub Desktop.
urldump

add to ~/.bashrc:

urldump() {
sudo tcpdump -i any -A -s 0 -l 'tcp' | awk '/GET|POST|PUT|DELETE|HEAD|OPTIONS|PATCH.*HTTP/ {match($0, /(GET|POST|PUT|DELETE|HEAD|OPTIONS|PATCH) ([^ ]+)/, arr); method=arr[1]; url=arr[2]} /^Host:/ {if(method) {print method, $2 url; method=""}}'}
GET localhost:8080/
GET localhost:5172/foo/bar
GET localhost:8080/index.html?foo=bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment