一、Web_Writeup

1、Web-IP绕过

打开实例,下载附件源码

代码审计

判断了HTTP_CLIENT_IP的传入是否是1.2.3.4

用户名为admin,密码为admin123

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

header('Content-Type: text/html; charset=utf-8');

$cip $_SERVER['HTTP_CLIENT_IP'];

if ($cip != "1.2.3.4") {

    echo "非法IP地址,只有1.2.3.4才能访问!";

    exit();

}

$username $_POST['username'];

$password $_POST['password'];


if ($username === "admin" && $password === "admin123") {

    echo "登录成功!<br>";

    $flag file_get_contents("../../../../flag.txt");

    echo $flag;

else {

    echo "用户名或密码错误!";

}
?> 

打开burp抓包 然后添加HTTP头Client-IP: 1.2.3.4

image-20250817213056596

得到flag

1
flag{HNCTF219832818s}

2、Web-命令执行

打开实例

发现需要进行代码审计

审计得出:

在进行操作时,可考虑使用 base64_encode 或 base64_decode,同时要额外留意服务器是否允许使用 file_get_contents。需满足以下条件:一是 GET 参数 cmd 中必须包含子串 “base”(不区分大小写),但禁止包含如 system、exec、flag、php、cat 等黑名单关键词;二是因为文件名 flag.php 包含禁止词 flag 和 php,所以要避免在 cmd 中直接出现这些词;三是可借助 Base64 编码 / 解码来绕过过滤。

Payload:

1
?cmd=$a=base64_decode(%27ZmxhZy5waHA=%27);echo%20base64_encode(file_get_contents($a));

image-20250817213150288

base64解码

image-20250817213200069

得到flag

1
flag{HNCTFPDSGYJSJNB666}

二、Misc-Writeup

1、文件隐写02

下载附件,解压得到一个jpg图片

拖入winhex

image-20250817213312680

1
666c61677b7761736a5f303130315f7a6968616f7d

得到一串字符然后进行16进制转文本

image-20250817213336759

得到flag

1
flag{wasj_0101_zihao}

2、次数还原

image-20250817213407559

分析每个字符频率的出现次数,进行排序后应该就是FLAG了

image-20250817213411959

然后进行反转

image-20250817213421808

得到flag

1
FLAG{B8o6han}

3、图片隐写02

下载附件

得到一半多的二维码

image-20250817213528368

底部被隐藏,那么大概率是宽高修改了。

image-20250817213536360

修改后 进行扫码

image-20250817213543851

得到一串base64编码

然后解码

image-20250817213555377

得到flag

1
Flag{nisp_tupian12131}

4、鼠标流量

下载附件得到一个流量分析文件

然后拖入工具

image-20250817213615442

得到flag

image-20250817213632743

1
flag{a3h58fw7ex}

三、Crypto_Writeup

1、Cyport_01

随波逐流直接得到flag

1
flag{829_ji87_88pk}

2、Cyport_02

丢入随波逐流发现是社会主义核心价值观解码

image-20250817213758209

继续解码得到flag

image-20250817213811924

3、Find_flag

下载附件解压到底一个html和js文件

打开js文件发现是混淆的MD5加密、特殊检查的js

image-20250817213900266

exp如下

1
2
3
4
5
6
7
8
9
a = [104, 104, 102, 120, 117, 108, 48, 75, 81, 70, 87, 73]

def build_string(index=0, current=""):
if index >= len(a):
return current
return build_string(index + 1, current + chr(a[index] - 3))

s = build_string()
print(s)

image-20250817213923982

得到flag

1
flag{eecuri-HNCTF}

4、ez_classical7

image-20250817213953195

先反转一下

image-20250817214000042

1
mtjn{PWJBOeEHLAcL67PWJ}

mtjn->flag

根据ascii码表

发现m->f 7 t->f 8 j->9 n->g 7

由此编写exp

得到flag

image-20250817214018885

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def decrypt(s):
decrypted = []
shifts = [7, 8, 9]
shift_index = 0

for char in s:
if char in "{}0123456789":
decrypted.append(char)
continue

shift_value = shifts[shift_index % len(shifts)]
base = ord('a') if char.islower() else ord('A') if char.isupper() else 0

if base:
shifted_code = (ord(char) - base - shift_value) % 26
decrypted.append(chr(shifted_code + base))
else:
decrypted.append(char)

shift_index += 1

return ''.join(decrypted)

cipher = "mtjn{PWJBOeEHLAcL67PWJ}"
plaintext = decrypt(cipher)
print("解密结果:", plaintext)
1
flag{HNCTFxWYEStE67HNC}