Skip to content

Instantly share code, notes, and snippets.

@antitree
Last active August 29, 2015 14:23
Show Gist options
  • Save antitree/768e1beb1f2d7d9ee9eb to your computer and use it in GitHub Desktop.
Save antitree/768e1beb1f2d7d9ee9eb to your computer and use it in GitHub Desktop.
Simple example of a Tor script that leaks DNS
import requesocks
import BeautifulSoup as bs
base_url = 'http://treebind.antitree.com:8000'
test_url = base_url + '/test'
session = requesocks.session()
session.proxies = {'http': 'socks5://127.0.0.1:9050'}
print("Getting: %s" % test_url)
r = session.get(test_url)
s = bs.BeautifulSoup(r.text)
result=s.find("meta",attrs={"http-equiv":"refresh"})
wait,text = result["content"].split(';')
results_url = text[4:]
print("Getting: %s" % results_url)
r = session.get(results_url)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment