Suspicious JAVA Child Process

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.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/01/19"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies suspicious child processes of the Java interpreter process. This may indicate an attempt to execute a
 11malicious JAR file or an exploitation attempt via a JAVA specific vulnerability.
 12"""
 13from = "now-9m"
 14index = ["auditbeat-*", "logs-endpoint.events.*"]
 15language = "kuery"
 16license = "Elastic License v2"
 17name = "Suspicious JAVA Child Process"
 18note = """## Triage and analysis
 19
 20### Investigating Suspicious Java Child Process
 21
 22This 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.
 23
 24#### Possible investigation steps
 25
 26- 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.
 27- Investigate other alerts associated with the user/host during the past 48 hours.
 28- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
 29- Investigate any abnormal behavior by the subject process such as network connections, file modifications, and any spawned child processes.
 30- Examine the command line to determine if the command executed is potentially harmful or malicious.
 31- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
 32
 33### False positive analysis
 34
 35- If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of process and command line conditions.
 36
 37### Response and remediation
 38
 39- Initiate the incident response process based on the outcome of the triage.
 40- Isolate the involved hosts to prevent further post-compromise behavior.
 41- Remove and block malicious artifacts identified during triage.
 42- 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.
 43- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 44- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 45- 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).
 46"""
 47references = [
 48    "https://www.lunasec.io/docs/blog/log4j-zero-day/",
 49    "https://github.com/christophetd/log4shell-vulnerable-app",
 50    "https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE.pdf",
 51    "https://www.elastic.co/security-labs/detecting-log4j2-with-elastic-security",
 52    "https://www.elastic.co/security-labs/analysis-of-log4shell-cve-2021-45046",
 53]
 54risk_score = 47
 55rule_id = "8acb7614-1d92-4359-bfcf-478b6d9de150"
 56setup = """## Setup
 57
 58If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 59events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 60Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 61`event.ingested` to @timestamp.
 62For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 63"""
 64severity = "medium"
 65tags = [
 66    "Domain: Endpoint",
 67    "OS: Linux",
 68    "OS: macOS",
 69    "Use Case: Threat Detection",
 70    "Tactic: Execution",
 71    "Resources: Investigation Guide",
 72    "Use Case: Vulnerability",
 73    "Data Source: Elastic Defend",
 74]
 75timestamp_override = "event.ingested"
 76type = "new_terms"
 77
 78query = '''
 79event.category:process and event.type:("start" or "process_started") and process.parent.name:"java" and process.name:(
 80  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
 81  nc or netcat or ncat or telnet or awk or socat or wget or curl
 82) and process.args :(
 83  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
 84  ruby or lua* or openssl or nc or netcat or ncat or telnet or awk or socat
 85)
 86'''
 87
 88
 89[[rule.threat]]
 90framework = "MITRE ATT&CK"
 91[[rule.threat.technique]]
 92id = "T1059"
 93name = "Command and Scripting Interpreter"
 94reference = "https://attack.mitre.org/techniques/T1059/"
 95[[rule.threat.technique.subtechnique]]
 96id = "T1059.007"
 97name = "JavaScript"
 98reference = "https://attack.mitre.org/techniques/T1059/007/"
 99
100
101
102[rule.threat.tactic]
103id = "TA0002"
104name = "Execution"
105reference = "https://attack.mitre.org/tactics/TA0002/"
106
107[rule.new_terms]
108field = "new_terms_fields"
109value = ["host.id", "process.command_line"]
110[[rule.new_terms.history_window_start]]
111field = "history_window_start"
112value = "now-14d"

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).

References

Related rules

to-top