第四届浙江省网络安全技能竞赛决赛部分WP
emmmmm,暴打出题人,预赛和决赛就只会签到QAQ!!!
Web
远古特性
<?php
// Present from glzjin :)
highlight_file(__FILE__);
$file = $_GET['file'];
if(preg_match('/^hint\/hint.txt$/m', $file)) {
echo file_get_contents($file);
} else {
echo "Try again!";
} Try again!
php代码审计,正则表达式提示输入的参数得有hint/hint.txt才能成功。
因为正则表达式/m要换多行匹配,所以需要换行符;第一行通过第二行执行正则指令,换行符为%0A。
所以输入?file=hint/hint.txt%0A../../../../../flag得到提示:
Warning: file_get_contents(hint/hint.txt ../../../../../flag): failed to open stream: No such file or directory in /var/www/html/index.php on line 10
表示文件未找到,继续加../,得到flag:

RE
最简单的逆向
附件ida打开,f5

找到for循环后双击enc得到

将enc进行对比:
flag = ''
enc = [0x76, 0x73, 0x85, 0x75, 0x86, 0x78, 0xAD, 0x6B, 0x97, 0x68, 0x98,0x67, 0x64, 0x64,0x62, 0x97, 0x68, 0x98, 0x6B,0x6B, 0x96,0x67, 0x62, 0x69, 0x95, 0x96, 0x65, 0x96, 0x6A, 0x69,0x69,0x65, 0x66, 0x97, 0x68, 0x98, 0x6A, 0x95, 0x68, 0xAF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
for i in enc:
print(chr(int(i)-50),end='')
得到flag:

Crypto
decode_and_decode
附件下载

得到一堆base密文,根据题目提示一直解码试试,开始一直用工具在解密发现是base循环加密,脚本贴上
import base64
with open(r'decode_and_decode的附件22.txt', 'r', encoding='utf-8') as f:
for a in f:
while 1:
try:
a = base64.b64decode(a).decode("utf-8")
except:
pass
try:
a = base64.b32decode(a).decode("utf-8")
except:
pass
try:
a = base64.b16decode(a).decode('utf-8')
except:
pass
if "{" in a:
print(a)
break
得到flag:

MISC
site_log
附件下载得到:

打开日志文件可以发现attack字样后有chr字符读取字样,将所有chr读取字符转换得到

一连串命令行,不难发现解压密码为
hehehe233_Igotroot!
用WinRAR解压得到flag:

asoul_lover
最近我旁边的灏妹天天上班第一句就是“Avaava”,还说要当安恒第一顶碗人。在他桌面上似乎发现了一个好康的压缩文件,想想他之前用过自己的名字+生日来做压缩密码,这把应该也能破解出来咯?对咯,他的压缩软件支持中文密码。flag的格式为 DASCTF{xxxxxx},提交时只需要提交括号内的字符串。
文件信息结合附件可以找到压缩包密码为:

向晚0612
得到flag:


浙公网安备 33010602011771号