← back to portfolio
Web Security

Apache Tomcat Serialized Payload RCE

Category
Web Security
Status
Complete
Host
TOM-UPLOAD01 (172.16.20.47)
Method
Web server & host process log correlation
MITRE ATT&CK
T1190 Exploit Public-Facing Application T1505.003 Web Shell T1059 Command & Scripting Interpreter T1033 System Owner/User Discovery T1087.001 Local Account Discovery T1057 Process Discovery
Executive Summary An alert for SOC334 – Apache Tomcat RCE Exploitation (CVE-2024-50379) flagged suspicious web activity on host TOM-UPLOAD01. Investigation confirmed a malicious JSP file was uploaded and used as a web shell, exploiting a TOCTOU race condition in Tomcat's JSP compilation on a case-insensitive file system. The attacker used the shell to run reconnaissance commands, but no evidence of persistence, privilege escalation, or destructive impact was found in the available logs.
Table of Contents
  1. Scenario
  2. Evidence Collected
  3. Timeline
  4. Key Findings
  5. Attack Chain
  6. Analyst Notes

Scenario

The alert was triggered by the SOC334 rule for Apache Tomcat RCE Exploitation Detected (CVE-2024-50379). A Time-of-check Time-of-use (TOCTOU) race condition vulnerability during JSP compilation in Apache Tomcat permits remote code execution on case-insensitive file systems when the default servlet is enabled for write access (non-default configuration). The alert identified a suspicious web attack against server TOM-UPLOAD01 (172.16.20.47).

Evidence Collected

ArtifactTypeWhy It Mattered
3.144.85.113IPv4 AddressExternal source IP responsible for uploading and interacting with the JSP web shell
FILE.jspJSP FileMalicious JSP uploaded to the server and used as a web shell
/xampp/tomcat/webapps/ROOT/uploads/file.jspFile PathConfirmed the location of the uploaded web shell
tasklist.exeProcess CreationConfirmed commands issued through the web shell executed on the host

Timeline

Time (UTC)Source IPEventSource
10 Jan 13:53–13:543.144.85.113Uploaded FILE.jsp via POST /upload.jspWeb Server Logs
10 Jan 13:53:493.144.85.113Executed whoami through the uploaded web shellWeb Server Logs
10 Jan 13:54:013.144.85.113Executed net user through the uploaded web shellWeb Server Logs
10 Jan 13:54:113.144.85.113Executed whoami /priv through the uploaded web shellWeb Server Logs
10 Jan 13:54:233.144.85.113Executed tasklist through the uploaded web shellWeb Server Logs

Key Findings

Attack Chain

Exploitation
Attacker sent a POST request to /upload.jsp to upload FILE.jsp.
Execution
cmd= parameters observed being passed to /uploads/file.jsp shortly after upload.
Discovery
Reconnaissance commands executed on the endpoint: whoami, net user, whoami /priv, tasklist.
Impact
No destructive or data-impacting activity was observed in the available evidence.

Analyst Notes

Began by validating the alert details and identifying the affected host and external source IP.
Reviewed web server logs to determine whether exploitation had occurred.
Identified an uploaded JSP file followed by repeated requests containing cmd= parameters, indicating possible web shell activity.
Correlated the observed HTTP requests with host process evidence to confirm OS command execution.
Observed reconnaissance commands but found no evidence of persistence or privilege escalation in the available logs.
A second external IP generated only HTTP 404 responses and could not be correlated with successful exploitation.