Detection rules › Splunk
Java Class File download by Java User Agent
The following analytic identifies a Java user agent performing a GET request for a .class file from a remote site. It leverages web or proxy logs within the Web Datamodel to detect this activity. This behavior is significant as it may indicate exploitation attempts, such as those related to CVE-2021-44228 (Log4Shell). If confirmed malicious, an attacker could exploit vulnerabilities in the Java application, potentially leading to remote code execution and further compromise of the affected system.
Known false positives
- Filtering may be required in some instances, filter as needed.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access |
Rule body
name: Java Class File download by Java User Agent
id: 8281ce42-5c50-11ec-82d2-acde48001122
version: 10
creation_date: '2021-12-13'
modification_date: '2026-05-13'
author: Michael Haag, Splunk
status: production
type: TTP
description: The following analytic identifies a Java user agent performing a GET request for a .class file from a remote site. It leverages web or proxy logs within the Web Datamodel to detect this activity. This behavior is significant as it may indicate exploitation attempts, such as those related to CVE-2021-44228 (Log4Shell). If confirmed malicious, an attacker could exploit vulnerabilities in the Java application, potentially leading to remote code execution and further compromise of the affected system.
data_source:
- Splunk Stream HTTP
search: |-
| tstats `security_content_summariesonly` count FROM datamodel=Web
WHERE Web.http_user_agent="*Java*" Web.http_method="GET" Web.url="*.class*"
BY Web.http_user_agent Web.http_method, Web.url,Web.url_length
Web.src, Web.dest
| `drop_dm_object_name("Web")`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `java_class_file_download_by_java_user_agent_filter`
how_to_implement: To successfully implement this search, you need to be ingesting web or proxy logs, or ensure it is being filled by a proxy like device, into the Web Datamodel. For additional filtering, allow list private IP space or restrict by known good.
known_false_positives: Filtering may be required in some instances, filter as needed.
references:
- https://arstechnica.com/information-technology/2021/12/as-log4shell-wreaks-havoc-payroll-service-reports-ransomware-attack/
finding:
title: A Java user agent $http_user_agent$ was performing a $http_method$ to retrieve a remote class file.
entity:
field: dest
type: system
score: 50
threat_objects:
- field: http_user_agent
type: http_user_agent
analytic_story:
- Log4Shell CVE-2021-44228
asset_type: Web Server
cve:
- CVE-2021-44228
mitre_attack_id:
- T1190
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: web
security_domain: network
Stages and Predicates
Stage 1: tstats
| tstats `security_content_summariesonly` count FROM datamodel=Web
WHERE Web.http_user_agent="*Java*" Web.http_method="GET" Web.url="*.class*"
BY Web.http_user_agent Web.http_method, Web.url,Web.url_length
Web.src, Web.dest
Stage 2: search
| `drop_dm_object_name("Web")`
Stage 3: search
| `security_content_ctime(firstTime)`
Stage 4: search
| `security_content_ctime(lastTime)`
Stage 5: search
| `java_class_file_download_by_java_user_agent_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Web.http_method | eq |
| field:"cs-method" kind:eq |
Web.http_user_agent | eq |
| field:"c-useragent" kind:eq |
Web.url | eq |
| field:"c-uri" kind:eq |