Proxying SSH with SOCKS (HTTP was so 2007)

By writing this I am assuming you know what SOCKS is, and you know what SSH is. If you don’t, here is a picture of a monkey fucking a coconut to make this visit worth your while:

Could be a melon, but looks like a co-co-nut.

Could be a melon, but looks like a co-co-nut.

So, there comes a time in a man’s life when people at work on the inside network need to access things on the internet.  This is called “proxying”.  Yes, yes, I know; very fascinating.  These secure machines on the inside network don’t have access to the internet by design (See RFC 1918).  It’s the most basic layer of obfuscation (a 25 cent word we use a lot in the security world) and protection from bad internet traffic, not including firewalls and all that other exciting stuff.

Ok so we want to let our secure hosts on the inside proxy SSH to the internet via our SOCKS server.


  • A Unix/Linux machine with the latest version of netcat installed (assumed to be found at /usr/bin/nc).  All modern operating systems have this.  Stop whining.
  • A SOCKS proxy listening on TCP port 1080.
  • A remote internet server listening for SSH connections on TCP port 22.
  • You know what ~ means.  (Hint:  It’s shorthand for your home directory.)
Do the damn thing:

Create an entry in ~/.ssh/config. If this file doesn’t exist, create it. If it does, add this shit to the bottom:

Host proxythatshit
    ProxyCommand /usr/bin/nc -X 5 -x 22
Write, quit, and then test that shit! I am hoping that you gathered “proxythatshit” is the nickname we’re assigning this proxied connection to By putting this stuff in the config file, it makes it easy to reuse.
% ssh proxythatshit
jathan@proxythatshit's password:
Did you see that? It worked!! OMGZ!!JLk

A little breakdown:

ProxyCommand /usr/bin/nc -X 5 -x 22

  • ProxyCommand: An OpenSSH directive that tells SSH how to proxy the connection
  • /usr/bin/nc: The path to the netcat binary and the ProxyCommand in question here.  Proxying is one of the many things netcat does.
  • -X 5: Tells netcat to use SOCKS version 5
  • -x Tells netcat to proxy the connection using on port 1080
  • 22: The name and port of the destination we’re trying to get to by way of the proxy

You may be asking yourself, “Why not just use an HTTP proxy?”  Because HTTP proxies tend to be very picky about allowing you to proxy non-HTTP connections to destination ports other than the one you connected to.  In other words, if the proxy is listening on port 8080, good luck proxying a connection that isn’t HTTP (such as this SSH proxy thing) on anything other than port 80, 443, or 8080 it probably won’t work. If you’re using mod_proxy, it absolutely will not work.  Don’t ask me why.  It just doesn’t.  Squid might work, but it is a pain in the ass to setup.

There you have it.  Don’t blame me if you get fired because you were looking at a picture of a monkey fucking a coconut for the 52 seconds it took to read this.

San Diego Comic Con 2009: Brain Dump

So I just spent the last four days of my life at the 2009 San Diego Comic Con. It was the third year in a row I have been to SDCC and the first year that I went for more than just one day.  It was both too much and not enough at the same time.

I found myself wanting to live more of the professional experience of talking to artists, getting books signed, hunting down exclusive items and generally just living of all the action that makes it so awesome.  I met some interesting people, and was surprised that many of the most popular comics out there just don’t interest me.  I guess I have always kind of been like that.  I’ve never really been IN to comics in the way that most comics fans are, or at least how I perceive them to be.

I feel like most of the plots and stories I are cliche and most of the art is just too absurd or derivative.  It’s really hard to explain without sounding like I’m a pretentious dickwad.  Fact is I’m not a fanboy, I’m just a fan.  I only buy into comics when I can get in on the ground floor and feel like I’m truly experiencing a story from the beginning.  For the most part that leaves me out of pretty much every mainstream franchise and I’m totally okay with that.

