ProxyChains is a tool that forces any TCP connection made by any given application to follow through proxy like TOR or any other SOCKS4, SOCKS5 or HTTP(S) proxy. Supported auth-types: “user/pass” for SOCKS4/5, “basic” for HTTP.
proxychains <prog> [args]
open Proxychains Config file :
cyborg@cyborg:~$ sudo gedit /etc/proxychains.conf
When we do so, we will see a file like that displayed below. If we scroll down this file a bit, we will see a section that I have highlighted labeled “add proxy list here…”.
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 use 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.
Let’s Test It
Now that we have put a proxy between us and any traffic we send, let’s test it out. In this case, I am simply going to do an nmap scan to 18.104.22.168 anonymously by sending the scan through a proxy. The command would be as follows:
cyborg@cyborg:~$ sudo proxychains nmap -sS -v 22.214.171.124 ProxyChains-3.1 (http://proxychains.sf.net) Starting Nmap 6.40 ( http://nmap.org ) at 2015-09-14 16:43 IST Initiating Ping Scan at 16:43 Scanning 126.96.36.199 [4 ports] Completed Ping Scan at 16:43, 1.02s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 16:43 Completed Parallel DNS resolution of 1 host. at 16:43, 0.08s elapsed Initiating SYN Stealth Scan at 16:43 Scanning sc-in-f139.1e100.net (188.8.131.52) [1000 ports] Discovered open port 443/tcp on 184.108.40.206 Completed SYN Stealth Scan at 16:43, 12.85s elapsed (1000 total ports) Nmap scan report for sc-in-f139.1e100.net (220.127.116.11) Host is up (0.14s latency). Not shown: 999 filtered ports PORT STATE SERVICE 443/tcp open https Read data files from: /usr/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 14.05 seconds Raw packets sent: 2010 (88.416KB) | Rcvd: 10 (440B)
We have successfully scanned the IP through our chosen proxy and returned the results back to us. In this way, it appears that our proxy scanned the destination and not our original IP address.
Add More Proxies
First, let’s add some more proxies to our list. Open /etc/proxychains.conf and add more proxy IPs like I’ve done below.
Proxychaining :Dynamic Chain
Now that we have multiple IPs in our proxychain.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.
To do so, let’s first open the proxychains configuration file again.
With this file open, uncomment out the “dynamic_chains” line. This will enable dynamic chaining of our proxies allowing for greater anonymity.
Finally, we can also use “random chaining”. With this option, proxychains will randomly choose IP addresses 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.
To do so, open the /etc/proxychains.conf file and comment out “dynamic chains” and uncomment “random chain”. Since we can only use one of these options at a time, make certain that you comment out the other options in this section before using proxychains.
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.