Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wireshark localhost traffic capture [closed]

I wrote a simple server app in C which runs on localhost. How to capture localhost traffic using Wireshark?

like image 988
Udara S.S Liyanage Avatar asked May 01 '11 07:05

Udara S.S Liyanage


People also ask

Does Wireshark capture localhost traffic?

On Windows platform, it is also possible to capture localhost traffic using Wireshark. What you need to do is to install the Microsoft loopback adapter, and then sniff on it.

Why won't Wireshark captures my traffic?

If your machine is not plugged into a switched network or a dual-speed hub, or it is plugged into a switched network but the port is set up to have all traffic replicated to it, the problem might be that the network interface on which you're capturing doesn't support "promiscuous" mode, or because your OS can't put the ...


1 Answers

If you're using Windows it's not possible - read below. You can use the local address of your machine instead and then you'll be able to capture stuff. See CaptureSetup/Loopback.

Summary: you can capture on the loopback interface on Linux, on various BSDs including Mac OS X, and on Digital/Tru64 UNIX, and you might be able to do it on Irix and AIX, but you definitely cannot do so on Solaris, HP-UX....

Although the page mentions that this is not possible on Windows using Wireshark alone, you can actually record it using a workaround as mentioned in a different answer.


EDIT: Some 3 years later, this answer is no longer completely correct. The linked page contains instructions for capturing on the loopback interface.

like image 186
cnicutar Avatar answered Sep 23 '22 13:09

cnicutar