Skip to content

Instantly share code, notes, and snippets.

@spnow
Forked from trietptm/proxy_test.py
Created October 28, 2013 12:50
Show Gist options
  • Save spnow/7196290 to your computer and use it in GitHub Desktop.
Save spnow/7196290 to your computer and use it in GitHub Desktop.
import urllib2
for line in open('proxy.txt','r').readlines():
proxy = urllib2.ProxyHandler({'https': line})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
try:
response = urllib2.urlopen('https://ctf.fluxfingers.net/ref/7xYpAcceEDfEEuk')
datum = response.read().decode("UTF-8")
response.close()
print datum
if 'Location' in datum:
break
except urllib2.URLError, e:
print(str(e) + '\n')
continue
except Exception, e:
print(str(e) + '\n')
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment