前言
这次陇剑杯题目的质量真的很高(或者说一如既往的高),实在是太卷了,行业、科研、公安的队伍都太强了,有趣的是最后数了数发现只算高校的话竟然是前50,但随后又 发现社会队伍和高校一块排名。所以就,明年再战!
一、 战队信息
战队名称:T1173034
战队排名:382
二、 解题情况

三、 解题过程
SS - sevrer save_1
(上接第二部,从第二步开始)
查看/helloworld项目的依赖

发现spring4shell,于是查找相关资料

发现了CVE-2010-1622和CVE-2022-22965,尝试了第一个不对,答案为CVE-2022-22965
SS - sevrer save_2
下载附件,解压后得到一个流量包和一个linux磁盘文件,在根目录的helloworld文件夹下找到bbbb.sh查看内容


可以看到这是一条反弹shell的命令,所以就得到这一题的答案 192.168.43.128:2333
SS - sevrer save_3
在guests目录下发现elf文件main

尝试提交,答案正确 main
SS - sevrer save_4
(上接第二问)
题目问到新建的用户,于是去查看/etc的shadow和passwd

在shadow中发现guests用户密码 guest:123456

SS - sevrer save_5
(上接第二问)

Guests用户主目录下有.log.txt,猜测为日志文件,查看文件内容

查看日志发现有服务器的外网IP,提交答案 172.105.202.239
SS - sevrer save_6
(上接第七部),已经找到了挖矿木马,那释放的文件就是elf和sh脚本
即lolMiner和mine_doge.sh

lolMiner, mine_doge.sh
SS - sevrer save_7
(步骤接第二问)
随后查看/home目录,发现异常用户guests

查看该用户主目录文件

查看.idea文件夹

发现sh文件和elf文件,查看sh文件内容

发现为挖矿木马配置文件,得到本题答案 doge.millpools.cc:5567
SS - sevrer save_8
(步骤接上一问)

该配置文件中的WALLET即为钱包地址
最早尝试的DOGE:DRXz1q6ys8Ao2KnPbtb7jQhPjDSqtwmNN9.lolMinerWorker
结果发现不对,于是去掉了后面的.lolMineWorker,答案正确 DOGE:DRXz1q6ys8Ao2KnPbtb7jQhPjDSqtwmNN9
WS - sevrer save_1
下载附件为流量包,使用wireshark打开,分析流量

此处发现telnet,所以可以推测被侵入主机的内网IP为192.168.246.28
WS - sevrer save_2
telnet流量中记录了输入的密码,最早以为是假的,尝试后发现答案正确

youcannevergetthis
WS - sevrer save_3
由于是telnet流量,发现执行了ls命令

可见第二个文件夹为Downloads
WS - sevrer save_4
解上一步,下面是passwd文件的内容

可见倒数第二个用户为mysql用户
IR - IncidentResponse_1
解压提前下载好的附件,得到ova虚拟机模板文件

导入vmware workstation虚拟机
使用题目中给的用户名密码登录

经过查找文件,最终发现在/etc目录下redis文件夹修改日期最新,查看redis文件夹

发现不是真的redis,异常文件,查看conf为挖矿木马配置文件,故redis-server这个elf就是题目中要的文件,lujing:/etc/redis/redis-server

MD5编码后得到答案 6f72038a870f05cbf923633066e48881
WS - sevrer save_2
上一步找到/etc/redis,查看redis.conf

得到钱包地址donat.ev2.xmrig.com:3333,编码后得到答案

28b637fff2474fb15b90c701067ce42b
WS - sevrer save_4
查看虚拟机的/var/log/nginx/access.log访问日志

发现攻击者IP 81.70.166.3

按照题目要求md5编码后得到答案 c76b4b1a5e8c9e7751af4684c6a8b2c9
EW - ez_web_1
下载下来为流量包,于是wireshark分析流量

在流量包的最后发现d00r.php木马通信流量,在这些流量最前发现了通过ViewMore.php文件执行php函数创建木马,故服务器中原有的后门文件为ViewMore.php

ViewMore.php
EW - ez_web_2
在d00r.php的通信流量中发现执行了ipconfig

尝试 192.168.162.0/24段的IP不对,则内网IP段为192.168.101.0/24段,内网IP为:192.168.101.132
EW - ez_web_3
还是在d00r.php的木马通信流量最哦胡发现了body为PK开头,为压缩包,所以提取出来


发现需要密码,于是继续分析流量,还是再d00r.php通信的一系列数据包中发现cat了根目录下的passwd,尝试后成功解压

解压后得到key

7d9ddff2-2d67-4eba-9e48-691 26042337
TP - tcpdump_1
这道题给的流量包,浏览了一下大概就是按照时间排序,先爆破密码,随后拿到权限,这里问爆破得到的密码,就http.response.code == 200按照时间排序查看
这里有个坑就是最后的并不是爆破成功的,爆破成功后进程还在继续,通过查看包的长度


这里得到用户名:TMjpxFGOwD 密码:123457 TMjpxFGOwD:123457
TP - tcpdump_2
这里和爆破的逻辑是一样的,分析流量包就可以看到前面几个包都是权限不足,后来突然换一个200,这里就可以得知是越权成功了


看了下就是把userid=2改成1实现了水平越权,于是按照题目要求对cookie进行MD5编码
accessToken=f412d3a8378d42439ee816b06ef3338c;zyplayertoken=f412d3a0378d42439ee016b06ef3330cQzw=; userid=1

383C74db4e32513daaa1ee61726d7255
TP - tcpdump_4
经过流量包分析可以得到最后上传的文件为xustom.dtd.xml,现在就差CVE编号


于是上网查找相关特征,最终发现jdbc反序列化的比较相似

于是尝试CVE-2023-31058,结果不对,继续查找

再次尝试CVE-2022-21724,答案正确

TP - tcpdump_5
这一问其实没有很大的把握

这里本来没有头绪,主要看到有扫描行为,一般内网横向都用fscan扫描,就猜测是fscan,答案正确
HD – hacked_1
这里wireshark分析流量包,我追溯的第一个包就是一个html,看到了用户名密码是aes加密后传输的

这里就尝试了好多个Login的包,包括有aaa aaa,还有admin,admin123都不对,我甚至都怀疑是不是admin打错了,后来发现admIn的登录包

经过aes解密得到flag(这个是真-flag)

flag{WelC0m5_T0_H3re}
HD – hacked_2
我概述一下这里的逻辑,这个系统有ssti,注册用户登陆后,再username这个地方注入,这里查找流量包后有{{7*7}},最后找到读取配置文件的流量

使用了url实体编码

解码后得到SECRET_KEY:ssti_flask_hsfvaldb
HD – hacked_3
这里采用的是session注入,session的密钥上一步已经拿到了,于是就找流量使用flask_session_manager这个项目去解密,这里是通过sessionssti,重新set cookie,这里可以看到whoami执行的结果为red,所以flask就是red用户运行的


用户:red
HD – hacked_4

这一步其实都能猜到,这个题的逻辑基本路由就login、logout、register,就这一个Index,虽然后面看了流量,但可以猜出来就是
Index