High Number of Process Terminations

This rule identifies a high number (10) of process terminations via pkill from the same host within a short time period.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/07/27"
  3integration = ["endpoint", "auditd_manager"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/02/21"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12This rule identifies a high number (10) of process terminations via pkill from the same host within a short time period.
 13"""
 14from = "now-9m"
 15index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
 16language = "kuery"
 17license = "Elastic License v2"
 18name = "High Number of Process Terminations"
 19note = """## Triage and analysis
 20
 21### Investigating High Number of Process Terminations
 22
 23Attackers can kill processes for a variety of purposes. For example, they can kill process associated with business applications and databases to release the lock on files used by these applications so they may be encrypted,or stop security and backup solutions, etc.
 24
 25This rule identifies a high number (10) of process terminations via pkill from the same host within a short time period.
 26
 27#### Possible investigation steps
 28
 29- Examine the entry point to the host and user in action via the Analyse View.
 30  - Identify the session entry leader and session user.
 31- Examine the contents of session leading to the process termination(s) via the Session View.
 32  - Examine the command execution pattern in the session, which may lead to suspricous activities.
 33- Examine the process killed during the malicious execution
 34  - Identify imment threat to the system from the process killed.
 35  - Take necessary incident response actions to respawn necessary process.
 36
 37### False positive analysis
 38
 39- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
 40
 41### Response and remediation
 42
 43- Initiate the incident response process based on the outcome of the triage.
 44- Isolate the involved host to prevent further destructive behavior, which is commonly associated with this activity.
 45- 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.
 46- Reimage the host operating system or restore it to the operational state.
 47- If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
 48- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 49- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 50- 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).
 51"""
 52risk_score = 47
 53rule_id = "67f8443a-4ff3-4a70-916d-3cfa3ae9f02b"
 54setup = """## Setup
 55
 56This rule requires data coming in from Elastic Defend.
 57
 58### Elastic Defend Integration Setup
 59Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 60
 61#### Prerequisite Requirements:
 62- Fleet is required for Elastic Defend.
 63- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 64
 65#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 66- Go to the Kibana home page and click "Add integrations".
 67- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 68- Click "Add Elastic Defend".
 69- Configure the integration name and optionally add a description.
 70- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 71- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 72- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 73- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 74For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 75- Click "Save and Continue".
 76- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 77For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 78"""
 79severity = "medium"
 80tags = [
 81        "Domain: Endpoint",
 82        "OS: Linux",
 83        "Use Case: Threat Detection",
 84        "Tactic: Impact",
 85        "Resources: Investigation Guide",
 86        "Data Source: Elastic Endgame",
 87        "Data Source: Elastic Defend",
 88        "Data Source: Auditd Manager"
 89        ]
 90type = "threshold"
 91timestamp_override = "event.ingested"
 92
 93query = '''
 94event.category:process and host.os.type:linux and event.type:start and process.name:"pkill" and process.args:"-f"
 95'''
 96
 97[[rule.threat]]
 98framework = "MITRE ATT&CK"
 99
100[[rule.threat.technique]]
101id = "T1489"
102name = "Service Stop"
103reference = "https://attack.mitre.org/techniques/T1489/"
104
105[rule.threat.tactic]
106id = "TA0040"
107name = "Impact"
108reference = "https://attack.mitre.org/tactics/TA0040/"
109
110[rule.threshold]
111field = ["host.id", "process.executable", "user.name"]
112value = 10

Triage and analysis

Investigating High Number of Process Terminations

Attackers can kill processes for a variety of purposes. For example, they can kill process associated with business applications and databases to release the lock on files used by these applications so they may be encrypted,or stop security and backup solutions, etc.

This rule identifies a high number (10) of process terminations via pkill from the same host within a short time period.

Possible investigation steps

  • Examine the entry point to the host and user in action via the Analyse View.
    • Identify the session entry leader and session user.
  • Examine the contents of session leading to the process termination(s) via the Session View.
    • Examine the command execution pattern in the session, which may lead to suspricous activities.
  • Examine the process killed during the malicious execution
    • Identify imment threat to the system from the process killed.
    • Take necessary incident response actions to respawn necessary process.

False positive analysis

  • This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further destructive behavior, which is commonly associated with this activity.
  • 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.
  • Reimage the host operating system or restore it to the operational state.
  • If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
  • 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).

Related rules

to-top