Created
October 24, 2013 10:13
-
-
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…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://gist.github.com/trietptm/7134569
https://gist.github.com/trietptm/7134604