Mask your IP using Tor requests! 10-25-2017, 08:44 PM
#1
Code:
import requests, stem, stem.control, time
'''
You need Tor open for this to work
Once you've downloaded tor head over to torrc and open it with your favorite text editor
Enter this: ControlPort 9051
'''
IPAddress = ""
def GetIP():
global IPAddress
# Changes IP
tor = stem.control.Controller.from_port(port = 9051)
tor.authenticate(password="password"); tor.signal(stem.Signal.NEWNYM)
# Checks IP
response = requests.get('http://httpbin.org/ip',
proxies= {'http': 'socks5://127.0.0.1:9150', 'https': 'socks5://127.0.0.1:9150'})
CurrentIP = response.json()["origin"]
if IPAddress != CurrentIP:
IPAddress = CurrentIP
print IPAddress
else:
time.sleep(5)
while True:
GetIP()
(This post was last modified: 10-25-2017, 09:32 PM by Oblivious.)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)












!