trace http requests with tshark

tshark -i en1 -z proto,colinfo,http.request.uri,http.request.uri -R http.request.uri
trace http requests on the specified interface. uses the amazing tshark tool (http://www.wireshark.org/docs/man-pages/tshark.html)
Sample Output
Capturing on eth0
 10.782367 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx/ HTTP/xxxxx.1   http.request.uri == "/xxxxx/"
 14.362057 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.css HTTP/xxxxx.1   http.request.uri == "/xxxxx.css"
 14.512157 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.css HTTP/xxxxx.1   http.request.uri == "/xxxxx.css"
 14.527458 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.css HTTP/xxxxx.1   http.request.uri == "/xxxxx.css"
 23.481113 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.481165 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.481179 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.631256 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.636404 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.gif HTTP/xxxxx.1   http.request.uri == "/xxxxx.gif"
 23.646674 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.657191 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx/ HTTP/xxxxx.1   http.request.uri == "/xxxxx/"
 23.672339 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.jpg HTTP/xxxxx.1   http.request.uri == "/xxxxx.jpg"
 23.681375 XX.XX.XX.XX -> XX.XX.XX.XX HTTP GET /xxxxx.png HTTP/xxxxx.1   http.request.uri == "/xxxxx.png"
 39.723847 XX.XX.XX.XX -> XX.XX.XX.XX HTTP POST /xxxxx/getxredirectxhost HTTP/xxxxx.1  (application/octet-stream)  http.request.uri == "/xxxxx/getxredirectxhost"

1
By: lele
2011-04-05 14:18:35

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: