3

I have two applications communicating on same machine (localhost) using socket. If application are on different machine I can use Wireshark. But how to capture packets on same machine.

I do not know on which port number application are communicating. Because I am using library calls and do not know lower level details.

We are having our application on Ubuntu and Windows XP.

Pranit Kothari
  • 9,721
  • 10
  • 61
  • 137
  • Are you on Windows or Linux? For windows this is a duplicate: http://stackoverflow.com/questions/1566234/sniffer-for-localhost-windows-os – rene Sep 02 '13 at 09:58
  • @rene I need it for both OS. We are having our application on Ubuntu and Windows XP. – Pranit Kothari Sep 02 '13 at 10:01
  • I added your comment to your question. Please check if that's ok with you. – rene Sep 02 '13 at 10:13

1 Answers1

6

On Linux you can use netstat to determine the ports that your application are using. Then you can use Wireshark to capture on the loopback interface (just enter your own IP address if 127.0.0.1 dont work).

Refer to: https://stackoverflow.com/questions/1566234/ for capturing on Windows.

Full-Fledged
  • 309
  • 2
  • 8
  • How does `netstat` capture traffic? Because that is what the OP asks. – rene Sep 02 '13 at 10:18
  • 1
    He also asked "I do not know on which port number application are communicating ". He can use this to first determine which ports are being used, this can then ease the filtering on Wireshark – Full-Fledged Sep 02 '13 at 10:25