Windows packet sniffer that can capture loopback traffic? [closed]
Asked Answered
D

7

31

(This is a followup to my previous question about measuring .NET remoting traffic.)

When I am testing our Windows service / service controller GUI combination, it is often most convenient to run both pieces on my development box. With this setup, the remoting traffic between the two is via loopback, not through the Ethernet card.

Are there any software packet sniffers that can capture loopback traffic on a WinXP machine? Wireshark is a great package, but it can only capture external traffic on a Windows machine, not loopback.

Diplomatist answered 5/9, 2008 at 17:42 Comment(1)
This has been answered well here: #1566734Vesting
C
25

What you should do is to run RawCap, which is a sniffer that can capture traffic to/from the loopback interface in Windows. Just start it with "RawCap.exe 127.0.0.1 loopback.pcap".

You can then open up loopback.pcap in Wireshark or NetworkMiner to look at the network traffic.

You can find RawCap here: http://www.netresec.com/?page=RawCap

Good Luck!

Collar answered 10/4, 2011 at 8:42 Comment(4)
Interesting option. Too bad they wait to the bottom of the description page to tell you: "this doesn't work on Vista or Win7 - use XP"!Diplomatist
@McKenzieG1: I just used RawCap on my Win 7 x64 machine to capture 127.0.0.1 traffic - so if there was a limitation to XP it's gone now.Zane
Actually: "The main problem with raw socket sniffing in Vista and Win7 is that you might not receive either incoming packets (Win7) or outgoing packets (Vista). If you only wanna sniff from localhost/loopback (127.0.0.1) though, then newer version of Windows actually works better than the old XP. When sniffing from localhost in Windows XP you will only be able to capture UDP and ICMP traffic, and not TCP. But TCP, UDP and ICMP packets can all be sniffed properly from localhost on both Windows Vista as well as Windows 7."Mustee
Does not support IPv6 thus doesn't work with Windows 10.Cavazos
Z
12

I second the Microsoft Network Monitor (though this link works better at the time of writing) suggestion from Thomas Owens. Also, this post suggests that to get the loopback address, try doing:

route add <Your Machine's IP> <Your Router's IP>

This takes locally-generated packets for the local interface and sends them off to your router... which sends them back.

NOTE: To get your machine back to normal operation, make sure you delete the route when you're finished using:

route delete <Your Machine's IP>

Zeph answered 21/4, 2011 at 1:2 Comment(5)
+1 - This worked perfectly, I can now use NetMonitor. To add the route I entered this command in the Command Prompt Window (My Machines IP is 192.168.64.222, and the gateway's is 192.168.64.1). route ADD 192.168.64.222 MASK 255.255.255.255 192.168.64.1Firebrick
This worked great for me. To remove the route just use route delete <Your Machine's IP>.Diaghilev
+1 This worked for me as well using Wireshark! You should consider modifying your answer to recommend removing that route when you're done. Perhaps add a route delete <IP> <Router> command sample.Tiffie
@Zv_oDD : It saved my bacon on a couple of occasions! Glad it was of some use. :-)Zeph
Wow. Anyone care to explain the recent downvote?!?!Zeph
G
9

There is a page on the Wireshark wiki that addresses the problem. Short answer is, you can't do it on a Windows machine, but there might be some workarounds.

Gibun answered 5/9, 2008 at 18:53 Comment(2)
Yes you can, using RawCap to capture and WireShark to analyze the captured data. I have done this under Windows 7 today. See Erik's answerZane
RawCap is a great tool. Unfortunately, it works only with IPv4. It doesn't support IPv6 as of Apr 2014.Catenoid
F
3

I'm not sure if it can or not, but have you looked at Microsoft Network Monitor? It might be an option.

Faunie answered 5/9, 2008 at 17:45 Comment(1)
I downloaded it but it did not capture packets I sent to my machines IP address.Diaghilev
S
2

Did you try to install the MS Loopback Adapter and try sniffing on that adapter with you favorite sniffing application?

Also if I remember correctluy NAI Sniffer link did use to have loopback sniffing capabilities, but it's been a while I used either solution...

Shoa answered 5/9, 2008 at 21:47 Comment(2)
I think that could work. IIRC I used the loopback adapter to trace network traffic of virtual machines.Duran
Does the MS Loopback Adapter work or not?Diep
S
2

If you don't care to pay, try this: CommView

It seems to work, however the Evalution version doesn't display the complete packets.

Schoenfelder answered 22/9, 2009 at 15:24 Comment(0)
T
0

You should definitely try Npcap, it works perfectly with Wireshark to capture loopback traffic in Windows, see here: https://wiki.wireshark.org/CaptureSetup/Loopback

Trichome answered 11/11, 2015 at 17:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.