Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

SOCKS5 Proxy

Published on

A SOCKS5 proxy allows you to have network traffic as if it was coming from the proxy server as opposed to your local client. You can easily set it up using SSH from your local machine.

ssh -D 1337 -N user@remotehost

The above command opens the port 1337 on localhost and redirects traffic from that port over the SSH connection to the remote machine.

On the client computer, you can then go to your browser settings and specify localhost:1337 as a SOCKS5 proxy. Some commands allow you to specify a proxy in their flags. For example:

curl --proxy socks5h://localhost:1337

Not all commands make this easy however, which is where proxychains comes in. It allows you to route traffic from a specified subcommand over a proxy. For example:

proxychains curl

To do this you will need proxychains installed. On Ubuntu, the package is called proxychains4. Then you’ll need to edit the bottom of /etc/proxychains4.conf to contain the following line:

socks5  1337
Reply via Email

Have you published a response to this? :