Sniffing an established port

Hi All,

On a solaris box A port B
in which port B is established and receiving data.

My question is how do i listen on that established port ,
how can i get the data received at box A: port B through my application

I had searched the forum for the same, but i am unable to retrieve the required stuff

Any help would be greatly appreciated.

Thanks.

I dont know if it is of any help but u could use a packet capture library libpcap (tcpdump.org) to ease coding ... :o

http://ngrep.sourceforge.net/ - ngrep may be the tool you want....

Cheers
ZB

I guess the setup is like this:

There's a client running on a solaris box, and is receiving data.

Please note that servers specify ports they send the data on. Client don't necessarily specify the port they want to listen to the server data on.

So you may or may not know the port on which this client is receiving data.

You may want to use a portscanner like ngrep or a packet capture utility like tcpdump or ethereal to know the port on which this client is receiving data.

Although you can "see" the data using your packet capture tools, to write your own application to read that data isn't that straightforward. This however might be necessary if you want to do some special processing on the data (decrypt it, for example).

In that case, you can

  1. See if you can open a socket to the actual source from which the solaris box A is receiving data.
  2. See if you can write a small server program that allows you to write a client to get this data. The server program would get data from this A:B client.

Kapil Sharma

see "man snoop" --- look for "port" option and check example line ...

hi all

thanks for the reply

i cannot establish a connection to box A by any means

i have data being received at port B of A. that's it.

if i am able to establish a connection to box A and that would become easy for me and i am not authorised to do so.

Regarding ethereal i believe i need to have root permission and i dont have root permission also

let me try other options and let u know how i proceed

thanks once again for ur help