Why WireShark is important, or how I use it

DZone 's Guide to

Why WireShark is important, or how I use it

· ·
Free Resource

There are tools out there that have their value severly underestimated. One of these tools is WireShark - a network protocol analyzer For Windows and *nix systems. And although I never used it on anything but my Windows PC, it's a really interesting tool to have installed - both for developers and curious minds. So what are some uses that might potentially benefit the people who decided to install it? Personally I have three main reasons, and i am describing those below.

Web debugging

Have you ever had issues controlling the traffic flow - maybe you were calling a service but weren't sure that the requests went the right way? What about malformed HTTP requests? If any (or both) of the situations are familiar to you, then WireShark is there to help. Although it might seem that the initial returned data set is quite complicated (and trust me, there is a lot of un-needed junk captured), you can easily set specific filters to only see what you need. In many cases it reveals details I did not expect to see.

Detailed data might include source port, target port, target and source IPs as well as some details about the actual physical network controller handling the processing. Packet data is also really interesting to look at, especially if it goes through SSL - WireShark has pretty decent tools to cover those details too (just look at the hex table).

Capture interesting stuff

For example Windows Phone applications that come as XAP packages. Some time to set up an environment and you will be ready to intercept incoming content. Also, I found out some interesting stuff about an undocumented Zune API - also through inspecting existing transfer logs. It's really cool to see how a lot of content that is used on various web sites and application is in fact transmitted through open channels without any authentication necessary (even if that is present in the application itself). The fun fact is that you can use those channels for your own benefit (e.g. build third-party clients for specific services).

Making sure that the right applications access the right resources

From time to time I want to make sure that every application I use, that has access to the Internet, only accesses resources it should. WireShark pretty much covers every transfer layer - of course, sometimes it is hard to see what data is passed between machines due to the fact that it is encrypted, but nonetheless, it is interesting to keep track at least where the HTTP traffic is targeted.

If you go through some packets and HTTP POST requests, you will be able to see what information is sent from your device to a remote server. For example, Rafael Riviera was able to track down the data transmitted from a Windows Phone 7 device to the Software Quality Management server in a similar manner.

WireShark is not that big and doesn't consume enormous quanitites of resources, so it runs pretty well in the background while other processes are running. I would definitely recommend to try it out, even just for fun, to see what you can get net-wise out of it.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}