Sniff HTTP packets for GET and POST requests from an application - http

I am coding an SEO tool in C# for doing keyword research. I need to make calls to Google Adword keyword tool. Now I know some tools which are doing the same already.
I just need to decipher what they are doing. I tried using Wireshark but it's very complex to get the actual POST data using Wireshark.
I tried using fiddler on IE but seems like too many Javascript requests are made which confuses fiddler a lot.
If I can just find out the exact requests the other tool is making I think my job is done. How can I do this?

Put http.request.method == "POST" in the display filter of wireshark to only show POST requests. Click on the packet, then expand the Hypertext Transfer Protocol field. The POST data will be right there on top.

You will have to use some sort of network sniffer if you want to get at this sort of data and you're likely to run into the same problem (pulling out the relevant data from the overall network traffic) with those that you do now with Wireshark.

Related

How can I capture data send to a webserver/website?

What is an easy way to capture data send to a webserver?
I want to get the code, which gets send when I give someone reputation on a forum...
Try Fiddler. It acts as a system-wide proxy and captures all http requests and provides a way to inspect them.
If the data is sent using a browser.
You can monitor the traffic using Firebug in firefox or Developer Console in Chrome.

Is there a way to discover the specific HTTP requests my browser sends while I navigate?

The question is pretty straightforward. I want to know if there are ways of discovering the HTTP requests my browser sends while I navigate. For instance, what happens when I click on a certain link which sends a PUT method? I mean, I wish I could determine the exact HTTP request that my browser sends to that website. Further, I want to, later, reproduce that request on Curl. Basically, I want to inspect requests my browser sends so I can automate that task later through the Curl command (command, not library).
Thanks in advance!
Fernando.
Fiddler does exactly what you want. It sets up a proxy that can monitor http communication from your browser.
http://www.fiddler2.com/fiddler2/
You would want the Firebug extesion for Firefox. It can show a lot of what is happening, and you can add more options by installing more extensions.
On the other hand, you can use wireshark to capture the traffic to and from your computer.
Then you can use filters to save the relevant packets (pcap is often the format for storing the packets).
Later, you can replay the packets using tools like tcpreplay.
You could try it out with backtrack linux (live cd/usb).
And nowadays there should be some new tools for windows also. :)
EO2 and JohnnyC are correct. Fiddler, WireShark, FireBug (FireFox addon), etc. are what you are going to look for. You can use them free of charge.
WireShark will capture all incoming and outgoing traffic on your box. You can listen on any port, filter data etc.
FireBug will capture outgoing and incoming data streams, the raw data (XML, JSON, images etc.) for each request.
Fiddler is great for tracking web data in a seperate application if you do not use FireFox.

Why can't I view Omegle's HTTP request/response headers?

I'm trying to write a small program that I can talk to Omegle strangers via command line for school. However I'm having some issues, I'm sure I could solve the problem if I could view the headers sent however if you talk to a stranger on Omegle while Live HTTP Headers (or a similar plug-in or program) is running the headers don't show. Why is this? Are they not sending HTTP headers and using a different protocol instead?
I'm really lost with this, any ideas?
I had success in writing a command line Omegle chat client. However it is hardcoded in C for POSIX and curses.
I'm not sure what exactly your problem is, maybe it's just something with your method of reverse engineering Omegle's protocol. If you want to make a chat client, use a network packet analyzer such as Wireshark (or if you're on a POSIX system I recommend tcpdump), study exactly what data is sent and received during a chat session and have your program emulate what the default web client is doing. Another option is to de-compile/reverse engineer the default web client itself, which would be a more thorough method but more complicated.

How to debug Websockets?

I want to monitor the websocket traffic (like to see what version of the protocol the client/server is using) for debugging purposes. How would I go about doing this? Wireshark seems too low level for such a task. Suggestions?
Wireshark sounds like what you want actually. There is very little framing or structure to WebSockets after the handshake (so you want low-level) and even if there was, wireshark would soon (or already) have the ability to parse it and show you the structure.
Personally, I often capture with tcpdump and then parse the data later using wireshark. This is especially nice when you may not be able wireshark on the device where you want to capture the data (i.e. a headless server). For example:
sudo tcpdump -w /tmp/capture_data -s 8192 port 8000
Alternately, if you have control over the WebSockets server (or proxy) you could always print out the send and receive data. Note that since websocket frames start with '\x00' will want to avoid printing that since in many languages '\x00' means the end of the string.
If you're looking for the actual data sent and received, the recent Chrome Canary and Chromium have now WebSocket message frame inspection feature.
You find details in this thread.
I think you should use Wireshark
Steps
Open wireshark
Go to capture and follow bellow path: capture > interfaces > start capture in your appropriate device.
Write rules in filter tcp.dstport == your_websoket_port
Hit apply
For simple thing, wireshark is too complex, i wanted to check only if the connection can be establish or not. Following Chrome plugin "Simple Web-socket (link : https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo?hl=en)" work like charm. See image.
https://lh3.googleusercontent.com/bEHoKg3ijfjaE8-RWTONDBZolc3tP2mLbyWanolCfLmpTHUyYPMSD5I4hKBfi81D2hVpVH_BfQ=w640-h400-e365

How to analyse a HTTP dump?

I have a file that apparently contains some sort of dump of a keep-alive HTTP conversation, i.e. multiple GET requests and responses including headers, containing an HTML page and some images. However, there is some binary junk in between - maybe it's a dump on the TCP or even IP level (I'm not sure how to determine what it is).
Basically, I need to extract the files that were transferred. Are there any free tools I could use for this?
Use Wireshark.
Look into the file format for its dumps and convert your dump to it. Its very simple. Its called the pcap file format. Then you can open it in Wireshark no problem and it should be able to recognize the contents. Wireshark supports many dozens if not many hundred communication formats at various OSI layers (including TCP/IP/HTTP) and is great for this kind of debugging.
Wireshark will analyze on the packet level. If you want to analyze on the protocol level, I recommend Fiddler: http://www.fiddlertool.com/fiddler/
It will show you the headers sent, the responses, and will decrypt HTTPS sessions as well. And a ton more.
The Net tab in the Firebug plugin for Firefox might be of use.

Resources