Linux : How To Setup Proxychains in Kali Linux by Terminal

Proxychains is open-source software for Linux systems and comes preinstalled with Kali Linux, the tool redirects TCP connections through proxies like TOR, SOCKS4, SOCKS5, and HTTP (S), and it allows us to chain proxy servers. With Proxy chains, we can hide the IP address of the source traffic and evade IDS and firewalls.

To set up Proxychains, you will first need the tor service; most of the time, the service is preinstalled. Then, check if there is a tor service available. Just use this command.

Setup Proxychains On Kali Linux

First shift to ROOT user

sudo -i

Then type your password and enter. Now you’re in Root user.
Now check for Tor status by giving below command

root@kali:~# service tor status.

If you get this output that means TOR is not installed in your system and not running.

Tor Error Status

Tor Installation

TOR status inactive then Install TOR by below commands.

root@kali:~# apt-get install tor

Tor Install

We had already installed the tor service before so there will be a difference in execution. If you get any error while doing this, update & upgrade, reboot, and do it again.

Click here to learn how To Fix Nat Network Issue In VM VirtualBox

If TOR Successfully installs then, Start the TOR service.

root@kali:~# service tor start

Now to check the TOR service status.

root@kali:~# service tor status

Press ctrl +c for cancel.

Tor Install Success

Note: If you want to stop the TOR service, type the below command.

root@kali:~# service tor stop.

Configure proxy chains

After installing the tor service we now need to configure Proxychains. To do so use the following command.

Note: you must in ROOT user. if you do not then shift to Root.

root@kali:~# nano /etc/proxychains.conf

You see this type of file in the terminal. Will spot “#” which means bash language comments. if no “#” hash means it defaults to running or if we remove the “#” hash that means we want to run this.

You can practice arrow keys to scroll down & up and read file content and do the following adjustments as you need.

Proxychain Config

As you see in this there are 3 types of proxy chains: dynamic, strict, and random.

we’re going to use a dynamic chain, so:

  1. Uncomment Dynamic chain.
  2. Comment Strict chain and Random chain.
Proxy Leak

1. Remove proxy DNS from comment.

2. Also, Remove Proxy DNS requests — no leak for DNS data from comment.

Tips: here removing proxy DNS and no leak for DNS data, helps you to be fully anonymous.

3. Now, record socks5 127.0.0.1 9050 in the last line of the proxy list.

Proxychain Sock5

Then just write save by ctrl+o and press enter and to exit the file ctrl+X, now exit the terminal. The proxy chain setup is completed.

Tips: above, SOCKS is an internet protocol that routes packets between a client and a server using a proxy server. socks4 and socks5 are the type of socks.

127.00.1 address is the loopback Internet protocol (IPaddress also specified as the localhost.

The number 9050 is the port number and By default, Tor listens on this port for socks proxy.

Now Restart your PC.

To outset proxy chains first restart the tor service and then sling proxy chains in Firefox with a link for a particular search engine like Bing, etc. Use the following commands:

root@kali:~# service tor restart

Now type the below commands:

root@kali:~# proxychains firefox www.bing.com

or

root@kali:~# proxychains firefox www.duckduckgo.com

After running the following commands firefox will launch and www.bing.com or duckduckgo will load. When you execute the above command you must not get any error and Bing should get loaded. Also please close all Firefox tabs before executing the commands.

Bing

You can see that after executing the proxy chains bing loaded with some other language. Now let’s do a DNS leak test by searching DNS leak test and open any website providing the same.

DNS Leak Test

Then you can see that my location is now changed from INDIA to GERMANY and the good thing is that proxy chains keep on dynamically changing my IP address without leaking my DNS. So that it provides good anonymity.

If you wish you see a different result then you can just close the browser and clear the terminal, restart tor service and again launch proxy chains you will see some different results in the DNS leak test as shown below:

After DNS Leak Test
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x