Use wireshark to see requests, not packets - wireshark

I am trying to monitor calls to an API, and I am trying to do so with wireshark. However, I only see low level packets, I want to see the actual http and https requests and responses. Is this possible with wireshark?

You might consider using something besides wireshark for this.
For instance the Burp proxy will allow you to inspect requests and responses between you and the application, as well as pause a request, edit it, then send it on it's way. It really is a great tool for working with web APIs.

Related

How do I filter json-rpc requests using stuff like wireshark?

I've been trying to filter my requests using wireshark but so far to no avail. I already know how to filter xml-rpc requests using wireshark. I followed this tutorial. I trust that to filter json-rpc requests, I should also follow a similar route? I tried to replace the xml filter to json and I also tried http, but I don't get anything at all. Sometimes, I do get something but they're a bunch of ok/200 responses and they dont even resemble any of the actual response I get. How to properly get the request?
You can do it with wireshark. This link covers it, complete with screenshots. It is under statistics> conversations list> TCP, send your request, then click on follow stream.

Where in OPENWRT receives the http response of the requested website

I am currently looking into OPENWRT and want to know where in OPENWRT receives the web http response e.g. in GZIP or Deflat format?
So the user connects to the WIFI through the router installed OPENWRT. The user sends a request for e.g. example.com. When the example.com sends the http response in whatever format to the user, it must first arrive at the router and can be intercepted by OpenWRT. I want to know where OpenWRT does this job so i can make some manipulations to the web response before it arrives at the user's device
OpenWRT doesn't actually "intercept" web responses from arbitrary urls. It's default state is as a more pure router, which means that it largely operates on "network" layer traffic and below. "Web response[s]" are considered "application" layer. See this diagram of the network layer stack:
What you can do is install a piece of software on the openwrt router which will inspect application layer information and make manipulations. You should know that this can significantly slow traffic on your router. Here's a list of available openWRT proxies:
http://wiki.openwrt.org/doc/howto/proxy.overview
Depending on what "manipulations" exactly you're trying to achieve, tinyproxy might work. Squid is a more full-featured option, but may slow down traffic too much and has the potential to crash routers without sufficient RAM.
http://wiki.openwrt.org/doc/howto/proxy.tinyproxy
https://www.google.com/search?q=openwrt+squid

Would it be better to post message data or send it through websockets?

I have an app running where a socket connection is constantly maintained (using socket.io). Data that needs to be sent is similar to that which you might see in a chat application. Would it be better to have it sent through POST (essentially, post that data, prevent page redirect, and then return the new page state with websockets), or just send it through websockets? What are the advantages to each?
(You might want to explain what you're trying to accomplish in more detail. Do you want to implement chat-like functionality).
A WebSocket gives you a TCP-like connection protocol over an HTTP connection. It's full duplex and lets you push and pull content in both directions. The connection is initiated from HTTP which "upgrades" the connection type. It gives you flexibility with some added complexity. I don't think it works across old HTTP 1.0 proxies.
A simple HTTP POST is more brute force. Unless you use ajax-ish techniques it pushes data to a web service and responds with a new web page to replace whatever's in your browser.

Capture Rails API Requests/Response with WireShark

I'm working with the API using HTTMultiParty and I'm having trouble capturing the outgoing HTTP requests when I make POSTs. I don't see them at all in wireshark. I am capturing on the wireless adapter (I have no other internet connection) and filtering on
http.host contains "docusign"
but I can't see anything come up. Even with just an HTTP filter, I see nothing new captured while I see a request and response. Why is wireshark unable to view the traffic from my rails app? Note: I can see the request made by my browser to the rails app.
Since it's https traffic, assuming you know the IP address of the server you're talking to, use the filter ip.addr == x.x.x.x and you should see TLS traffic leaving leaving your client.
I presume in the above comments that you mean "ip.dst" because there is no such thing as "tcp.dest" as far as I'm aware.
Slightly old but here's a complete list of filters.

determining full url from wireshark

i am watching a video stream from a proprietary app and i want to know the URL it's connecting to. note that in this case, i know the URL that it connects to but am curious how i'd determine it using wireshark.
i have wireshark open and i let it scan for a few seconds. i looked at the results, and all i was able to determine was the url and port of the site that's providing the stream. there's a series of URL parameters that are important as well. is there a way with wireshark to see the whole url that the app is connecting to?
A full URL is the concatenation of 'host' and 'path' ('path' is URI in wireshark's jargon).
The concatenation of these strings usually does not pass on wire - you will not see it in wireshark - and it is not required by HTTP.
Therefore, you have to concatenate them on you own, either manually or using some software as the one proposed by the writer of the lua dissector.
Example:
GET /path HTTP/1.1
Host: www.amazon.com
thus, the full URL is: www.amazon.com/path
There is no such thing as a "whole" url. An application may connect to many servers during it's lifetime.There could be different servers for authentication, configuration, logging, data, etc.
Wireshark is a low-level monitoring tool. You can choose to watch the packets of a specific osi-layer and add filters to limit the output. But I don't think it can aggregate all the incoming connections of a specific application.
Please, check out following custom dissector written in Lua, that helps showing full URL in wireshark HTTP captures
Feel free to ask any questions regarding it, upvoting is preferred as well ;)

Resources