Detection rules › Splunk

Java Class File download by Java User Agent

Status
production
Severity
medium
Group by
Web.src, Web.url_length, c-uri, c-useragent, cs-host, cs-method
Author
Michael Haag, Splunk
Source
github.com/splunk/security_content

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.

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1190 Exploit Public-Facing Application

Rule body splunk

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

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

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Web.http_methodeq
  • "GET"
Web.http_user_agenteq
  • "*Java*"
Web.urleq
  • "*.class*"