Skip to content

Instantly share code, notes, and snippets.


snj/tor exit

Created Jan 6, 2014
What would you like to do?
#!/usr/bin/env python2
import requests
from iso3166 import countries
cookies = dict(session='dcd83eacd7b3518b0d5064ce957d606218cc15616ec72c18cd866a9972aca6fb')
data= requests.get(url,cookies=cookies,verify=False).content
lines = data.split('\n')
flags = []
for i in lines:
if "inactive" in i:
flag = i[75:77]
print flags
for todo in flags:
print countries.get(todo)[0]
fd = open("torrc", "w")
fd.write("ExitNodes {" + "},{".join(flags) + "}")
#started via: while true; do ./; tor -f torrc & ; PID=${!}; sleep 1; torify curl ""; kill $PID; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment