Linux foundation Video
A Digital Wanderer in a Connected World
Last week or there abouts, there was a big buzz around the interwebs revisiting Dan Kaminski’s OzymanDNS tool, a perl based toolkit for tunnelling TCP traffic over DNS requests (technically its TCP over SSL over DNS but whos counting) That was originally released mid-2004.
I never really found the true source of the new hype surrounding a “old” project (it may have been HAK5’s episode 504 that demonstrated the tool, mubix has put the write up in at room362)
I then found that it had since been reengineered by Andreas Gohr and wrote a brilliant write up on its setup and use and i think is the best example for any skill level.
Long story short, i gave it a go redirecting dns requests from my andrewbolster.info domain using my main development box at home as a “server” and tested it using my Asus EEEpc from a guest wireless access point in work, and it works. Its VERY slow, but it works.
But that left me with a problem; I turn off my dev box as often as I can (Dual core CPU, 3 internal HDDs, Cooling systems, 6GB ram, Fatty graphics card, etc, kinda draw a bit of juice) and i definatly dont want to leave it on if i’m going to be away from the house for weeks. So i turned to my brilliant Western Digital MyBook World edition.
Problem was the Perl in optware aswell as the one that ships with the device, had no compiled threads support, and on a less technical point, running cpan would max our CPU and memory on this tiny box, all taken up by the perl processes. Long story short, perl was not the way to go ( I would have recompiled Perl as per the write up on mybookworld.wikidot.com, but with perl performing as badly as it was with relativly simple “one time” processes, i didnt want to have that running 24/7/356 ).
Tracing back through the history led me to dns2tcp, originally written by Olivier Dembour in C, my favourite language for small systems (duh) and i found it to be hurrendously under-documented. So below is a quick blow by blow of what i did to get dns2tcp installed, running and client configured
If you do not have access to a hosted or internet assessible DNS server / BIND system, you are screwed; Some people will let you use theirs, and if you ask really nicely I’ll put in a redirect on mine, but i probably wont.
Name: [ tunnel ].andrewbolster.info
Type : [ NS ]
Value: [ iwant2gohomenow.dyndns.org ]
If i was going it command line style in BIND I’d add
tunnel.andrewbolster.info IN NS iwant2gohomenow.dyndns.net
This basically mean that when you ask “What ip address does tunnel.andrewbolster.info have?”, the andrewbolster.info server says “pfft , i dunno, ask the guy at iwant2gohomenow.dyndns.org”.
Unfortunatly, Theres nobody he can talk to there.
ipkg install gcc
For debian based, its
apt-get install build-essential
cat > ~/.dtf2tcpdrc << EOF
listen = 192.168.1.3
port = 53
domain = tunnel.andrewbolster.info
ressources = ssh:127.0.0.1:22
EOF
Yes, i know, resources is spelt wrong, but it works, ok?
dns2tcpd -F -d2
The -F keeps it in the foreground instead of daemonising it, and the -d2 is a debug flag to give just a bit more info.
If it doesnt crap out, your good to move on to the client.
cat > ~/.dtf2tcprc << EOF
domain = tunnel.andrewbolster.info
ressource = ssh
local_port = 2222
debug_level = 1
server = bolster.homelinux.net
EOF
The local_port is completly arbitrary but 2222 is my default for remove shells
dns2tcpc -d2
And you should get no errors
Now go to a different terminal and log into the server like this
ssh testUser@localhost -p 2222
Whats that you say? localhost? dns2tcp has opened up a port on your client system that connected to port 22 on the server, so your logging into the server, but my going thru the client port first.
ssh testUser@localhost -p 2222 -D 8888
As with 2222, 8888 is arbitrary, but i use it for proxies.
ITS SLOW, I know, but then next time you miss a bus or a train or a plane and you are stuck in some god foresaken hell hole of a transit hub with only the expensive starbucks wifi to serve you, it is on your own conscious wether you use this too to accidentally GET AROUND PAYING FOR IT. Its illegal, how could you ever think about doing something like GETTING FREE INTERNET. I’m ashamed of you for even thinking about USING FREE TOOLS TO GET AROUND PROPRIATORY RESTRICTIONS TO THE FREE INTERNET. Go sit in the corner, the corner with the T-Mobile wireless access.
And, if you find this write-up useful or interesting, please a) repost it with credit b) comment
Also, big thanks to all the people whos tools I’ve used to demonstrate this, be sure to visit their websited and subscribe to their feeds.
Copyright © 2010 Of Penguins & Coffee All rights reserved. Theme by Laptop Geek.