Wednesday, October 24, 2018

How to setup proxychains

Sometimes we need to remain untraceable while performing a pentest activity. Proxychains helps us by allowing us to use an intermediary system whose IP can be left in the logs of the system without the worry of it tracing back to us. Proxychains is a tool that allows any application to follow the connection via a proxy such as SOCKS5, Tor, and so on.

Setup Proxychains

Since proxychains is already installed on Kali we just need to open the config file of proxychains in a text editor with this command

nano /etc/proxychains.conf


We can add all the proxies we want in the preceding highlighted area and then save. Proxychains also allows us to use dynamic chain or random chain while connecting to proxy servers.

To get proxychains to use intermediary proxies, we simply need to add the IP addresses of the proxies we want to use here. It's important to note that proxychains defaults to using Tor.

Notice the last line in the screenshot above. It directs proxychains to send the traffic first through our host at 127.0.0.1 on port 9050 (the default Tor configuration). If you are using Tor, leaves this as it is. If you are not using Tor, you will need to comment out this line.

Note that Tor is very slow and it has been broken by the NSA.

Once proxychain has been setup, you can execute this command to run any program you want through the proxychains

proxychains "the command you want to proxied" "any arguments"

Example lets say you want to run Nmap through proxychains, you would type in something like this

proxychains nmap -sS 8.26.65.101


As you can see the screenshot above I have successfully scanned the address through my chosen proxy and return the result back to me. I this way, it appears that my proxy has scanned the address and not my IP address

Adding more Proxies

To add more proxies to your list open the /etc/proxychains.config and add more proxy IPs like I have below.

nano /etc/proxychains.config


Now that we have multiple IPs in our proxychains.conf we can set up dynamic chaining. Dynamic chaining will enable us to run our traffic through every proxy on our list, and if one of the proxies is down or not responding, it will automatically go to the next proxy in the list without throwing an error.

Dynamic Chaining

To setup, dynamic chaining re-open the proxychains config file and uncomment out the dynamic_chains line. This will enable dynamic chaining of our proxies allowing for greater anonymity and trouble-free hacking.


Random Chaining

Now we can use random chaining to randomly choose an IP address from our list and use them for creating our proxychain. This means that each time we use proxychains, the chain of proxy will look different to the target, making it harder to track our traffic from its source. For this to work you will need to open the proxychains.config file and uncomment out both the dynamic and random chain.

In addition; you may want to uncomment the line with "chain_len". This will determine how many of the IP addresses in your chain will be used in creating your random proxy chain.


Now that you know how to use proxychains, you can do your hacking with relative anonymity. I say relative because there is no surefire way to remain anonymous with the NSA spying on all our activity. All we can do is make detection MUCH harder, and proxychains can help do this for us.

0 comments:

Post a Comment