The Turkey Curse
fukamis terror chatroom


Pungenday, 10th Discord, 3171.

After finding a way to connect silc-client via Tor, Astro got a little smile and pointed me to socat (and blogged about it). socat stands for “socket cat” and is often refered as “netcat on steroids”. While nc is a nifty tool for many needs of TCP and UDP networking, socat supports a broader range of address types. socat also comes with two other nifty tools which are meant to use for debugging socat, but which also can be useful for other purposes: filan for printing informations of active file descriptors and procan for printing process parameters.

I can not say that I understand everything socat offers, but it’s very powerful and fun to play with it. The man page shows a couple of examples to get an idea.

Some very easy examples to start:

binfnord% socat -d TCP6:localhost:22 STDIO
SSH-2.0-OpenSSH_3.6.1 NetBSD_Secure_Shell-20030917

Connects socat to a OpenSSH server on localhost using IPv6.

binfnord% socat TCP4-LISTEN:2342 EXEC:’/usr/bin/uname -a’

As know in netcat it is possible to connect a listener to a provided script. socats man page contains a nice example how to use it for forking a shell in a chrooted environment.

binfnord% socat TCP4-LISTEN:2342,fork \

The machine is using Tor, so it is possible to provide a proxy to a hidden IRC service for other machines. The fork option enables the possibility to produce more connections, either by listening or by connecting in a loop.

To use socat as proxy command with OpenSSH to connect hidden servers, place this into your ~/.ssh/config

Host *.onion
ProxyCommand socat STDIO SOCKS4A:localhost:%h:%p,socksport=9050

socat is definitly one of the coolest networking tools I’ve ever seen. I hope Astro and me will manage to provide more useful examples by the time in the BSD-Crew wiki.


No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

"There's a fine line between fishing and just standing on the shore like an idiot." - Steven Wright

The Turkey Curse is powered by WordPress, template idea by Priss

Entries (RSS) and Comments (RSS).
Generated in 0.044 seconds.