Suspicious JAVA Child Process

edit

Identifies suspicious child processes of the Java interpreter process. This may indicate an attempt to execute a malicious JAR file or an exploitation attempt via a JAVA specific vulnerability.

Rule type: new_terms

Rule indices:

  • auditbeat-*
  • logs-endpoint.events.*

Severity: medium

Risk score: 47

Runs every: 5m

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Domain: Endpoint
  • OS: Linux
  • OS: macOS
  • Use Case: Threat Detection
  • Tactic: Execution
  • Resources: Investigation Guide
  • Use Case: Vulnerability
  • Data Source: Elastic Defend

Version: 208

Rule authors:

  • Elastic

Rule license: Elastic License v2

Investigation guide

edit

Triage and analysis

Investigating Suspicious Java Child Process

This rule identifies a suspicious child process of the Java interpreter process. It may indicate an attempt to execute a malicious JAR file or an exploitation attempt via a Java specific vulnerability.

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
  • Investigate any abnormal behavior by the subject process such as network connections, file modifications, and any spawned child processes.
  • Examine the command line to determine if the command executed is potentially harmful or malicious.
  • Inspect the host for suspicious or abnormal behavior in the alert timeframe.

False positive analysis

  • If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of process and command line conditions.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Remove and block malicious artifacts identified during triage.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Setup

edit

Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested and default fallback for EQL rules was not added until version 8.2. Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate event.ingested to @timestamp. For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html

Rule query

edit
event.category:process and event.type:("start" or "process_started") and process.parent.name:"java" and process.name:(
  bash or dash or sh or tcsh or csh or zsh or ksh or fish or python* or php* or perl or ruby or lua* or openssl or
  nc or netcat or ncat or telnet or awk or socat or wget or curl
) and process.args :(
  whoami or id or uname or cat or hostname or ip or curl or wget or pwd or ls or cd or python* or php* or perl or
  ruby or lua* or openssl or nc or netcat or ncat or telnet or awk or socat
)

Framework: MITRE ATT&CKTM