Login Register


Tutorial Mask your IP using Tor requests! filter_list
Author
Message
Mask your IP using Tor requests! #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.)

[+] 1 user Likes Oblivious's post
Reply

RE: Mask your IP using Tor requests! #2
Thank you for this, I'll be trying out if this works but the code seems fine at first sight.
~~ Might be back? ~~

[+] 1 user Likes Bish0pQ's post
Reply

RE: Mask your IP using Tor requests! #3
(10-26-2017, 07:54 AM)Bish0pQ Wrote: Thank you for this, I'll be trying out if this works but the code seems fine at first sight.

No problem! Let me know if you run into any problems I'll be willing to help

Reply

RE: Mask your IP using Tor requests! #4
Interesting! Is there a way to embed the tor browser / protocol completely within the python application?

Reply

RE: Mask your IP using Tor requests! #5
(10-29-2017, 10:45 AM)adnankatman Wrote: Interesting! Is there a way to embed the tor browser / protocol completely within the python application?

This could be possible but you would need to figure out how to run the tor node without launching tor browser itself.
I'll look more into this when I get a chance and update the code if I find anything new enjoy Smile!

Reply

RE: Mask your IP using Tor requests! #6
(11-01-2017, 01:41 AM)Oblivious Wrote:
(10-29-2017, 10:45 AM)adnankatman Wrote: Interesting! Is there a way to embed the tor browser / protocol completely within the python application?
This could be possible but you would need to figure out how to run the tor node without launching tor browser itself.
I'll look more into this when I get a chance and update the code if I find anything new enjoy Smile!
You could install privoxy and set that up with tor, then change the proxy settings inside the python script so it runs through privoxy. I've done this on my Linux box but not sure how it works on Windows.

Reply

RE: Mask your IP using Tor requests! #7
Clean Code, but I have a question. when authenticating the stem control via the tor variable; What are you exactly authenticating here using the password 'password'?

I've read that the object gives you an unauthenticated controller, but I still don't understand what does authentication here stand for? Is it an actual authentication just like a handshake with the TOR node or a validation for the Controller you are using?

Thanks Biggrin

Reply







Users browsing this thread: