httptunnel: TCP over HTTP

Translation of the original in Catalan. Read it in: CatalàCastellano

HTTPtunnel logo
HTTPtunnel site

With httptunnel you can establish TCP connections over an HTTP link, that is, we have two tools, htc and hts; essentially what it does is:

  • hts: publishes a port simulating an HTTP server; when we connect with htc it will send us to the configured HOST:PORT

  • htc: connects to hts using HTTP and simulating a normal HTTP client (ffx, crhome, ie, etc) but it actually transports TCP packets in the payload of the queries; the user can connect to a local port that is published and that allows accessing, transparently, the HOST:PORT hts has connected to

To make a proof of concept what I have done is connect hts to a VNC server; next to htc I have connected a VNC client and I have accessed the VNC in a totally transparent way; besides, with a sniffer I have checked that the packets strolling through the network were standard HTTP packets, and so they were. As simple as this:

server:
./hts -w -F 127.0.0.1:5900 1080

client:
./htc -F 2300 server:1080
vinagre localhost:2300

It also supports the possibility of doing it through a proxy, although this is only supported if it is without authentication or with basic authentication. So, from this some interesting improvements come to mind:

  • supporting Digest and NTLM authentication.

  • allowing access to the tunnel via stdin/stdout (that way we could use it with SSH as a ProxyCommand).

  • being able to connect to a second proxy at the remote end, that is, hts does not have the link pre-established.

  • supporting SSL, that way we would save ourselves having to use stunnel to simulate HTTPs.