Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Last active May 31, 2022 18:26
Show Gist options
  • Select an option

  • Save thomasdarimont/eed2775c6874c14d17b1 to your computer and use it in GitHub Desktop.

Select an option

Save thomasdarimont/eed2775c6874c14d17b1 to your computer and use it in GitHub Desktop.
tcpdump & tshark examples
sudo tcpdump -i lo src port 8081 or dst port 8081 -w keycloak-1.pcap

or just

sudo tcpdump -i lo port 8081 -w keycloak-1.pcap

show Requests

$ sudo tshark -i any \
 -Y 'http.request.method == "GET" or http.request.method == "OPTIONS" or http.request.method == "POST"' \
 -T fields \
 -e http.request.method -e http.request.uri -e ip.src -e ip.dst

Show IP, TCP + HTTP (Path, Method, Headers)

$ sudo tshark -i any \
 -Y 'http.request.method == "GET" or http.request.method == "OPTIONS" or http.request.method == "POST"' \
 -V \
 -Y "http.request || http.response" \
 | awk "/Hypertext Transfer Protocol/,/Frame/ { print };/Transmission Control Protocol/{print};/Internet Protocol/{print}" | grep -v Frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment