Creating a SOCKS5 tunnel from your favorite coffee shop...

Post Reply
Marcos Della
Posts: 9
Joined: Tue Sep 06, 2016 2:42 pm

Creating a SOCKS5 tunnel from your favorite coffee shop...

Post by Marcos Della » Thu Jan 05, 2017 10:23 am

So, one thing we've learned through several of the security classes is that its pretty trivial to watch traffic while your at a coffee shop. Additionally with the advent of things like the your traffic can and probably will be both monitored and copied. I personally got hit at Cabrillo campus by someone pulling out one of my Amazon.Com cookies and purchasing a bunch of digital resources from them before they shut it down (I had my money refunded, but for awhile there I was looking at a pretty big bill).

If you're not using a secure WiFi with a valid key (unfortunately Cabrillo HawkNet doesn't have a valid key so its just as vulnerable as anywhere else technically) then you need to do something to protect your traffic a little. One such method is to SOCKS proxy your traffic to a position on the network that you do "sort of" trust.

For those that want to set up a server at home, etc, that is a much longer process than this document describes, but this is the basis you'll want to start with. I have a proxy running at my house behind my firewall on the comcast network. I use Dynamic DNS so that I can get to the home network most of the time from outside of my house.

Anyway, the easiest machine to use at Cabrillo is as this is already set up as a student machine and is running openssh as its SSH termination point.

I personally use SecureCRT as my SSH client as it has full terminal emulation, logging, scripting, lots of various protocols, etc. It was built on top of their original terminal emulation product and has since morphed into a widely successful product. Student discounts available.

Anyway, what you want to do is set up your "localhost" on your laptop/desktop to tunnel via port 1080 (dynamic port forwarding) to (or your home server if its running openssh with socks5proxy on). Although the two links on how to do this say make up a port, its best to use the standard port 1080 so that various things you might use this with will work "out of the box".

Putty: ... nnel-putty

Key things to remember:
Opus uses port 2220 rather than port 22 for SSH
Default SOCKS5 port should be 1080
The proxy in Putty or SecureCRT needs to be set to dynamic forwarding.

Both of the above documents also tell you how to change your browser to use the proxy. Just remember to turn it on/off depending on if you're connected to a destination SOCKS5 proxy.

If you use wireshark on your laptop while connected to the proxy (and your browser is correctly configured) you will see traffic only to your SSH server regardless of where you "surf" to on your browser. If anyone grabs the man in the middle at a local wifi shop (or even at the school like what happened to me), they will see nothing by SSH encrypted traffic.

Hope this helps someone...

Marcos Della
Distinguished Technologist
HP CWP, Hewlett-Packard Inc.

PGP Fingerprint: BDC7 AFFD E94F FA09 C839 9153 F5FF E128 3094 2B9E
Key ID: 0x30942B9E

Post Reply

Return to “CIS 76 Archives - Ethical Hacking”