Detection rules › Splunk
Log4Shell JNDI Payload Injection Attempt
The following analytic identifies attempts to inject Log4Shell JNDI payloads via web calls. It leverages the Web datamodel and uses regex to detect patterns like ${jndi:ldap:// in raw web event data, including HTTP headers. This activity is significant because it targets vulnerabilities in Java web applications using Log4j, such as Apache Struts and Solr. If confirmed malicious, this could allow attackers to execute arbitrary code, potentially leading to full system compromise. Immediate investigation is required to determine if the attempt was successful and to mitigate any potential exploitation.
Known false positives
- If there is a vulnerablility scannner looking for log4shells this will trigger, otherwise likely to have low false positives.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence |
Rule body
name: Log4Shell JNDI Payload Injection Attempt
id: c184f12e-5c90-11ec-bf1f-497c9a704a72
version: 9
creation_date: '2021-12-13'
modification_date: '2026-05-13'
author: Jose Hernandez
status: production
type: Anomaly
description: The following analytic identifies attempts to inject Log4Shell JNDI payloads via web calls. It leverages the Web datamodel and uses regex to detect patterns like `${jndi:ldap://` in raw web event data, including HTTP headers. This activity is significant because it targets vulnerabilities in Java web applications using Log4j, such as Apache Struts and Solr. If confirmed malicious, this could allow attackers to execute arbitrary code, potentially leading to full system compromise. Immediate investigation is required to determine if the attempt was successful and to mitigate any potential exploitation.
data_source:
- Nginx Access
search: |-
| from datamodel Web.Web
| regex _raw="[jJnNdDiI]{4}(\:|\%3A|\/|\%2F)\w+(\:\/\/|\%3A\%2F\%2F)(\$\{.*?\}(\.)?)?"
| fillnull
| stats count by action, category, dest, dest_port, http_content_type, http_method, http_referrer, http_user_agent, site, src, url, url_domain, user
| `log4shell_jndi_payload_injection_attempt_filter`
how_to_implement: This detection requires the Web datamodel to be populated from a supported Technology Add-On like Splunk for Apache or Splunk for Nginx.
known_false_positives: If there is a vulnerablility scannner looking for log4shells this will trigger, otherwise likely to have low false positives.
references:
- https://www.lunasec.io/docs/blog/log4j-zero-day/
intermediate_findings:
entities:
- field: user
type: user
score: 20
message: CVE-2021-44228 Log4Shell triggered for host $dest$
- field: dest
type: system
score: 20
message: CVE-2021-44228 Log4Shell triggered for host $dest$
analytic_story:
- Log4Shell CVE-2021-44228
- CISA AA22-257A
- CISA AA22-320A
asset_type: Endpoint
cve:
- CVE-2021-44228
mitre_attack_id:
- T1190
- T1133
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: web
security_domain: threat
Stages and Predicates
Stage 1: search
| from datamodel Web.Web
Stage 2: regex
| regex _raw="[jJnNdDiI]{4}(\:|\%3A|\/|\%2F)\w+(\:\/\/|\%3A\%2F\%2F)(\$\{.*?\}(\.)?)?"
Stage 3: fillnull
| fillnull
Stage 4: stats
| stats count by action, category, dest, dest_port, http_content_type, http_method, http_referrer, http_user_agent, site, src, url, url_domain, user
Stage 5: search
| `log4shell_jndi_payload_injection_attempt_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
_raw | regex_match |
| field:"_raw" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | from |
| 1 | datamodel |
| 1 | Web.Web |