I am working on some kind of Exitnode Scanner (Like SoaT from Mike Perry). I have downloaded the list of all running Exitnode-IPs and I want to use each IP to build a 3-hop-circuit (or connect directly to it, using 1-hop) with this specific IP. Fetch some data from a website and use the next IP in the list to do the same.
I am mostly using Python for this. I use the stem module to get a new identity:
def newc(): with Controller.from_port(port = 9051) as controller: controller.authenticate(PASSWORD) controller.signal(Signal.NEWNYM)
Is there a way to make sure it connects through all exits (no duplicate) using stem? Adding all IPs to the torrc does not relay solve the problem, I guess.
Or (maybe easier) can I use e.g. proxychains to connect to this one node (IP) and fetch a webpage using bash? My start looks like this:
proxychains wget ARGS -O PATH URL
Thank you very much and have a nice day =)
Edit: So I found 2 possible ways, both not working at the moment. One is using the "ExcludeExitNode" option in the torrc. I tried starting tor with "launch_tor_with_config" but I will get an error stating that Tor is already running. If I kill Tor, I get no such response anymore. To workaround this problem, I edit the torrc file and add one line (adding one IP at the end for every iteration). Sending the HUP signal (to make tor reload its config) results in 'received empty socks content'. Any ideas to resolve this?
The 2nd option was going with the .exit (dotexit) address. It tells Tor to use this specific exit node for a chain. Problem here is that Tor needs to resolve it with its own DNS-Server (not the one that my system uses), which I couldn't configure. So I stepped away from this idea as well.