-1

I have an application, which goes and hit an Web Service and displays the data.

The port to which the application establishes a TCP connection I discovered by using the lsof command.

But I'm not sure how to capture packets destined for that port to see what all data the application sends and receives.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
sriram
  • 8,562
  • 19
  • 63
  • 82
  • Your terminology and problem description kind of clashed with a completely different problem. By editing, I'm afraid I might have made the question rather daft, but hopefully you should be able to obtain some good beginner-level answers now. Unfortunately, the answers you already received were for that other question. Feel free to revert if that's what you really meant. – tripleee Mar 13 '14 at 09:52
  • You should probably simply visit http://wireshark.org/ – tripleee Mar 13 '14 at 09:56

2 Answers2

-1

Open a TCP connection to port 42 of host.example.com, using port 31337 as the source port, with a timeout of 5 seconds:

$ nc -p 31337 -w 5 host.example.com 42

Open a UDP connection to port 53 of host.example.com:

$ nc -u host.example.com 53

nc utility

http://www.tutorialspoint.com/unix_commands/nc.htm

Dexters
  • 2,419
  • 6
  • 37
  • 57
-2

If you have root or pseudo root access...

snoop to port

Or even google the truss command if you have the PID but i guess you just want the port itself. Hope this helps.

Ray
  • 615
  • 7
  • 22