![]() |
|
Easy tor proxy switcher - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: Easy tor proxy switcher (/Thread-Easy-tor-proxy-switcher) |
Easy tor proxy switcher - silur - 02-06-2017 I encountered like.... gogolplex trillion billion bruteforcer and voter scripts that were nice..... but useless because of the utilization of a proxy switcher. Even the shittyest grade backend is equipped with an IP/Agent load-balancer so nowadays you have NO OPTION but to avoid that. From the official Tor repository (https://gitweb.torproject.org/torspec.git/plain/control-spec.txt), you can see that it's indeed really simple to switch to a new Tor node from the control port: Code: SIGNAL NEWNYMSo from python perspective a switcher function would look like this: Code: import socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
control_conn = socket.socket(socket.AF_INET, socket.SOCK_SREAM)
conn.connect(('127.0.0.1', 9050))
control_conn.connect(('127.0.0.1', 9051)) # the tor control port, handle auth if needed
control_conn.sendall(b'AUTHORIZE ""') # dont forget to add password
while True:
#do your bruteforce shit here.....
conn.sendall('CONNECT %s:%d HTTP/1.1 \r\n\r\n')
# other shit
control_conn.sendall(b'SIGNAL NEWNYM') # switch proxy with 1 commandThings to consider: Tor exit nodes are public, and many hosting services put them on blacklists. The tor network is relatively small, it is much smaller than it could (and should) be, especially after lucky green left the tor project and shut down majority of the nodes. The current network has ~7000 nodes and (unlike what the rumors say) there are only ~900 exit nodes (I highlighted this from a talk of the official developers), and usually I can only utilize ~250-270 IPs before encountering duplicates. However if your target uses a time-based IP ban, it is unlikely to get a duplicate within the ban interval. Captcha bypasser coming soon.... RE: Easy tor proxy switcher - Pikami - 02-06-2017 Ow shit! Thank you very much! I used to "sudo service tor restart" but those days are over! RE: Easy tor proxy switcher - sleaze - 02-06-2017 neat script, might put that to use and automate it RE: Easy tor proxy switcher - lsp - 02-17-2017 Everyone who's code needs to switch proxy should know about this. It's usually a lot more reliable than randomly picked public proxys. Size of the pool can be an issue but for small scale stuff, tor through the socks port is the simplest way to go. |