So rolling with that, I’m going to list my favorite things from SDCC 2009, only the first of which is actually a comic:

  1. Kick-Ass: I recently discovered Kick-Ass in a local comic store.  As I mentioned above, I only like getting into stories from the beginning. Issue #6 was the first one I bought, which has a little girl covered in blood holding two swords.  I was intrigued.  I bought issues 1-4, and 6.  They were out of #5. I went to SDCC with the mission of finding #5.  Turns out, they are making a Kick-Ass movie and held a panel for it at SDCC!  I missed the panel, but did make it home with #5.  Mission accomplished.
  2. Avatar: James Cameron’s first film in 15 years?  I’m there.  I didn’t see the panel nor the exclusive trailer, but I heard lots and lots of chatter all weekend about the concept of the avatars.  There was also an Avatar booth with a massive 20-foot mech suit (wicked!) from the film and prototype toys in a diorama case.  I hate it when you can’t play with the toys!
  3. District-9: I attended the panel for this on Friday. Peter Jackson himself led the panel and spoke candidly on the birth of the project. It was fascinating to learn that as soon as the plug was pulled on the Halo movie, they immediately focused all of that creative energy into their own project which became District-9.  Considering it was made on such a low budget ($30M USD), you would never know having seen the 7-minute teaser we got to see.  I popped at least 17 boners, while watching it.  And we got to see it twice.  So that’s what… 34 boners minimum?
  4. Iron Man 2: Aww yeah,  Scarlett Johansson as Black Widow?  17 more boners.  Not seen:  Gwyneth.  Who cares?
  5. Chessex Booth: Dice!  Role-playing supplies!  I was at this booth for like half an hour drooling over the absurdly vast selection of dice.  I just love dice!! Of course I bought some.  I could feel my girlfriend judging me all the way from LA, but it wasn’t enough to stop me.
  6. Half off all trades! Got some great last-minute deals on some books I’ve been wanting for a long time.  Like Wanted for $10!
  7. Half-ass costumes. Low point equates to high point.  I laughed a lot at the expense of others.  A LOT.  Come on people.  If you’re going to dress as G.I. Joe, go the distance.  Slapping on some camo pants and a toy gun is not half the battle.
This was the biggest SDCC to date.  Try to imagine 125,000 geeks, freaks, nerds, dweebs, artists, impersonators, celebrities, executives, and a handful of ingrates descending on San Diego like the plague.  Make no mistake: it was C R O W D E D.  You couldn’t swing a dead cat without hitting a fat nerd dressed as a Klingon.

Ok, I’m exaggerating… a little.  I didn’t see a single Klingon this year!  The theme was definitely Steampunk, which I found odd because there is nothing coming out that directly inspires such a theme.  I guess that’s just the in thing right now amongst the nerdy elite.  It’s like Back to the Future 3 meets Final Fantasy, if you can picture that.  Or how about people in trenchcoats with goggles, rapiers, army boots, and… laser guns!  pew pew pew

Being that it was so crowded there was a lot of pondering about how “it can’t go on like this”.  The average wait was like two hours for the big panels and no less than an hour for everything else.  There was a rumor floating around that this could be the last year of SDCC in San Diego as we know it.  The rumor was that it could be moving to Los Angeles or (God forbid) Las Vegas if the San Diego Convention Center and possibly even San Diego at large can’t meet the growing demands of the con.  Something about the contract being up for negotiations, blah blah blah, etc etc.

All I gotta say is it just wouldn’t be the same SDCC without the SD in it. I wouldn’t mind it being a little closer to home in LA, but downtown LA is fucked enough as it is without 125,000+ nerds descending upon the place for five days in the dead of summer.  Yeesh.  I hope the folks in San Diego don’t let the convention walk.  That would be bad stuff.

I had a great time and was sad to leave on Sunday.  Despite how crowded it was I want to go for the entire time next year, instead of only Friday – Sunday.  That is, if it’s still there… dunt dunt dunnnn

Creating read-only user accounts on ScreenOS

Need to create a read-only account on a NetScreen (ScreenOS 6.x or lower) firewall?

It’s simple:

netscreen(M)-> set admin user nocadmin password abc123 privilege read-only
And there you have it. Now let’s test it:
% ssh nocadmin@netscreen
nocadmin@netscreen's password:
For Authorized Use Only, Violators Will Be Prosecuted.
It works! Notice the limited command set available:
netscreen(M)-> ?
exit                 exit command console
get                  get system information
mtrace               multicast traceroute from source to destination
ping                 ping other host
trace-route          trace route
Now hop to it!

Shiny, new blog!

Welcome to my shiny… new… blog?

I have been thinking about this for a long, long time, and I’m finally doing it.  I’ve reached a point in my life where I want to start putting my thoughts out there and provide my share of wisdom, expertise, and sometimes idiocy to the internet.

A long-time friend of mine recently told me that I have a very accessible writing style and that when people read my stuff it feels like a dialogue as opposed to a technical manual that draws the reader in and makes them chuckle.  By the way, “stuff” is a technical term.

Are you chuckling yet?

No?  Well anyways, I hope that this will become a resource in the form of knowledge or  entertainment or both for many people.  We’ll see…