Proxy Daisy Chain

If you value anonymity and privacy then you likely are familiar with proxies and VPN.

Kali Linux has an amazing feature built into it that makes using proxychains so much easier.  There are loads of great resources out there to teach you how to set up and use proxychains on your system.  For some great tutorials check out the references at the bottom [1][2][3]. (These are great tutorials!)

For myself I want to focus on a companion script I wrote to automate parts of the proxychains process.

 In order for the script to work you need to also use my script "proxy_list.py" you can find it under projects in this blog called "Proxy Import Script."  Very quickly, the import script retrieves a list of free proxies and creates a list, which then makes this list available where ever you need it.

Proxychaining is incredibly easy.  The method that my script is working with needs to have a set list of proxy addresses.  I only have access to free proxies online.  I don't want to go to the site and copy and paste it into the configuration file.  The below script will automate this for us.  

In previous blogs I have gone through the code line by line, I am not going to do that for this one.  Essentially this is what is happening:

- list of proxies imported

-open conf file

-search for particular lines matching pattern and update local list

-check to see if the script has been run before by removing old proxies

-add new proxies based on number selected by user

-clear the file

-print local list back into conf file

-boom we have an updated /etc/proxychains.conf file

 


This method does work, however you are at the mercy of the location where the free proxies were scraped from.  Also who knows who owns these free proxies, you take the risk on when you use them.

This script was fun! Honestly the better method would be to:

1. uncomment "socks4         127.0.0.1 9050"

2.install tor service

3.run tor service

This works so much faster.  My scrape proxychain scripts work, but if you are looking for a proxy-chain that will work every time, go with tor.

*take a look below for some setup things you should consider if you want to get my script working on your system.

Preset up of proxychains.conf

1. make a back up "cp /etc/proxychains.conf /etc/proxychains.conf.bak 

Modifying /etc/proxychains.conf

1.comment out "strict_chain"

2.comment out "random_chain"

3.uncomment "dynamic"

3.make sure that "proxy_dns" is uncommented

5. comment out "socks4 127.0.0.1 9050" we are not setting up our system for Tor


Reference:

 [1] https://www.youtube.com/watch?v=qsA8zREbt6g&t=557s

[2] https://www.geeksforgeeks.org/how-to-setup-proxychains-in-linux-without-any-errors/

[3] https://thecybersecurityman.com/2018/08/08/pentest-edition-evade-detection-using-tor-and-proxy-chains/

installing proxychains to debian system:

https://zoomadmin.com/HowToInstall/UbuntuPackage/proxychains

Comments

Popular Posts