Connection to remote networks with (tox-) socks and proxychains

To connect from your local workstation to a remote network through socks proxies you can use (tox-) socks.

ToxSocks is able to connect to a remote network with socks protocol, but in my case it only worked with exactly one socks proxy server. In my special case I had to connect through several „chained“ proxy servers. Example:

localhost  <–>  socksProxy1  <–>  socksProxy2   <—>  remoteNetwork

This was not working with socks stand alone. On Linux you can use „proxychains“ to make a connection chain with several (socks-) proxies.

Install Proxy-Chains:

user@laptop:~$ sudo yum install proxychains

Configure the proxies and the chain:

user@laptop:~$ vim /etc/proxychains.conf

I have defined 2 socks clients in one chain:

# add proxy here ...
# meanwile
# defaults set to "tor"
#socks4 9050
socks5 1080
socks5 1080

With that configuration your connection looks like this:

localhost  <–>  <–>  <–>  remoteNetwork

Now, how to use this? It’s quite simple: proxychains <command> <paramters>
Just place „proxychains“ in front of the command you would like to execute.


Remote Desktop:

proxychains rdesktop -u <Domain>\<user> -p <password> -z -k de -g 1366x768 <ip>

Explanation:  „-z“  activates compression ,  „-k de“ sets the keyboard to german layout,  „-g 1366×768“ sets the Display Size. On a shell you have to escape with \.


Samba-Client / SMB:

proxychains smbclient -U <username>%<password> -W <workgroup> \\<ip>\<share>

Explanation: with this command you can connect via smb protocol to a samba share. You need to take your windows username, password, and the Windows Workgroup. On a shell you have to escape with \.