Java Class File download by Java User Agent


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.

Query · spl

| 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`

Implementation guide

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.

Analyst notes

Known false positives: Filtering may be required in some instances, filter as needed.

Raw source Java Class File download by Java User Agent · SPL
Esc
Published by splunk/security_content ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
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/
drilldown_searches:
    - name: View the detection results for - "$dest$"
      search: '%original_detection_search% | search  dest = "$dest$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$dest$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
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
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1190/java/java.log
          source: stream:http
          sourcetype: stream:http
      test_type: unit

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.