第九届御网杯网络安全大赛线下半决赛Writeup

admin 2026-06-30 07:04:56 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 本文详细解析第九届御网杯网络安全大赛线下半决赛解题过程,涵盖Web、Misc、Crypto三大方向。Web部分展示IP绕过与命令执行漏洞利用技巧;Misc涉及文件隐写、频率分析、二维码修复及流量分析;Crypto包含编码识别与自定义算法逆向。文档提供完整payload和工具操作指引,具有较高实战参考价值。 综合评分: 85 文章分类: CTF,WEB安全,渗透测试,代码审计,漏洞分析


cover_image

第九届御网杯网络安全大赛线下半决赛Writeup

赛查查

2025年8月27日 18:35 福建

在小说阅读器读本章

去阅读

以下文章来源于XiaoJsec ,作者XiaoJsec

XiaoJsec .

「XiaoJsec的安全小屋」是专注于网络安全攻防实战的笔记库,分享CTF赛题精讲、SRC漏洞挖掘、工具开发教程与最新漏洞复现,旨在解析攻防思维、拆解实战路径,助你构建扎实的安全工程能力。

一、Web_Writeup

1、Web-IP绕过

打开实例,下载附件源码

代码审计

判断了HTTP_CLIENT_IP的传入是否是1.2.3.4

用户名为admin,密码为admin123

<?php

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

$cip&nbsp;=&nbsp;$_SERVER['HTTP_CLIENT_IP'];

if($cip&nbsp;!=&nbsp;"1.2.3.4") {

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

&nbsp; &nbsp;&nbsp;exit();

}

$username&nbsp;=&nbsp;$_POST['username'];

$password&nbsp;=&nbsp;$_POST['password'];

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

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

&nbsp; &nbsp;&nbsp;$flag&nbsp;=&nbsp;file_get_contents("../../../../flag.txt");

&nbsp; &nbsp;&nbsp;echo$flag;

}&nbsp;else&nbsp;{

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

}
?>

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

image-20250817213056596

得到flag

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:

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

image-20250817213150288

base64解码

image-20250817213200069

得到flag

flag{HNCTFPDSGYJSJNB666}

二、Misc-Writeup

1、文件隐写02

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

拖入winhex

image-20250817213312680

666c61677b7761736a5f303130315f7a6968616f7d

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

image-20250817213336759

得到flag

flag{wasj_0101_zihao}

2、次数还原

image-20250817213407559

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

image-20250817213411959

然后进行反转

image-20250817213421808

得到flag

FLAG{B8o6han}

3、图片隐写02

下载附件

得到一半多的二维码

image-20250817213528368

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

image-20250817213536360

修改后 进行扫码

image-20250817213543851

得到一串base64编码

然后解码

image-20250817213555377

得到flag

Flag{nisp_tupian12131}

4、鼠标流量

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

然后拖入工具

image-20250817213615442

得到flag

image-20250817213632743

flag{a3h58fw7ex}

三、Crypto_Writeup

1、Cyport_01

随波逐流直接得到flag

flag{829_ji87_88pk}

2、Cyport_02

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

image-20250817213758209

继续解码得到flag

image-20250817213811924

3、Find_flag

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

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

image-20250817213900266

exp如下

a = [104,&nbsp;104,&nbsp;102,&nbsp;120,&nbsp;117,&nbsp;108,&nbsp;48,&nbsp;75,&nbsp;81,&nbsp;70,&nbsp;87,&nbsp;73]

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

s = build_string()
print(s)

image-20250817213923982

得到flag

flag{eecuri-HNCTF}

4、ez_classical7

image-20250817213953195

先反转一下

image-20250817214000042

mtjn{PWJBOeEHLAcL67PWJ}

mtjn->flag

根据ascii码表

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

由此编写exp

得到flag

image-20250817214018885

def&nbsp;decrypt(s):
&nbsp; &nbsp; decrypted = []
&nbsp; &nbsp; shifts = [7,&nbsp;8,&nbsp;9]
&nbsp; &nbsp; shift_index =&nbsp;0

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

&nbsp; &nbsp; &nbsp; &nbsp; shift_value = shifts[shift_index %&nbsp;len(shifts)]
&nbsp; &nbsp; &nbsp; &nbsp; base =&nbsp;ord('a')&nbsp;if&nbsp;char.islower()&nbsp;elseord('A')&nbsp;if&nbsp;char.isupper()&nbsp;else0

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

&nbsp; &nbsp; &nbsp; &nbsp; shift_index +=&nbsp;1

&nbsp; &nbsp;&nbsp;return''.join(decrypted)

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

免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:赛查查 《第九届御网杯网络安全大赛线下半决赛Writeup》

评论:0   参与:  0