Top Scroll

How to concatenate multiple proxies with proxychains

proxies world map

The privacy and security of our connections is a subject that is increasingly taken into consideration today and one of the most attractive aspects is the concealment of our real public IP address. Many times we will want that when connecting to a site when it reviews its logs, see an IP address that is not ours, for which today generally use two methods: One is the famous and controversial TOR, and another would be to use one or more proxies.

It may look the same to us because the ultimate goal is to hide our IP, but while TOR uses “onion routing” on its connections, and uses the point-to-point topology, we use a peer-to-peer network here (An equipment to masquerade our public IP address).

To better understand this concept we can translate it with a couple of images that can be very enlightening. Briefly, we could say that when we connect to a server, what we do is connect from a public IP (which would be our router) to another IP that would belong to the destination server. In other words, we would do something like this:

I repeat that this is very simplified and there are many more elements by – Routers, ISPs, DNS lookup. But at the theoretical level, this scheme gives us enough time to understand the concept. The issue is that when connecting to the server directly, the server logs will show that the connection has been made from our public IP, which depends on what test or action, we do not care that it is so, more so when our IP shows information as valuable as the geolocation or even the browser used.

To avoid providing this information we will use several proxies to perform several IP masquerades, which would be translated in the following scheme:

This scheme would mean the following (The IPs listed in this post are for example):

  1. Since the IP is, we headed to the proxy with IP
  2. From the proxy IP, we connect to the proxy with IP This new proxy will see that the source IP connection is
  3. Again from the proxy IP we connect to the proxy with IP; here you will see the proxy IP will be
  4. Finally, we connect to the IP, only that it will have been connected from the IP

With this, we will have several “layers” of protection that will make it difficult for them to know the real IP of origin, which means that the final server does not have our real information and avoiding that it can “play” with our IP for any “experiment“.

Knowing the advantages offered by the use of several proxies, we will use a tool that will facilitate the concatenated use of these. This tool is called proxychains and while it is not installed by default on any computer, installing it is as simple as typing in the console:

apt-get install  proxychains

With this, we will install the package in question, although obviously not have any settings. This configuration would be done within the file/etc/proxychains.conf. This file has two very important concepts: How to deal with the list of proxies, and the list of proxies. When referring to the treatment of the list we would be talking about how to make the connection through the list of proxies. There are three types of treatment, and there must always be only one of them active:

  • dynamic_chain: Connects to the list of proxies in order, but if one of them were offline would happen next. By default this option is commented; i.e., it starting with the character #.
  • strict_chain: Functions like dynamic_chain, with the difference that here it is necessary that all proxies are online for the connection to work. It is the option enabled by default although it is usually recommended to use dynamic_chain.
  • random_chain: In this case, the connection order does not matter as randomly selects the order of connection.

Wanting us to have the dynamic_chain option enabled and disabled strict_chain, we would have to remove the character # of dynamic_chain line and add this character at the beginning of the strict_chain line, as shown in the capture below:

Obviously, it would lack the most important part, which would be the list of proxies; a section that begins with the nomenclature: [ProxyList]. Each line of the list would have this structure:

Type IP port [password]

The reason why the last two fields are placed between [] is because they are optional. Some proxies require a password, but normal is not. That is why these two fields are not mandatory. To know all these data we can consult the Internet proxies available today. Obviously, there are many websites available online from where you can get the lists of proxies.

Here we will simply have to select the proxies we want to add and put them into our ProxyList section. For example, we will add 2:

[ ProxyList ]
http    3124
http 882.082.381.10   3128

Now we would only have to run the command we want to be preceded by the command proxychains. With this, we would make the network interaction performed by said command that is done by the proxies placed on the list. Several of these commands can follow the proxychains command that would be: firefox, curl or wget.

In the case of having problems with the proxies we have added, we would simply have to look for others to find the ones that best suit our circumstances and/or geolocation.

With this, we would have a much more secure connection that would hide our home address from the end user. Keep in mind that this technique is designed for benign purposes and that most proxies collect and analyze the connections, so think of this as a protection technique and nothing else.

Finally, simply recommend that you choose the proxies you want to use wisely and try to look for them on trusted sites, otherwise who knows who you could be giving the information of your connections.

I hope you have found it useful.

The Author

A Journalist Specializing in Blogging, Social Networking and Community Management. As a constant learner, Pravin is always aiming towards new ideas and greater knowledge. When he is not doing research, reading, or writing for blogs, you can find him hanging around social media sites.

For our blog visitors only
Get 10% OFF on Hosting
Special Offer!
Claim the discount before it’s too late. Use the coupon code:
Note: Copy the coupon code and apply it on checkout.