Skip to content

Instantly share code, notes, and snippets.

@antitree
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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"})
results_url = (s('p')[1].a.get('href'))
print("Getting: %s" % results_url)
r = session.get(results_url)
s = bs.BeautifulSoup(r.text)
print("#" * 30)
print("Results:")
print("#" * 30)
for p in (s('p')):
print(p.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment