1

Anyone knows if it is possible to setup port forwarding with a telnet client, like it is with SSH?

3 Answers 3

5

You can do it with netcat, but it's a huge security hole:

http://www.stearns.org/nc/

http://forums.remote-exploit.org/newbie-area/5857-netcat-port-redirection.html

mknod backpipe p
nc -l -p 80 0<backpipe | tee -a inflow | nc localhost 81 | tee -a outflow 1>backpipe

FWIW, this is probably a profoundly bad idea.... make sure your firewall is tight as a drum...

4
  • This would require the client to install netcat though, which as far as I know not available for Windows.
    – mr-euro
    Sep 18, 2009 at 14:15
  • 1
    netcat by all means runs on windows.
    – geeklin
    Sep 18, 2009 at 14:59
  • OK, i located an unofficial port for Windows with Google. Still, i was looking for an integrated part of Windows so all users had the right tool without any further downloads. Thanks for the idea though, never thought of netcat being used as a proxy. Cheers!
    – mr-euro
    Sep 18, 2009 at 16:36
  • Not really the exact answer, but inspired me to use nc for other stuff. Thx.
    – mr-euro
    Oct 26, 2009 at 15:57
3

Should be, yes...just forward the appropriate TCP port at the border you're doing the forwarding on. I don't know if you mean on the machine, forwarding using SSH, or forwarding through BRANDX router...

EDIT: wait...are you saying using telnetd to forward ports like sshd does? No, telnet is purely a console application that gives shell access to a machine, as far as I know. I thought you meant can you port forward TELNET, not forward ports with telnetd.

4
  • Yes, exactly the same feature as sshd is what i am looking for. Basically a SSH tunnel but no encryption at all (I do not need it).
    – mr-euro
    Sep 18, 2009 at 14:14
  • 2
    Okay, yes, you could jump through some hoops to do it but like Tim pointed out it's a huge huge security hole since anyone can read traffic in plaintext. Why jump through hoops to do it when you can do it with SSHD? Sep 18, 2009 at 14:17
  • Well, telnet is on all Windows machines. A SSH client is not. Besides in this task I do not need an encryption so I thought of "downgrading" to telnet. The data being in plain text (even the credentials) is fine for this specific usage.
    – mr-euro
    Sep 18, 2009 at 16:39
  • it kind of is a downgrade...and ssh is readily available for most platforms. Port forwarding is done on the server anyway, not on the client. You can use PuTTY as a standalone freeware ssh client for Windows. Sep 18, 2009 at 17:11
0

Yes.

machineA $ telnet machineB
  Username: someguy
  Password: whoIsGoingToGetHackedForRunningTelnet
machineB $ telnet machineC someport
   (whatever someport does)

Have a program at either end of that that talks through the tunnel, and you're set. You could use expect, or your language of choice, to automate this. You'll only get one port at a time.

But, why do you have telnet open on anything these days? :)

1
  • Have not used telnet for ages, but I needed a application to port forward that is on all Windows machines and thought of telnet perhaps being a candidate. It looks though as it is not feasible.
    – mr-euro
    Sep 18, 2009 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .