Skip to content

Instantly share code, notes, and snippets.

@trietptm
Created October 24, 2013 10:13
Show Gist options
  • Save trietptm/7134588 to your computer and use it in GitHub Desktop.
Save trietptm/7134588 to your computer and use it in GitHub Desktop.
Hack.lu 2013 CTF https://ctf.fluxfingers.net/challenges/24 Geolocation Flag (Category: Misc) Author(s): javex This challenge is a special challenge. You can collect some minor extra points here by proving that you are a truly international player. Each time you visit your reference URL from a different country, that flag will be activated and yo…
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
@trietptm
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment