Thursday, April 8, 2010

TCP Tunnel - Java Port Forwarding - TCP kill

You know, sometime you just get amazed when you find an absolutely simple solution for a overly complicated problem. I was working with one client remotely and banging my head against the wall to get the access to their valuable servers. After a so much frustration I could get access to one or two servers via ssh, and that's pretty much it. I could ping to everywhere from that UNIX box but can not connect anything from my local laptop.

To make long story short, I tried using SSH tunnel, hacked routing tables of UNIX/windows but nothing came as handy as a simple Socket program which basically listens on a port and make socket connection to remote client. It is very much like TcpMon or Obtunnel but it is just bare bone version of it. Pretty much 99% of my laptop traffic was going through this tiny unix box and never had to beg for access.

java -jar springportforward.jar com.springsoa.socket.Forward localport remotehost remoteport &

Now as this become the absolutely life savor, I thought I can I can leverage something more out of it. I think we potentially can use this for tcpkill workaround. Basically try to forward all traffic through portforward, and kill the portforward to achieve same effect as tcpkill.

1 comment:

Unknown said...

Hello, it is a good article,
could you please give me springportforward.jar file if you have it and you can give me this file. I very need realize port forwarding on Java. Thanks.(inomak@yandex.ru)