News:

How did you even find this place?

Main Menu

[Java] Reading from an already open socket

Started by Lance, July 14, 2008, 12:58:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lance

How can I listen to a socket opened by another program? Let's say I just logged on BNET with JavaOP2 and I received the ENTERCHAT packet. I want to view the contents of that packet in my program x3
Quote from: Joe
[23:55:31] [william@enterprise ~/Documents/Programming/javaop2]$ svn commit -m 'Tried to fix StayConnected. Again.'
Committed revision 63.
StayConnected strikes back!

Camel

#1
There is no way to do this through the Java API. You could write a JNI library to utilize a packet logging library such as WinPcap (for Windows) or similar.

Other than that, you can do a man-in-the-middle attack, where you write a program that acts as a proxy for the BNCS connection.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Chavo

Or just modify JavaOP since you have the source ;)

Ender

#3
Quote from: SarCaSTiC on July 14, 2008, 12:58:04 PM
...

If the purpose of your account is to post technical questions, then I have to question how you came up with your username ;)

Quote from: Chavo on July 14, 2008, 07:18:46 PM
Or just modify JavaOP since you have the source ;)

Yeah, I believe this would be the quickest way. If you want the information dynamically, I suppose you could set up a port on localhost to which you forward the stuff that you want from JavaOp, and then listen to that port on localhost with your program. Of course if it's just a single packet then you could write to a file.

Though I wonder why you're doing this in the first place... and I wonder why I'm posting four days later...