Technical question - reading data from TCP port

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
eyl
Jedi Knight
Posts: 714
Joined: 2007-01-30 11:03am
Location: City of Gold and Iron

Technical question - reading data from TCP port

Post by eyl »

I have an issue I hope someone can help with (as frankly, my network-fu is pretty weak).

I have a program sending data on a TCP port at localhost. I need to be able to read that data. Is anyone familiar with an application which can:

1) Open and listen to the localhost port.
2) Preferably display the data in hexadecimal
3) Display a timestamp for each packet of the incoming data
4) Record the data (or alternatively dump it to the screen and allow copy-pasting), inlcuding the timestamp.


Thanks!
User avatar
phongn
Rebel Leader
Posts: 18487
Joined: 2002-07-03 11:11pm

Re: Technical question - reading data from TCP port

Post by phongn »

User avatar
Ace Pace
Hardware Lover
Posts: 8456
Joined: 2002-07-07 03:04am
Location: Wasting time instead of money
Contact:

Re: Technical question - reading data from TCP port

Post by Ace Pace »

Netcan to open the port and display the data, wireshark to sniff it. As far as I am aware, wireshark can't open a socket on it's own.
Brotherhood of the Bear | HAB | Mess | SDnet archivist |
eyl
Jedi Knight
Posts: 714
Joined: 2007-01-30 11:03am
Location: City of Gold and Iron

Re: Technical question - reading data from TCP port

Post by eyl »

phongn wrote:Wireshark, tcpdump, netsniff-ng ...
tcpdump doesn't give a GUI or which makes it more difficult for me. As for netsniff, it's for Linux; I forgot to mention that I need it to work in a Windows 7 64-bit environment.
Ace Pace wrote:Netcan to open the port and display the data, wireshark to sniff it. As far as I am aware, wireshark can't open a socket on it's own.
I can view the data with Netscan (although not in hex, so it looks like gibberish) - can you point me to an explenation of how to get wireshark to see it? I can't seem to figure out how to set it up...

Thanks
User avatar
Ace Pace
Hardware Lover
Posts: 8456
Joined: 2002-07-07 03:04am
Location: Wasting time instead of money
Contact:

Re: Technical question - reading data from TCP port

Post by Ace Pace »

eyl wrote:
Ace Pace wrote:Netcan to open the port and display the data, wireshark to sniff it. As far as I am aware, wireshark can't open a socket on it's own.
I can view the data with Netscan (although not in hex, so it looks like gibberish) - can you point me to an explenation of how to get wireshark to see it? I can't seem to figure out how to set it up...

Thanks
netcat, not netscan.

To listen to a port and write the results to a file
ncat -l 1234 > blah.bin
If you want to display to screen (doubtful) just remove the > blah.bin.

To get wireshark to see it, apply the following filter.
tcp.port eq 1234

Do note that if you are connecting two network programs locally (I.E your own address, be it localhost or your own IP) then wireshark will not see it. But if it travels over the wire(or wifi), it'll pick it up.

If you're having trouble finding ncat for windows, this link should set you up. I just used it.
Brotherhood of the Bear | HAB | Mess | SDnet archivist |
Post Reply