Tutorial on how to config: YouTube Video
Rotate IP address and send each requests with a different IP address using Python3
sudo add-apt-repository ppa:micahflee/ppa
sudo apt install torbrowser-launcher
Now, you should have a torrc file in your /etc/tor/
directory.
open the torrc file $ sudo nano torrc
and uncomment the following lines (usually these are commented out):
ControlPort 9051
HashedControlPassword 16:2D99FRCE35858C6F608DB3122A6C8DA4C35BE5E105B9B54A7E438B122F
CookieAuthentication 1
tor --hash-password <password>
For example, tor --hash-password mypass
This will generate a new HashedControlPassword
, replace the torrc's HashedControlPassword
with your newly generated password.
and remember which password you passed with tor --hash-password <password>
command. You will use the <password>
in your python
code.
Now, replace welcome
with your <password>
in the following line of change_IP.py
in line 21:
controller.authenticate(password="welcome")
sudo service tor restart
pip install stem
pip install requests
python3 send_request.py
Program is tested on Ubuntu 20.04.3 LTS.