Downloads

Tunnel

tunnel is a semi-functional program to establish and negotiate a tcp connection via an intermediate telnet connection. It is a console based utility.

Audience: linux networking hackers
Requires: gcc
Language: C
Licence: Don't blame me

I wrote the program in order to connect to a system behind a Cisco 1600 router which was only running ssh and not telnet. Unfortunately, this particular router strips characters 0x00 and 0xFF, so the program does not work for this purpose.

We hope you can use it for some other purpose:

What it does
The program does this:

ASCII art

+------------+        +------------+        +------------+
|            |        |            |        |            |
|            |        | Non-routing|        | Target     |
| My machine |--------|   router   |--------|            |
|            |        |            |        |            |
|            |        |            |        |            |
+------------+        +------------+        +------------+

Example
This chat script logs in to the router, tries really hard to make it 8 bit clean without echo, and requests a further connection to the otherwise inaccessible server: " . le_code(le_file("chatscript")) . " The only other thing is to get ssh to run it: " . le_code(" ssh 0.0.0.1 -v -o 'proxycommand ./tunnel 192.168.18.245 23 chatscript' killall tunnel ") . " Instead of negotiating a connection itself, ssh uses stdin and stdout of the tunnel command. Note that ssh does not kill the program -- if someone can suggest why, mail me. I do not claim to have debugged it.

Download

  • tunnel.c - utility to negotiate tricky connections
  • allchars.c - print out characters 0 to 255. You can use this, together with netcat -l -p 55555 | hex on the remote machine to see whether the connection is 8 bit clean (in the one direction, at least). Guess what I discovered when I sent this to the cisco router I wrote the program for? It's not 8 bit clean!
  • Makefile - Make life simpler
  • Bugs:

    TODO: