Breaking out of a HTTP proxy enviroment
Being in a large corporate environment has positives and negatives, one of those negatives is that many companies use HTTP proxies to control and track internet usage from your work machines. While in most cases this is very important from the HR and workplace productivity side, it can become a headache if you actually need something outside your companies firewalls that is blocked. In my case I wanted to backup some configurations and code to my home machine. To do this I’d generally just rsync over ssh or scp the files over to an off site machine. Sadly with a full firewall up and all traffic required to go through HTTP proxies, I had to find a different solution. In my case, I decided to use ‘corkscrew’.
Corkscrew tunnels SSH connections through HTTP proxies, you can find it at agroman.net/corkscrew/. It was quite easy to setup, and with some tweaks to your ssh config you can seamlessly use it.
My next trick is useful for getting around having your HTTP usage tracked and filtered, this is just taking advantage of the “-D” option within the ’ssh’ program. When you invoke the -D option, followed with a port number you not only connect to the remote machine via SSH, but you also create a SOCKS proxy server on the port specified. Setting up your browser’s proxy settings to point at that port on your local machine will securely forward any requests over to the remote machine, where they will then go out to their final destination.
When you combine corkscrew with ssh -D, you end up with a single, secure connection through the HTTP proxy to your remote machine with a SOCKS proxy through it. This effectively gives you an easy unfiltered hole through to the outside.
Disclaimer: Check with your IT policies before attempting any of the above to make sure its allowed!