Detection rules › Elastic

Elastic rules: 0g

Attempt to Clear Logs via Journalctl

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule monitors for attempts to clear logs using the "journalctl" command on Linux systems. Adversaries may use this technique to cover their tracks by deleting or truncating log files, making it harder for defenders to investigate their activities. The rule looks for the execution of "journalctl" with arguments that indicate log clearing actions, such as "--vacuum-time", "--vacuum-size", or "--vacuum-files".

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/10/01"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/12/18"

[rule]
author = ["Elastic"]
description = """
This rule monitors for attempts to clear logs using the "journalctl" command on Linux systems. Adversaries may use this
technique to cover their tracks by deleting or truncating log files, making it harder for defenders to investigate their
activities. The rule looks for the execution of "journalctl" with arguments that indicate log clearing actions, such as
"--vacuum-time", "--vacuum-size", or "--vacuum-files".
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Attempt to Clear Logs via Journalctl"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Attempt to Clear Logs via Journalctl

This detection flags attempts to purge systemd journal logs by invoking journalctl with vacuum options, which attackers use to erase evidence and impede investigations. A common pattern is a compromised user escalating to root and immediately running sudo journalctl --vacuum-time=1s or --vacuum-size=1M, sometimes via a script or cron job, to rapidly truncate the journal across all boots and hide prior execution traces.

### Possible investigation steps

- Enrich with user/UID, effective privileges, parent and command-line, session/TTY, and origin (SSH IP or local), and determine if execution came from a scheduled job (cron/systemd timer) or a script.
- Quantify destructiveness by extracting the exact vacuum parameter value(s) and immediately checking journal state (journalctl --disk-usage and --list-boots) and /var/log/journal size/mtime to see how much history was removed.
- Inspect configuration and persistence paths for intentional log suppression, including recent changes in /etc/systemd/journald.conf (Storage=volatile, SystemMaxUse, SystemMaxFileSize, MaxRetentionSec) and any new systemd units or scripts invoking journalctl vacuum.
- Correlate the vacuum timestamp with preceding activity to identify what might be concealed (privilege escalation, new accounts, sudoers edits, suspicious binaries), using auditd/EDR telemetry and shell history to rebuild the timeline.
- Verify remote log forwarding and SIEM ingestion for this host, compare gaps around the vacuum time, and recover pre-vacuum events from central storage to assess impact and intent.

### False positive analysis

- A sysadmin or maintenance script ran journalctl --vacuum-time or --vacuum-size to reclaim space on a host under log disk pressure, which should correlate with low-free-space alerts, approved retention policy, and a scheduled systemd timer or cron job.
- OS provisioning or image-preparation steps vacuumed the journal with journalctl --vacuum-files to sanitize logs before snapshotting, typically a one-time root action occurring near installation and matching documented build procedures.

### Response and remediation

- Immediately kill any active journalctl vacuum invocation (e.g., pkill -x journalctl), lock or remove sudo for the initiating user, and network-quarantine the host to prevent further tampering.
- Remove persistence by disabling systemd units/timers and cron jobs that call "journalctl --vacuum-*", inspecting /etc/systemd/system/* for ExecStart=journalctl vacuum and /etc/crontab, /etc/cron.*, and user crontabs, then deleting the offending scripts.
- Recover logging by setting Storage=persistent and policy-compliant SystemMaxUse/SystemMaxFileSize/MaxRetentionSec in /etc/systemd/journald.conf, restarting systemd-journald, and backfilling missing events from central log archives.
- Harden by enabling remote forwarding (ForwardToSyslog=yes and rsyslog/syslog-ng to SIEM), adding auditd rules to alert on "journalctl --vacuum-*", and tightening sudoers to require MFA and record command I/O for journalctl on critical hosts.
- Preserve evidence by archiving remaining /var/log/journal entries, journald.conf and its mtime, modified unit files under /etc/systemd/system, and shell/auth logs, and capture a disk snapshot before making further changes.
- Escalate to incident response if root executed "journalctl --vacuum-time/size/files" outside a documented maintenance window, if Storage=volatile was set or retention reduced below policy, or if the same actor performed vacuums on multiple hosts within 24 hours.
"""
risk_score = 47
rule_id = "09073bf4-a8ea-4bce-9fd5-2bb56b4d31f4"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic 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.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- 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).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- 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.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: Auditd Manager",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name == "journalctl" and process.args like ("--vacuum-time=*", "--vacuum-size=*", "--vacuum-files=*") and
not process.parent.args == "/etc/cron.daily/clean-journal-logs"
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"

[[rule.threat.technique.subtechnique]]
id = "T1070.002"
name = "Clear Linux or Mac System Logs"
reference = "https://attack.mitre.org/techniques/T1070/002/"

[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"

[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name == "journalctl" and process.args like ("--vacuum-time=*", "--vacuum-size=*", "--vacuum-files=*") and
not process.parent.args == "/etc/cron.daily/clean-journal-logs"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • executed
  • process_started
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • --vacuum-files=*
  • --vacuum-size=*
  • --vacuum-time=*
field:"process.args" kind:wildcard
process.nameeq
  • journalctl
field:"process_basename" kind:eq value:"journalctl"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.argseq/etc/cron.daily/clean-journal-logsexcludes:process.parent.args field:"process.parent.args" value:"/etc/cron.daily/clean-journal-logs"

AWS EC2 EBS Snapshot Shared or Made Public

#
Status
production
Severity
medium
Time window
6m
Author
Elastic
Source
github.com/elastic/detection-rules

Detects when an Amazon Elastic Block Store (EBS) snapshot is shared with another AWS account or made public. EBS snapshots contain copies of data volumes that may include sensitive or regulated information. Adversaries may exploit ModifySnapshotAttribute to share snapshots with external accounts or the public, allowing them to copy and access data in an environment they control. This activity often precedes data exfiltration or persistence operations, where the attacker transfers stolen data out of the victim account or prepares a staging area for further exploitation.

Known False Positives

  • AMI sharing is a common practice in AWS environments. Ensure that the sharing is authorized before taking action.

MITRE ATT&CK Coverage

TacticTechniques
Exfiltration

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2024/04/16"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Detects when an Amazon Elastic Block Store (EBS) snapshot is shared with another AWS account or made public. EBS
snapshots contain copies of data volumes that may include sensitive or regulated information. Adversaries may exploit
ModifySnapshotAttribute to share snapshots with external accounts or the public, allowing them to copy and access data
in an environment they control. This activity often precedes data exfiltration or persistence operations, where the
attacker transfers stolen data out of the victim account or prepares a staging area for further exploitation.
"""
event_category_override = "event.type"
false_positives = [
    """
    AMI sharing is a common practice in AWS environments. Ensure that the sharing is authorized before taking action.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS EC2 EBS Snapshot Shared or Made Public"
note = """## Triage and analysis 

### Investigating AWS EC2 EBS Snapshot Shared or Made Public

This rule detects when an Amazon Elastic Block Store (EBS) snapshot is shared with another AWS account or made public. EBS snapshots store copies of data volumes that may contain sensitive or regulated information. Adversaries may exploit the `ModifySnapshotAttribute` API to share these snapshots externally, allowing them to copy and access the data in an environment they control. This activity is commonly associated with data exfiltration or persistence techniques, where attackers transfer data outside the victim account or prepare backups they can later retrieve. Public sharing (`group=all`) represents a severe data exposure risk, as it makes the snapshot globally readable.

#### Possible investigation steps:

**Identify who performed the action**: Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to identify who modified the snapshot’s permissions. Evaluate whether this identity is authorized to share EBS snapshots (check IAM policies for `ec2:ModifySnapshotAttribute`).

**Analyze the source of the request**: Examine `source.ip` and `source.geo` fields to determine the geographical origin of the request. An unfamiliar or external location may indicate compromised credentials or unauthorized access. Review `user_agent.original` to confirm whether the request originated from an expected administrative tool or host.

**Examine the scope of the change**:
  - Review `aws.cloudtrail.request_parameters` to determine which AWS account(s) were added to the `createVolumePermission` list.  
    - If the account ID matches the snapshot owner’s account, this is redundant and typically non-malicious.  
    - If another account ID or `group=all` appears, verify whether the target is an approved AWS Organization account or an external party.  
  - Cross-check the affected `snapshotId` in the AWS console or via CLI (`describe-snapshot-attribute`) to confirm current sharing status.  
  - Identify whether other snapshots or AMIs were shared in the same timeframe.

**Correlate with other activities**:
  - Search CloudTrail for related events involving the same actor or `source.ip`.  
    - Look for `CreateSnapshot`, `CopySnapshot`, `ExportImage`, or `PutBucketAcl` events that could indicate broader exfiltration or replication behavior.  
    - Correlate with detections such as `EBS Snapshot Access Removed` or `EBS Encryption Disabled`, which may signal a coordinated campaign involving both exfiltration and impact.  
  - Check GuardDuty and Security Hub for findings related to data exposure, cross-account sharing, or unauthorized data transfer.

**Evaluate timing and intent**: Compare `@timestamp` against scheduled maintenance or approved change windows. Actions performed outside business hours or without documented change tickets should be prioritized for review.

### False positive analysis:

- **Authorized internal sharing**: Confirm if the snapshot sharing was part of an approved workflow, such as internal replication or migration between AWS Organization accounts.  
- **Automated replication or tooling**: Infrastructure-as-code or backup automation may temporarily share snapshots for cross-region or cross-account transfers. Verify automation identifiers, source IPs, and tags.  
- **Self-account addition**: Adding the owner’s own account ID to `createVolumePermission` has no operational impact and can be safely ignored.  

If verified as legitimate, document the event under change management and reconcile it against organizational policies for snapshot sharing.

### Response and remediation:

**Containment and validation**
- If unauthorized, immediately remove added permissions using the AWS CLI:  
  `aws ec2 modify-snapshot-attribute --snapshot-id <id> --create-volume-permission "Remove=[{UserId=<unauthorized_id>}]"`  
- Revoke public sharing (`group=all`) to prevent external access.  
- Restrict `ec2:ModifySnapshotAttribute` permissions to trusted administrative roles only.

**Investigate for data exfiltration or persistence**
- Determine whether the shared snapshot was copied to another account (`CopySnapshot`).  
- Engage AWS Support if evidence suggests external copying or data theft.  
- Review subsequent API calls or IAM changes for further persistence or data movement.

**Strengthen detection and monitoring**
- Enable AWS Config rules such as `ebs-snapshot-public-restorable-check`.  
- Implement continuous monitoring for `ModifySnapshotAttribute` and `CopySnapshot` operations.  
- Correlate future detections by actor, access key, and source IP to identify repeated or automated exfiltration attempts.

**Recovery and hardening**
- Enable default encryption and validate that all snapshots remain private.  
- Apply Service Control Policies (SCPs) to prevent public snapshot sharing organization-wide.  
- Audit existing snapshots to ensure no others have unauthorized permissions.  
- Implement least-privilege IAM principles and enforce multi-factor authentication (MFA) for administrative accounts.

### Additional information

- **[AWS Incident Response Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**: reference playbooks for investigating data exfiltration and unauthorized access.  
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/)**: example framework for developing custom playbooks for snapshot configuration and data protection.  
- **AWS Documentation**  
  - [EBS Snapshot Permissions](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html)  
  - [ModifySnapshotAttribute API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySnapshotAttribute.html)  
"""
references = [
    "https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html",
    "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySnapshotAttribute.html",
    "https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-post-exploitation/aws-ec2-ebs-ssm-and-vpc-post-exploitation/aws-ebs-snapshot-dump",
    "https://hackingthe.cloud/aws/exploitation/Misconfigured_Resource-Based_Policies/exploting_public_resources_attack_playbook/",
]
risk_score = 47
rule_id = "4182e486-fc61-11ee-a05d-f661ea17fbce"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS EC2",
    "Use Case: Threat Detection",
    "Tactic: Exfiltration",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
info where data_stream.dataset == "aws.cloudtrail"  
  and event.action == "ModifySnapshotAttribute"
  and event.outcome == "success"
  and stringContains (aws.cloudtrail.request_parameters, "attributeType=CREATE_VOLUME_PERMISSION")
  and stringContains (aws.cloudtrail.request_parameters, "add=")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1537"
name = "Transfer Data to Cloud Account"
reference = "https://attack.mitre.org/techniques/T1537/"


[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.request_parameters",
    "aws.cloudtrail.response_elements",
]

Stages and Predicates

Stage 1: info

info where data_stream.dataset == "aws.cloudtrail"  
  and event.action == "ModifySnapshotAttribute"
  and event.outcome == "success"
  and stringContains (aws.cloudtrail.request_parameters, "attributeType=CREATE_VOLUME_PERMISSION")
  and stringContains (aws.cloudtrail.request_parameters, "add=")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
aws.cloudtrail.request_parameterscontains
  • add= corpus 2 (elastic 2)
  • attributeType=CREATE_VOLUME_PERMISSION corpus 2 (elastic 2)
field:"aws::requestParameters" kind:contains
data_stream.dataseteq
  • aws.cloudtrail corpus 40 (elastic 40)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actioneq
  • ModifySnapshotAttribute corpus 2 (elastic 2)
field:"EventType" kind:eq value:"ModifySnapshotAttribute"
event.outcomeeq
  • success corpus 82 (elastic 82)
field:"event.outcome" kind:eq value:"success"

Command Obfuscation via Unicode Modifier Letters

#
Source
github.com/elastic/protections-artifacts

Identifies the presence of unicode modifier letters in the process command_line. Adversaries sometimes replace ASCII characters with visually similar Unicode modifier letters or combining marks to evade simple string-based detections.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the presence of unicode modifier letters in the process command_line. Adversaries sometimes replace ASCII
characters with visually similar Unicode modifier letters or combining marks to evade simple string-based detections.
"""
id = "2c7b91fa-f43d-46aa-887d-e5f3f032b29e"
license = "Elastic License v2"
name = "Command Obfuscation via Unicode Modifier Letters"
os_list = ["windows"]
reference = ["https://www.wietzebeukema.nl/blog/windows-command-line-obfuscation"]
version = "1.0.1"

query = '''
process where event.action == "start" and user.id != "S-1-5-18" and
 (
   process.name : ("reg.exe", "net.exe", "net1.exe", "certutil.exe", "MSHTA.EXE", "msiexec.exe", "bitsadmin.exe", "CertReq.exe", "PrintBrm.exe", "MSBuild.exe", "wuauclt.exe", "curl.exe", "wget.exe", "ssh.exe", "Cmd.Exe", "PowerShell.EX", "CONHOST.EXE", "wscript.exe", "cscript.exe", "REGSVR32.EXE", "RUNDLL32.EXE", "procdump.exe", "ntdsutil.exe", "diskshadow.exe", "schtasks.exe", "sc.exe", "wmic.exe", "VSSADMIN.EXE", "WBADMIN.EXE", "sftp.exe", "scp.exe", "esentutl.exe", "InstallUtil.exe", "wevtutil.exe") or
   process.pe.original_file_name in ("reg.exe", "net.exe", "net1.exe", "CertUtil.exe", "MSHTA.EXE", "msiexec.exe", "bitsadmin.exe", "CertReq.exe", "PrintBrm.exe", "MSBuild.exe", "wuauclt.exe", "curl.exe", "wget.exe", "ssh.exe", "Cmd.Exe", "PowerShell.EX", "CONHOST.EXE", "wscript.exe", "cscript.exe", "REGSVR32.EXE", "RUNDLL32.EXE", "procdump", "ntdsutil.exe", "diskshadow.exe", "schtasks.exe", "sc.exe", "wmic.exe", "VSSADMIN.EXE", "WBADMIN.EXE", "sftp.exe", "scp.exe", "esentutl.exe", "InstallUtil.exe", "wevtutil.exe")
 ) and
 process.command_line regex """.*[ʰ-˿ᴬ-ᶻ]+.*""" and
 not (process.name : "cmd.exe" and process.parent.executable : ("C:\\Program Files\\Smaart Suite\\Smaart.exe", "C:\\Program Files (x86)\\NetDocuments\\ndOffice\\ndOffice.exe", "C:\\Program Files (x86)\\Smaart 8\\Smaart.exe", "E:\\Spectrum\\Notifier\\sd_notifier\\SD_Notifier.exe")) and
 not (process.name : "rundll32.exe" and process.args : "C:\\WINDOWS\\system32\\davclnt.dll,DavSetCookie")
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.010"
name = "Command Obfuscation"
reference = "https://attack.mitre.org/techniques/T1027/010/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and user.id != "S-1-5-18" and
 (
   process.name : ("reg.exe", "net.exe", "net1.exe", "certutil.exe", "MSHTA.EXE", "msiexec.exe", "bitsadmin.exe", "CertReq.exe", "PrintBrm.exe", "MSBuild.exe", "wuauclt.exe", "curl.exe", "wget.exe", "ssh.exe", "Cmd.Exe", "PowerShell.EX", "CONHOST.EXE", "wscript.exe", "cscript.exe", "REGSVR32.EXE", "RUNDLL32.EXE", "procdump.exe", "ntdsutil.exe", "diskshadow.exe", "schtasks.exe", "sc.exe", "wmic.exe", "VSSADMIN.EXE", "WBADMIN.EXE", "sftp.exe", "scp.exe", "esentutl.exe", "InstallUtil.exe", "wevtutil.exe") or
   process.pe.original_file_name in ("reg.exe", "net.exe", "net1.exe", "CertUtil.exe", "MSHTA.EXE", "msiexec.exe", "bitsadmin.exe", "CertReq.exe", "PrintBrm.exe", "MSBuild.exe", "wuauclt.exe", "curl.exe", "wget.exe", "ssh.exe", "Cmd.Exe", "PowerShell.EX", "CONHOST.EXE", "wscript.exe", "cscript.exe", "REGSVR32.EXE", "RUNDLL32.EXE", "procdump", "ntdsutil.exe", "diskshadow.exe", "schtasks.exe", "sc.exe", "wmic.exe", "VSSADMIN.EXE", "WBADMIN.EXE", "sftp.exe", "scp.exe", "esentutl.exe", "InstallUtil.exe", "wevtutil.exe")
 ) and
 process.command_line regex """.*[ʰ-˿ᴬ-ᶻ]+.*""" and
 not (process.name : "cmd.exe" and process.parent.executable : ("C:\\Program Files\\Smaart Suite\\Smaart.exe", "C:\\Program Files (x86)\\NetDocuments\\ndOffice\\ndOffice.exe", "C:\\Program Files (x86)\\Smaart 8\\Smaart.exe", "E:\\Spectrum\\Notifier\\sd_notifier\\SD_Notifier.exe")) and
 not (process.name : "rundll32.exe" and process.args : "C:\\WINDOWS\\system32\\davclnt.dll,DavSetCookie")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_lineregex_match
  • .*[ʰ-˿ᴬ-ᶻ]+.*
field:"CommandLine" kind:regex_match value:".*[ʰ-˿ᴬ-ᶻ]+.*"
process.namewildcard
  • CONHOST.EXE corpus 12 (elastic 11, splunk 1)
  • CertReq.exe corpus 20 (elastic 20)
  • Cmd.Exe corpus 122 (elastic 93, splunk 29)
  • InstallUtil.exe corpus 36 (elastic 32, splunk 4)
  • MSBuild.exe corpus 39 (elastic 36, splunk 3)
  • MSHTA.EXE corpus 84 (elastic 80, splunk 4)
  • PowerShell.EX
  • PrintBrm.exe corpus 4 (elastic 4)
  • REGSVR32.EXE corpus 74 (elastic 69, splunk 5)
  • RUNDLL32.EXE corpus 123 (elastic 100, splunk 23)
  • VSSADMIN.EXE corpus 9 (elastic 6, splunk 3)
  • WBADMIN.EXE corpus 8 (elastic 6, splunk 2)
  • bitsadmin.exe corpus 25 (elastic 22, splunk 2, kusto 1)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • diskshadow.exe corpus 5 (elastic 4, splunk 1)
  • esentutl.exe corpus 6 (elastic 5, splunk 1)
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • net.exe corpus 30 (elastic 27, splunk 2, kusto 1)
  • net1.exe corpus 40 (elastic 21, splunk 19)
  • ntdsutil.exe corpus 5 (elastic 4, splunk 1)
  • procdump.exe corpus 3 (elastic 3)
  • reg.exe corpus 28 (elastic 18, splunk 9, kusto 1)
  • sc.exe corpus 32 (elastic 17, splunk 15)
  • schtasks.exe corpus 30 (elastic 19, splunk 11)
  • scp.exe corpus 5 (elastic 5)
  • sftp.exe corpus 3 (elastic 3)
  • ssh.exe corpus 8 (elastic 8)
  • wevtutil.exe corpus 10 (elastic 6, splunk 4)
  • wget.exe corpus 7 (elastic 7)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
  • wuauclt.exe corpus 7 (elastic 7)
field:"process_basename" kind:wildcard
process.pe.original_file_namein
  • CONHOST.EXE corpus 2 (elastic 2)
  • CertReq.exe corpus 3 (elastic 3)
  • CertUtil.exe corpus 4 (elastic 4)
  • Cmd.Exe corpus 12 (elastic 12)
  • InstallUtil.exe corpus 5 (elastic 5)
  • MSBuild.exe corpus 5 (elastic 5)
  • MSHTA.EXE corpus 8 (elastic 8)
  • PowerShell.EX
  • PrintBrm.exe corpus 2 (elastic 2)
  • REGSVR32.EXE corpus 7 (elastic 7)
  • RUNDLL32.EXE corpus 8 (elastic 8)
  • VSSADMIN.EXE corpus 2 (elastic 2)
  • WBADMIN.EXE corpus 2 (elastic 2)
  • bitsadmin.exe corpus 3 (elastic 3)
  • cscript.exe corpus 9 (elastic 9)
  • curl.exe corpus 3 (elastic 3)
  • diskshadow.exe corpus 2 (elastic 2)
  • esentutl.exe corpus 2 (elastic 2)
  • msiexec.exe corpus 3 (elastic 3)
  • net.exe corpus 2 (elastic 2)
  • net1.exe corpus 2 (elastic 2)
  • ntdsutil.exe corpus 2 (elastic 2)
  • procdump corpus 2 (elastic 2)
  • reg.exe corpus 3 (elastic 3)
  • sc.exe corpus 3 (elastic 3)
  • schtasks.exe corpus 3 (elastic 3)
  • scp.exe corpus 2 (elastic 2)
  • sftp.exe corpus 2 (elastic 2)
  • ssh.exe corpus 2 (elastic 2)
  • wevtutil.exe corpus 2 (elastic 2)
  • wget.exe corpus 2 (elastic 2)
  • wmic.exe corpus 3 (elastic 3)
  • wscript.exe corpus 9 (elastic 9)
  • wuauclt.exe corpus 3 (elastic 3)
field:"OriginalFileName" kind:in
user.idne
  • S-1-5-18 corpus 37 (elastic 37)
field:"user.id" kind:ne value:"S-1-5-18"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqC:\WINDOWS\system32\davclnt.dll,DavSetCookieexcludes:process.args field:"process.args" value:"C:\WINDOWS\system32\davclnt.dll,DavSetCookie"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.parent.executableeqC:\Program Files\Smaart Suite\Smaart.exe, C:\Program Files (x86)\NetDocuments\ndOffice\ndOffice.exe, C:\Program Files (x86)\Smaart 8\Smaart.exe, E:\Spectrum\Notifier\sd_notifier\SD_Notifier.exeexcludes:process.parent.executable

Credential Acquisition via Registry Hive Dumping

#
Status
production
Severity
high
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies attempts to export a registry hive which may contain credentials using the Windows reg.exe tool.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/11/23"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/06/30"

[rule]
author = ["Elastic"]
description = "Identifies attempts to export a registry hive which may contain credentials using the Windows reg.exe tool."
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Credential Acquisition via Registry Hive Dumping"
references = [
    "https://medium.com/threatpunter/detecting-attempts-to-steal-passwords-from-the-registry-7512674487f8",
    "https://www.elastic.co/security-labs/detect-credential-access",
]
risk_score = 73
rule_id = "a7e7bfa3-088e-4f13-b29e-3986e0e756b8"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Sysmon",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
 (?process.pe.original_file_name == "reg.exe" or process.name : "reg.exe") and
 process.args : ("save", "export") and
 process.args : (
   "hklm\\sam", "hklm\\security", "hklm\\system",
   "hkey_local_machine\\sam", "hkey_local_machine\\security", "hkey_local_machine\\system"
 )
'''

note = """## Triage and analysis

### Investigating Credential Acquisition via Registry Hive Dumping

#### Possible investigation steps

- What exact hive-export behavior did the alert capture?
  - Focus: `process.command_line`, `process.executable`, `process.pe.original_file_name`, and `process.code_signature.subject_name`.
  - Implication: escalate if the command saves or exports SAM or SECURITY to temp, public, admin-share, UNC, removable, or deceptive paths; lower suspicion only when the signed Microsoft reg.exe identity, destination, and export set fit the same recognized backup, recovery, forensic, or break-glass workflow. Identity alone never clears the export.

- Does the parent and session context explain why credential-bearing hives were exported?
  - Focus: `process.parent.executable`, `process.parent.command_line`, `process.Ext.session_info.logon_type`, and `user.id`.
  - Hint: If the parent is generic and lineage remains unclear, expand ancestry before accepting a maintenance explanation.
  - Implication: escalate when an interactive shell, script host, RMM tool, service account, remote-style session, or unexpected user initiated the export; lower suspicion when the same user or service identity, parent workflow, and session type recur for a recognized backup, recovery, forensic, or break-glass process.

- Did the alert parent launch accompanying SYSTEM export, staging, transfer, cleanup, or alternate dump commands?
  - Focus: process events from the alert parent and reg.exe children, using `process.parent.entity_id`, `process.parent.pid`, `process.executable`, and `process.command_line`. $investigate_2 $investigate_3
  - Hint: If `process.parent.entity_id` is absent, use the `host.id` + alert `process.parent.pid` branch in a tight alert-time window; if reg.exe spawned a helper, pivot from alert `process.entity_id` to child `process.parent.entity_id`.
  - Hint: If file or network telemetry is available, recover file activity and connections for reg.exe and its children to identify hive output, archives, share writes, removable-media staging, or off-host transfer. Missing network telemetry is unresolved, not benign. $investigate_4 $investigate_5
  - Implication: escalate when the same parent exports SYSTEM, packages, copies, deletes, or transfers hive output, or launches vssadmin.exe, diskshadow.exe, or shadow-copy paths to continue dumping outside this rule; absence of same-parent support reduces staging evidence but does not clear the original export.

- Does the host role or hive combination raise credential-exposure severity?
  - Focus: `host.id`, `host.name`, and `process.command_line`, plus asset or case records only as corroboration.
  - Hint: Do not infer privileged role from `host.name` alone.
  - Implication: raise urgency when asset context or host history identifies a jump host, backup node, admin workstation, server, or shared management platform, or when same-parent process review confirms SYSTEM was exported with SAM or SECURITY; lower urgency only when the host role and export set fit the same recognized workflow.

- If local evidence remains suspicious or unresolved, does related alert scope show broader credential-access activity?
  - Focus: related alerts for the same `user.id` and `host.id`, looking for credential dumping, archiving, privilege escalation, persistence, or lateral movement.
  - Hint: Start with same-user alerts. $investigate_0
  - Hint: Compare same-host alerts. $investigate_1
  - Implication: broaden scope and credential review when related alerts show complementary abuse; keep the case local when related alert scope is quiet and local telemetry already binds the export to one recognized workflow.

- Based on the evidence gathered, what disposition is supported?
  - Focus: binary identity, hive targets and output path, parent/session context, same-parent or child-process activity, host exposure, and related-alert scope.
  - Implication: escalate when an unrecognized SAM or SECURITY export has a risky destination, suspicious lineage or session, follow-on staging, privileged-host exposure, or related credential-access alerts; close only when the same evidence categories bind one exact recognized workflow on this host, with outside confirmation if telemetry cannot prove legitimacy; preserve artifacts and escalate when evidence is mixed or incomplete.

### False positive analysis

- Backup, recovery, forensic, or break-glass workflows can legitimately export SAM or SECURITY hives. Confirm that the signed Microsoft utility identity, command-line hive and destination pattern, parent workflow, session context, `user.id`, `host.id`, host role, and same-parent or child-process activity all align with the same workflow. If telemetry cannot prove legitimacy, use case records, change records, or owner confirmation only as corroboration for that exact activity. If any evidence dimension contradicts the workflow, do not close as benign.
- Before creating an exception, validate that the same `process.executable`, `process.code_signature.subject_name`, `process.parent.command_line`, `process.command_line` hive/destination pattern, `user.id`, and `host.id` recur across prior alerts from this rule. Build from that minimum confirmed pattern. Avoid exceptions on `process.name`, reg.exe, the hive name, or the host alone.

### Response and remediation

- If confirmed benign, reverse any temporary restriction and document the recognized utility path, hive/destination pattern, parent and session context, `user.id`, `host.id`, host role, and corroborating case evidence that justified closure. Create an exception only if that same pattern recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the alert record, process tree, `process.entity_id`, `process.command_line`, output path named in the command, same-parent or child-process command lines, session context, `user.id`, and `host.id` before containment or cleanup. Apply reversible containment tied to the findings, such as temporary share restriction or limited outbound access for the affected host; escalate to host isolation or account action only if staging, transfer commands, related alerts, or host criticality justify the impact.
- If confirmed malicious, preserve the same evidence set, then isolate the host if its role can tolerate it and the findings show unauthorized hive export or movement risk. Contain the responsible account only when the user/session evidence indicates account misuse. Terminate the process only after evidence capture if it is still running.
- Scope exposure from the copied material: SAM implies local account hash exposure; SECURITY implies LSA secret or cached-credential exposure; a same-parent SYSTEM export makes offline decryption more plausible and should raise urgency.
- Before deleting or rotating anything, review related `host.id` and `user.id` activity for the same command patterns, hive-copy names, archive names, share paths, transfer commands, and alternate copy methods such as vssadmin.exe, diskshadow.exe, or raw shadow-copy access. Then remove only the unauthorized dump scripts, archives, copied hive files, and persistence mechanisms identified during the investigation, and remediate the access path that allowed the export.
- Post-incident hardening: restrict hive export activity to recognized recovery or forensic workflows, document the confirmed `process.command_line` and destination patterns behind any exception, and retain process telemetry needed to distinguish future recovery work from repeated abuse.
"""

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "host.name",
    "user.name",
    "user.id",
    "process.entity_id",
    "process.executable",
    "process.command_line",
    "process.pe.original_file_name",
    "process.parent.entity_id",
    "process.parent.pid",
    "process.parent.executable",
    "process.parent.command_line",
    "process.code_signature.subject_name",
    "process.Ext.session_info.logon_type",
]

[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Processes from same parent as alert"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.parent.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.parent.pid}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Child processes of reg.exe"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "File activity for reg.exe and children"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Network activity for reg.exe and children"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.002"
name = "Security Account Manager"
reference = "https://attack.mitre.org/techniques/T1003/002/"

[[rule.threat.technique.subtechnique]]
id = "T1003.004"
name = "LSA Secrets"
reference = "https://attack.mitre.org/techniques/T1003/004/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
 (?process.pe.original_file_name == "reg.exe" or process.name : "reg.exe") and
 process.args : ("save", "export") and
 process.args : (
   "hklm\\sam", "hklm\\security", "hklm\\system",
   "hkey_local_machine\\sam", "hkey_local_machine\\security", "hkey_local_machine\\system"
 )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • export corpus 3 (elastic 3)
  • hkey_local_machine\sam
  • hkey_local_machine\security
  • hkey_local_machine\system
  • hklm\sam
  • hklm\security
  • hklm\system
  • save corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.namewildcard
  • reg.exe corpus 28 (elastic 18, splunk 9, kusto 1)
field:"process_basename" kind:wildcard value:"reg.exe"
process.pe.original_file_nameeq
  • reg.exe corpus 2 (elastic 2)
field:"OriginalFileName" kind:eq value:"reg.exe"

Egress Connection from Entrypoint in Container

#
Status
production
Severity
medium
Time window
3s
Sequence by
host.id, process.entity_id, process.parent.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

This rule identifies a sequence of events where a process named "entrypoint.sh" is started in a container, followed by a network connection attempt. This sequence indicates a potential egress connection from an entrypoint in a container. An entrypoint is a command or script specified in the Dockerfile and executed when the container starts. Attackers can use this technique to establish a foothold in the environment, escape from a container to the host, or establish persistence.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/07/10"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule identifies a sequence of events where a process named "entrypoint.sh" is started in a container, followed by a
network connection attempt. This sequence indicates a potential egress connection from an entrypoint in a container. An
entrypoint is a command or script specified in the Dockerfile and executed when the container starts. Attackers can use
this technique to establish a foothold in the environment, escape from a container to the host, or establish persistence.
"""
from = "now-9m"
index = ["logs-endpoint.events.network*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Egress Connection from Entrypoint in Container"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Egress Connection from Entrypoint in Container

Containers, often used for deploying applications, start with an entrypoint script that initializes the environment. Adversaries may exploit this by embedding malicious commands to initiate unauthorized network connections, potentially breaching security boundaries. The detection rule monitors for processes named `entrypoint.sh` followed by suspicious network activity, flagging attempts to connect to external IPs, thus identifying potential threats.

### Possible investigation steps

- Review the process details for the `entrypoint.sh` script execution, focusing on the `process.entity_id` and `host.id` to understand the context of the container where the script was executed.
- Examine the network connection attempt details, particularly the `destination.ip`, to determine if the IP address is known to be malicious or associated with suspicious activity.
- Check the container's Dockerfile or image configuration to verify if the `entrypoint.sh` script is expected and whether it contains any unauthorized modifications or additions.
- Investigate the parent process of the network connection attempt using `process.parent.entity_id` to identify if there are any other suspicious processes or activities linked to the same parent.
- Correlate the event with other logs or alerts from the same `host.id` to identify any additional indicators of compromise or related suspicious activities within the same timeframe.

### False positive analysis

- Legitimate application updates or installations may trigger the rule if they involve network connections from the entrypoint script. To handle this, identify and whitelist specific applications or update processes that are known to perform such actions.
- Automated configuration management tools might execute scripts that initiate network connections as part of their normal operations. Exclude these tools by specifying their process names or parent entity IDs in the rule exceptions.
- Containers designed to perform network diagnostics or monitoring could naturally attempt connections to external IPs. Review and exclude these containers by their image names or specific entrypoint scripts.
- Development or testing environments often run scripts that connect to external services for integration testing. Consider excluding these environments by tagging them appropriately and adjusting the rule to ignore these tags.
- Scheduled maintenance scripts that run periodically and require network access might be flagged. Document these scripts and create exceptions based on their execution schedule or specific network destinations.

### Response and remediation

- Immediately isolate the affected container to prevent further unauthorized network connections. This can be done by stopping the container or disconnecting it from the network.
- Conduct a thorough review of the `entrypoint.sh` script within the container to identify and remove any malicious commands or scripts that may have been injected.
- Analyze the network traffic logs to identify any external IP addresses that the container attempted to connect to. Block these IPs at the firewall level to prevent future connections.
- Check for any signs of lateral movement or attempts to escape the container to the host system. If detected, escalate to the security team for a comprehensive investigation.
- Restore the container from a known good backup if available, ensuring that the restored version is free from any malicious modifications.
- Implement additional monitoring on the affected host and container environment to detect any similar suspicious activities in the future.
- Report the incident to the appropriate internal security team or incident response team for further analysis and to update threat intelligence databases."""
risk_score = 47
rule_id = "c75d0c86-38d6-4821-98a1-465cff8ff4c8"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence by host.id with maxspan=3s
  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
   process.entry_leader.entry_meta.type == "container" and process.name == "entrypoint.sh"] by process.entity_id
  [network where event.type == "start" and event.action == "connection_attempted" and process.executable != null and
   not (
     destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
       destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
       "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
       "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
       "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
       "FF00::/8", "172.31.0.0/16"
       ) or
    // Excluding vast majority of noise
    (process.name like ("python*", "pip*") and destination.port == 443)
    )] by process.parent.entity_id
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1611"
name = "Escape to Host"
reference = "https://attack.mitre.org/techniques/T1611/"

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 3s, correlated by host.id, process.entity_id, process.parent.entity_id.

Stage 1: process

[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
   process.entry_leader.entry_meta.type == "container" and process.name == "entrypoint.sh"] by process.entity_id

Stage 2: network

[network where event.type == "start" and event.action == "connection_attempted" and process.executable != null and
   not (
     destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
       destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
       "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
       "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
       "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
       "FF00::/8", "172.31.0.0/16"
       ) or
    (process.name like ("python*", "pip*") and destination.port == 443)
    )] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.porteq443excludes:destination.port field:"destination.port" value:"443"
process.namestarts_withpython, pipexcludes:process.name field:"process.name" value:"python" field:"process.name" value:"pip"
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8, 172.31.0.0/16excludes:destination.ip
destination.ipeq0.0.0.0excludes:destination.ip field:"destination.ip" value:"0.0.0.0"
destination.ipis_null(no value, null check)excludes:destination.ip

Execution of a Binary Dropped via Microsoft BSDTAR Archive Tool

#
Time window
5m
Sequence by
file.path, process.executable
Source
github.com/elastic/protections-artifacts

Identifies the execution of a PE File that was written by the Windows native TAR utility. Adversaries may compress malicious content to bypass existing ingress tool transfer restrictions.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a PE File that was written by the Windows native TAR utility. Adversaries may compress
malicious content to bypass existing ingress tool transfer restrictions.
"""
id = "5b856290-d3f5-4b2f-9f49-e753ce4ade28"
license = "Elastic License v2"
name = "Execution of a Binary Dropped via Microsoft BSDTAR Archive Tool"
os_list = ["windows"]
version = "1.0.25"

query = '''
sequence with maxspan=5m
   [file where process.executable : "?:\\Windows\\Sys*\\tar.exe" and file.Ext.header_bytes : "4d5a*"] by file.path
   [process where event.action == "start" and not process.code_signature.trusted == true and
    process.executable : "C:\\*" and
    not process.hash.sha256 :
               ("762abab44d25a0e6441600f6ad3a08e8f07016774608d80edc71b5b90b1ac5d8",
                "70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530",
                "68b41beae36e4aa7ba4237b6067ed36dc0c6e0d9d5453fd8d61af335d0efd37f",
                "70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530",
                "e8368338fe5d2f0cc7529df9f3684ea6d79a627d2cc33b1685b8f7adcfa952ae",
                "82909875e911bb7b5c31a3338449368f62e1ff7cbc09829ed72e31789b1a0712",
                "40d20e6dfb0654419b289c71f3d048202550d462df1c41675b0c5f18b6bada14") and
    not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")] by process.executable
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"


[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by file.path, process.executable.

Stage 1: file

[file where process.executable : "?:\\Windows\\Sys*\\tar.exe" and file.Ext.header_bytes : "4d5a*"] by file.path

Stage 2: process

[process where event.action == "start" and not process.code_signature.trusted == true and
    process.executable : "C:\\*" and
    not process.hash.sha256 :
               ("762abab44d25a0e6441600f6ad3a08e8f07016774608d80edc71b5b90b1ac5d8",
                "70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530",
                "68b41beae36e4aa7ba4237b6067ed36dc0c6e0d9d5453fd8d61af335d0efd37f",
                "70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530",
                "e8368338fe5d2f0cc7529df9f3684ea6d79a627d2cc33b1685b8f7adcfa952ae",
                "82909875e911bb7b5c31a3338449368f62e1ff7cbc09829ed72e31789b1a0712",
                "40d20e6dfb0654419b289c71f3d048202550d462df1c41675b0c5f18b6bada14") and
    not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")] by process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
process.executablewildcard
  • ?:\Windows\Sys*\tar.exe
  • C:\* corpus 16 (elastic 16)
field:"Image" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\"
process.hash.sha256eq762abab44d25a0e6441600f6ad3a08e8f07016774608d80edc71b5b90b1ac5d8, 70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530, 68b41beae36e4aa7ba4237b6067ed36dc0c6e0d9d5453fd8d61af335d0efd37f, 70d994f269c652a3a5fb639251f8247a6d914bfde068eb807f6023909de89530, e8368338fe5d2f0cc7529df9f3684ea6d79a627d2cc33b1685b8f7adcfa952ae, 82909875e911bb7b5c31a3338449368f62e1ff7cbc09829ed72e31789b1a0712, 40d20e6dfb0654419b289c71f3d048202550d462df1c41675b0c5f18b6bada14excludes:process.hash.sha256

Git Hook Child Process

#
Status
production
Severity
low
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects child processes spawned by Git hooks. Git hooks are scripts that Git executes before or after events such as commit, push, and receive. The rule identifies child processes spawned by Git hooks that are not typically spawned by the Git process itself. This behavior may indicate an attacker attempting to hide malicious activity by leveraging the legitimate Git process to execute unauthorized commands.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/06/26"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects child processes spawned by Git hooks. Git hooks are scripts that Git executes before or after events
such as commit, push, and receive. The rule identifies child processes spawned by Git hooks that are not typically
spawned by the Git process itself. This behavior may indicate an attacker attempting to hide malicious activity by
leveraging the legitimate Git process to execute unauthorized commands.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
    "endgame-*",
]
language = "eql"
license = "Elastic License v2"
name = "Git Hook Child Process"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Git Hook Child Process

Git hooks are scripts that automate tasks during Git operations like commits or pushes. Adversaries may exploit these hooks to execute unauthorized commands, masking malicious activities under legitimate processes. The detection rule identifies unusual child processes spawned by Git hooks, focusing on atypical scripts or executables in suspicious directories, signaling potential misuse.

### Possible investigation steps

- Review the process tree to understand the parent-child relationship, focusing on the parent process names listed in the query, such as "pre-commit" or "post-update", to determine the context of the spawned child process.
- Examine the command line arguments and environment variables of the suspicious child process to identify any potentially malicious or unauthorized commands being executed.
- Check the file paths of the executables involved, especially those in unusual directories like "/tmp/*" or "/var/tmp/*", to assess if they are legitimate or potentially harmful.
- Investigate the user account under which the suspicious process is running to determine if it has been compromised or is being used in an unauthorized manner.
- Correlate the event with other security logs or alerts from the same host to identify any patterns or additional indicators of compromise.
- Review recent Git activity on the repository to identify any unauthorized changes or suspicious commits that might indicate tampering with Git hooks.

### False positive analysis

- Legitimate development scripts: Developers may use scripts in directories like /tmp or /var/tmp for testing purposes. To handle this, create exceptions for known scripts or directories used by trusted developers.
- Custom shell usage: Developers might use shells like bash or zsh for legitimate automation tasks. Identify and whitelist these specific shell scripts if they are part of regular development workflows.
- Temporary file execution: Some applications may temporarily execute files from directories like /dev/shm or /run. Monitor these applications and exclude them if they are verified as non-threatening.
- Non-standard interpreters: Developers might use interpreters like php or perl for legitimate tasks. Review and whitelist these processes if they are part of approved development activities.
- System maintenance scripts: Scheduled tasks or maintenance scripts might run from /etc/cron.* or /etc/init.d. Verify these scripts and exclude them if they are part of routine system operations.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or execution of malicious commands.
- Terminate any suspicious processes identified by the detection rule, especially those originating from unusual directories or involving unexpected scripts or executables.
- Conduct a thorough review of the Git hooks on the affected system to identify and remove any unauthorized or malicious scripts.
- Restore any modified or deleted files from a known good backup to ensure system integrity and continuity of operations.
- Implement stricter access controls and permissions for Git repositories and associated directories to prevent unauthorized modifications to Git hooks.
- Monitor the affected system and related network activity closely for any signs of persistence or further compromise, using enhanced logging and alerting mechanisms.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems or data have been affected."""
references = [
    "https://git-scm.com/docs/githooks/2.26.0",
    "https://www.elastic.co/security-labs/sequel-on-persistence-mechanisms",
]
risk_score = 21
rule_id = "7ce5e1c7-6a49-45e6-a101-0720d185667f"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic 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.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- 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).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- 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.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.parent.name in (
  "applypatch-msg", "commit-msg", "fsmonitor-watchman", "post-update", "post-checkout", "post-commit",
  "pre-applypatch", "pre-commit", "pre-merge-commit", "prepare-commit-msg", "pre-push", "pre-rebase", "pre-receive",
  "push-to-checkout", "update", "post-receive", "pre-auto-gc", "post-rewrite", "sendemail-validate", "p4-pre-submit",
  "post-index-change", "post-merge", "post-applypatch"
) and
(
  process.name in ("nohup", "setsid", "disown", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
  process.name like ("php*", "perl*", "ruby*", "lua*") or
  process.executable like (
    "/boot/*", "/dev/shm/*", "/etc/cron.*/*", "/etc/init.d/*", "/etc/update-motd.d/*",
    "/run/*", "/srv/*", "/tmp/*", "/var/tmp/*", "/var/log/*"
  )
) and
not process.name in ("git", "dirname")
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"

[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.parent.name in (
  "applypatch-msg", "commit-msg", "fsmonitor-watchman", "post-update", "post-checkout", "post-commit",
  "pre-applypatch", "pre-commit", "pre-merge-commit", "prepare-commit-msg", "pre-push", "pre-rebase", "pre-receive",
  "push-to-checkout", "update", "post-receive", "pre-auto-gc", "post-rewrite", "sendemail-validate", "p4-pre-submit",
  "post-index-change", "post-merge", "post-applypatch"
) and
(
  process.name in ("nohup", "setsid", "disown", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
  process.name like ("php*", "perl*", "ruby*", "lua*") or
  process.executable like (
    "/boot/*", "/dev/shm/*", "/etc/cron.*/*", "/etc/init.d/*", "/etc/update-motd.d/*",
    "/run/*", "/srv/*", "/tmp/*", "/var/tmp/*", "/var/log/*"
  )
) and
not process.name in ("git", "dirname")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.executablewildcard
  • /boot/*
  • /dev/shm/*
  • /etc/cron.*/*
  • /etc/init.d/*
  • /etc/update-motd.d/*
  • /run/*
  • /srv/*
  • /tmp/*
  • /var/log/*
  • /var/tmp/*
field:"Image" kind:wildcard
process.namein
  • bash
  • csh
  • dash
  • disown
  • fish
  • ksh
  • nohup
  • setsid
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • lua*
  • perl*
  • php*
  • ruby*
field:"process_basename" kind:wildcard
process.parent.namein
  • applypatch-msg
  • commit-msg
  • fsmonitor-watchman
  • p4-pre-submit
  • post-applypatch
  • post-checkout
  • post-commit
  • post-index-change
  • post-merge
  • post-receive
  • post-rewrite
  • post-update
  • pre-applypatch
  • pre-auto-gc
  • pre-commit
  • pre-merge-commit
  • pre-push
  • pre-rebase
  • pre-receive
  • prepare-commit-msg
  • push-to-checkout
  • sendemail-validate
  • update
field:"parent_process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

GKE Pod Created With HostPID

#
Status
production
Severity
medium
Author
Elastic
Source
github.com/elastic/detection-rules

Detects GKE pod create, update, or patch events that enable host PID namespace sharing. HostPID exposes host processes and can support privilege escalation, especially with ptrace or privileged containers. System identities and controller-owned workloads are excluded.

Known False Positives

  • Debug pods may legitimately use hostPID. Exclude trusted admin workflows after baselining.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/30"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/06/30"

[rule]
author = ["Elastic"]
description = """
Detects GKE pod create, update, or patch events that enable host PID namespace sharing. HostPID exposes host processes
and can support privilege escalation, especially with ptrace or privileged containers. System identities and
controller-owned workloads are excluded.
"""
false_positives = [
    """
    Debug pods may legitimately use hostPID. Exclude trusted admin workflows after baselining.
    """,
]
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Pod Created With HostPID"
note = """## Triage and analysis

### Investigating GKE Pod Created With HostPID

HostPID visibility into host processes is high risk. Confirm whether the pod spec change was authorized.

### Investigation steps

- Review actor (`user.email`), target pod, and images in the audit request.
- Correlate with exec, secret access, or RBAC changes from the same identity.

### False positives

- Break-glass troubleshooting; tune by user or namespace.

## Setup

The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."""
references = [
    "https://kubernetes.io/docs/concepts/security/pod-security-standards/",
    "https://bishopfox.com/blog/kubernetes-pod-privilege-escalation",
]
risk_score = 47
rule_id = "f2108687-553d-45ac-b8f0-d0efeac5d45f"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and
event.action:("io.k8s.core.v1.pods.create" or "io.k8s.core.v1.pods.update" or "io.k8s.core.v1.pods.patch") and
gcp.audit.request.spec.hostPID:true and not user.email:system\:* and
not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet")
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1611"
name = "Escape to Host"
reference = "https://attack.mitre.org/techniques/T1611/"

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1610"
name = "Deploy Container"
reference = "https://attack.mitre.org/techniques/T1610/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and
event.action:("io.k8s.core.v1.pods.create" or "io.k8s.core.v1.pods.update" or "io.k8s.core.v1.pods.patch") and
gcp.audit.request.spec.hostPID:true and not user.email:system\:* and
not gcp.audit.request.metadata.ownerReferences.kind:("ReplicaSet" or "DaemonSet" or "StatefulSet")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • gcp.audit corpus 60 (elastic 60)
field:"data_stream.dataset" kind:eq value:"gcp.audit"
event.actionin
  • io.k8s.core.v1.pods.create corpus 5 (elastic 5)
  • io.k8s.core.v1.pods.patch corpus 5 (elastic 5)
  • io.k8s.core.v1.pods.update corpus 5 (elastic 5)
field:"EventType" kind:in
gcp.audit.request.spec.hostPIDeq
  • true
field:"gcp.audit.request.spec.hostPID" kind:eq value:"true"

Exclusions

The rule actively suppresses these predicates.

Host File System Changes via Windows Subsystem for Linux

#
Status
production
Severity
medium
Time window
5m
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Detects file creation and modification on the host system from the Windows Subsystem for Linux. Adversaries may enable and use WSL to avoid detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/01/12"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/06/05"

[rule]
author = ["Elastic"]
description = """
Detects file creation and modification on the host system from the Windows Subsystem for Linux. Adversaries may enable
and use WSL to avoid detection.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.file-*",
    "logs-windows.sysmon_operational-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Host File System Changes via Windows Subsystem for Linux"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Host File System Changes via Windows Subsystem for Linux

Windows Subsystem for Linux (WSL) allows users to run a Linux environment directly on Windows, facilitating seamless file access between systems. Adversaries may exploit WSL to modify host files stealthily, bypassing traditional security measures. The detection rule identifies suspicious file operations initiated by WSL processes, particularly those involving the Plan9FileSystem, to flag potential defense evasion attempts.

### Possible investigation steps

- Review the process details for the "dllhost.exe" instance that triggered the alert, focusing on the command line arguments to confirm the presence of the Plan9FileSystem CLSID "{DFB65C4C-B34F-435D-AFE9-A86218684AA8}".
- Examine the file paths involved in the alert to determine if any sensitive or critical files were accessed or modified outside of typical user directories.
- Investigate the parent process of "dllhost.exe" to understand the context of its execution and identify any potentially malicious parent processes.
- Check the timeline of events leading up to and following the alert to identify any other suspicious activities or related alerts that may indicate a broader attack pattern.
- Correlate the alert with user activity logs to determine if the actions were performed by a legitimate user or if there are signs of compromised credentials or unauthorized access.

### False positive analysis

- Routine file operations by legitimate applications using WSL may trigger alerts. Identify and whitelist these applications to prevent unnecessary alerts.
- Development activities involving WSL, such as compiling code or running scripts, can generate false positives. Exclude specific development directories or processes from monitoring.
- Automated backup or synchronization tools that interact with WSL might be flagged. Configure exceptions for these tools by specifying their process names or file paths.
- System maintenance tasks that involve WSL, like updates or system checks, could be mistaken for suspicious activity. Schedule these tasks during known maintenance windows and adjust monitoring rules accordingly.
- Frequent downloads or file transfers to directories outside the typical user download paths may appear suspicious. Define clear policies for acceptable file paths and exclude them from alerts.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes associated with "dllhost.exe" that are linked to the Plan9FileSystem CLSID to stop ongoing malicious activities.
- Conduct a thorough review of recent file changes on the host system to identify and restore any unauthorized modifications or deletions.
- Revoke any unauthorized access or permissions granted to WSL that may have been exploited by the adversary.
- Update and patch the Windows Subsystem for Linux and related components to mitigate any known vulnerabilities that could be exploited.
- Monitor for any recurrence of similar activities by setting up alerts for processes and file operations involving "dllhost.exe" and the Plan9FileSystem.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
  "https://github.com/microsoft/WSL",
  "https://detect.fyi/the-interesting-case-of-wsl-for-payload-staging-bfaa0f69329a",
]
risk_score = 47
rule_id = "e88d1fe9-b2f4-48d4-bace-a026dc745d4b"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
    "Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence by process.entity_id with maxspan=5m
[process where host.os.type == "windows" and event.type == "start" and
 process.name : "dllhost.exe" and
  /* Plan9FileSystem CLSID - WSL Host File System Worker */
 process.command_line : "*{DFB65C4C-B34F-435D-AFE9-A86218684AA8}*"]
[file where host.os.type == "windows" and process.name : "dllhost.exe" and
  not file.path : "?:\\Windows\\Prefetch\\DLLHOST.exe-????????.pf"]
'''

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1202"
name = "Indirect Command Execution"
reference = "https://attack.mitre.org/techniques/T1202/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by process.entity_id.

Stage 1: process

[process where host.os.type == "windows" and event.type == "start" and
 process.name : "dllhost.exe" and
 process.command_line : "*{DFB65C4C-B34F-435D-AFE9-A86218684AA8}*"]

Stage 2: file

[file where host.os.type == "windows" and process.name : "dllhost.exe" and
  not file.path : "?:\\Windows\\Prefetch\\DLLHOST.exe-????????.pf"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • *{DFB65C4C-B34F-435D-AFE9-A86218684AA8}*
field:"CommandLine" kind:wildcard value:"*{DFB65C4C-B34F-435D-AFE9-A86218684AA8}*"
process.namewildcard
  • dllhost.exe corpus 19 (elastic 17, splunk 2)
field:"process_basename" kind:wildcard value:"dllhost.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.patheq?:\Windows\Prefetch\DLLHOST.exe-????????.pfexcludes:file.path field:"file.path" value:"?:\Windows\Prefetch\DLLHOST.exe-????????.pf"

ICMP Timestamp or Information Request from the Internet

#
Status
production
Severity
low
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies inbound ICMP Timestamp (type 13) or Information (type 15) requests from external addresses to internal RFC1918 destinations. These message types are rarely used in modern networks and are commonly associated with host and path fingerprinting during reconnaissance.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/06/25"
integration = ["network_traffic"]
maturity = "production"
updated_date = "2026/06/25"

[rule]
author = ["Elastic"]
description = """
Identifies inbound ICMP Timestamp (type 13) or Information (type 15) requests from external addresses to internal
RFC1918 destinations. These message types are rarely used in modern networks and are commonly associated with host and
path fingerprinting during reconnaissance.
"""
from = "now-9m"
index = ["logs-network_traffic.icmp-*"]
language = "kuery"
license = "Elastic License v2"
name = "ICMP Timestamp or Information Request from the Internet"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating ICMP Timestamp or Information Request from the Internet

ICMP Timestamp and Information requests are legacy diagnostic messages. Inbound use from the Internet toward internal
hosts is uncommon in production networks and often indicates active scanning or OS fingerprinting.

### Possible investigation steps

- Review `source.ip` against threat intelligence and prior scan activity on the environment.
- Determine whether the targeted `destination.ip` is an exposed host, VPN concentrator, or mis-NATed internal asset.
- Look for adjacent port scans, SYN sweeps, or exploit attempts from the same source around the alert window.
- Check whether the destination host replied and whether follow-on connections were attempted.

### False positive analysis

- Some legacy network monitoring or SLA probes may still use ICMP Timestamp requests. Maintain exceptions for known
  monitoring source ranges after validation.
- Shared hosting or multi-tenant environments with overlapping address space may require destination-specific tuning.

### Response and remediation

- Block or rate-limit the external source at the perimeter if activity is unauthorized.
- Verify that the targeted internal host is not unintentionally exposed to the Internet.
- Increase monitoring on targeted assets for follow-on exploitation attempts."""
references = [
    "https://www.rfc-editor.org/rfc/rfc792",
    "https://nmap.org/book/host-discovery-techniques.html",
    "https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml",
]
risk_score = 21
rule_id = "81139742-4d3a-49f3-a6dd-e0fb9834f959"
setup = """## Setup

This rule requires ICMP transaction telemetry from the Elastic network_traffic integration (`network_traffic.icmp`
data stream).
"""
severity = "low"
tags = [
    "Domain: Network",
    "Tactic: Discovery",
    "Tactic: Reconnaissance",
    "Use Case: Network Security Monitoring",
    "Use Case: Threat Detection",
    "Data Source: Network Traffic",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:network_traffic.icmp
  and (network_traffic.icmp.request.type:(13 or 15) or icmp.request.type:(13 or 15))
  and destination.ip:(
    10.0.0.0/8 or
    172.16.0.0/12 or
    192.168.0.0/16
  )
  and not source.ip:(
    10.0.0.0/8 or
    100.64.0.0/10 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.168.0.0/16 or
    192.0.0.0/24 or
    192.0.0.0/29 or
    192.0.0.8/32 or
    192.0.0.9/32 or
    192.0.0.10/32 or
    192.0.0.170/32 or
    192.0.0.171/32 or
    192.0.2.0/24 or
    192.175.48.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.88.99.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    224.0.0.0/4 or
    240.0.0.0/4 or
    "::1" or
    "FE80::/10" or
    "FF00::/8"
  )
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1018"
name = "Remote System Discovery"
reference = "https://attack.mitre.org/techniques/T1018/"


[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1595"
name = "Active Scanning"
reference = "https://attack.mitre.org/techniques/T1595/"
[[rule.threat.technique.subtechnique]]
id = "T1595.001"
name = "Scanning IP Blocks"
reference = "https://attack.mitre.org/techniques/T1595/001/"



[rule.threat.tactic]
id = "TA0043"
name = "Reconnaissance"
reference = "https://attack.mitre.org/tactics/TA0043/"

Stages and Predicates

Stage 1: query

data_stream.dataset:network_traffic.icmp
  and (network_traffic.icmp.request.type:(13 or 15) or icmp.request.type:(13 or 15))
  and destination.ip:(
    10.0.0.0/8 or
    172.16.0.0/12 or
    192.168.0.0/16
  )
  and not source.ip:(
    10.0.0.0/8 or
    100.64.0.0/10 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.168.0.0/16 or
    192.0.0.0/24 or
    192.0.0.0/29 or
    192.0.0.8/32 or
    192.0.0.9/32 or
    192.0.0.10/32 or
    192.0.0.170/32 or
    192.0.0.171/32 or
    192.0.2.0/24 or
    192.175.48.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.88.99.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    224.0.0.0/4 or
    240.0.0.0/4 or
    "::1" or
    "FE80::/10" or
    "FF00::/8"
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
source.ipin10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.0.8/32, 192.0.0.9/32, 192.0.2.0/24, 192.168.0.0/16, 192.175.48.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:source.ip

Mshta Making Network Connections

#
Status
production
Severity
medium
Time window
10m
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies Mshta.exe making outbound network connections. This may indicate adversarial activity, as Mshta is often leveraged by adversaries to execute malicious scripts and evade detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/09/02"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies Mshta.exe making outbound network connections. This may indicate adversarial activity, as Mshta is often
leveraged by adversaries to execute malicious scripts and evade detection.
"""
from = "now-20m"
index = [
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.network-*",
    "winlogbeat-*",
    "logs-windows.sysmon_operational-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Mshta Making Network Connections"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Mshta Making Network Connections

Mshta.exe is a legitimate Windows utility used to execute Microsoft HTML Application (HTA) files. Adversaries exploit it to run malicious scripts, leveraging its trusted status to bypass security measures. The detection rule identifies suspicious network activity by Mshta.exe, excluding known benign processes, to flag potential threats. This approach helps in identifying unauthorized network connections indicative of malicious intent.

### Possible investigation steps

- Review the process tree to understand the parent-child relationship of mshta.exe, focusing on any unusual or unexpected parent processes that are not excluded by the rule, such as Microsoft.ConfigurationManagement.exe or known benign executables.
- Analyze the command-line arguments used by mshta.exe to identify any suspicious or unexpected scripts being executed, especially those not matching the excluded ADSelfService_Enroll.hta.
- Examine the network connections initiated by mshta.exe, including destination IP addresses, domains, and ports, to identify any connections to known malicious or suspicious endpoints.
- Check for any related alerts or logs from the same host around the time of the mshta.exe activity to identify potential lateral movement or additional malicious behavior.
- Investigate the user account associated with the mshta.exe process to determine if it has been compromised or is exhibiting unusual activity patterns.

### False positive analysis

- Mshta.exe may be triggered by legitimate software updates or installations, such as those from Microsoft Configuration Management. To handle this, add exceptions for processes with parent names like Microsoft.ConfigurationManagement.exe.
- Certain applications like Amazon Assistant and TeamViewer may use Mshta.exe for legitimate purposes. Exclude these by specifying their executable paths, such as C:\\Amazon\\Amazon Assistant\\amazonAssistantService.exe and C:\\TeamViewer\\TeamViewer.exe.
- Custom scripts or internal tools that utilize HTA files for automation might cause false positives. Identify these scripts and exclude them by their specific arguments, such as ADSelfService_Enroll.hta.
- Regularly review and update the list of exceptions to ensure that only verified benign activities are excluded, minimizing the risk of overlooking genuine threats.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate the mshta.exe process if it is confirmed to be making unauthorized network connections.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any malicious scripts or files.
- Review and analyze the process tree and network connections associated with mshta.exe to identify any additional compromised processes or systems.
- Restore the system from a known good backup if malicious activity is confirmed and cannot be fully remediated.
- Implement application whitelisting to prevent unauthorized execution of mshta.exe and similar system binaries.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the potential impact on the broader network."""
references = [
    "https://www.elastic.co/security-labs/elastic-protects-against-data-wiper-malware-targeting-ukraine-hermeticwiper",
]
risk_score = 47
rule_id = "c2d90150-0133-451c-a783-533e736c12d7"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by process.entity_id with maxspan=10m
  [process where host.os.type == "windows" and event.type == "start" and process.name : "mshta.exe" and
     not process.parent.name : "Microsoft.ConfigurationManagement.exe" and
     not (process.parent.executable : "C:\\Amazon\\Amazon Assistant\\amazonAssistantService.exe" or
          process.parent.executable : "C:\\TeamViewer\\TeamViewer.exe") and
     not process.args : "ADSelfService_Enroll.hta"]
  [network where host.os.type == "windows" and process.name : "mshta.exe"]
'''

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"



[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 10m, correlated by process.entity_id.

Stage 1: process

[process where host.os.type == "windows" and event.type == "start" and process.name : "mshta.exe" and
     not process.parent.name : "Microsoft.ConfigurationManagement.exe" and
     not (process.parent.executable : "C:\\Amazon\\Amazon Assistant\\amazonAssistantService.exe" or
          process.parent.executable : "C:\\TeamViewer\\TeamViewer.exe") and
     not process.args : "ADSelfService_Enroll.hta"]

Stage 2: network

[network where host.os.type == "windows" and process.name : "mshta.exe"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • mshta.exe corpus 84 (elastic 80, splunk 4)
field:"process_basename" kind:wildcard value:"mshta.exe"

Exclusions

The rule actively suppresses these predicates.

New USB Storage Device Mounted

#
Status
production
Severity
low
Time window
9m
Group by
device.serial_number, host.id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies newly seen removable devices by device.serial_number and host.id using the Elastic Defend device mount events. While this activity is not inherently malicious, analysts can use those events to aid monitoring for data exfiltration over those devices.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/11/11"
integration = ["endpoint"]
maturity = "production"
min_stack_comments = "Changing min stack to 9.3.0, the latest minimum supported version for 9.X releases."
min_stack_version = "9.3.0"
updated_date = "2026/07/20"

[rule]
author = ["Elastic"]
description = """
Identifies newly seen removable devices by device.serial_number and host.id using the Elastic Defend device mount events. While this activity
is not inherently malicious, analysts can use those events to aid monitoring for data exfiltration over those devices.
"""
from = "now-9m"
index = ["logs-endpoint.events.device-*"]
language = "kuery"
license = "Elastic License v2"
name = "New USB Storage Device Mounted"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating New USB Storage Device Mounted

Removable devices, like USB drives, are common in Windows environments for data transfer. Adversaries exploit these to introduce malware or exfiltrate data, leveraging their plug-and-play nature. The detection rule monitors registry changes for new device names, signaling potential unauthorized access. By focusing on first-time-seen devices, it helps identify suspicious activities linked to data exfiltration or initial access attempts.

This detection uses Elastic Defend device control events, Device control helps protect your Windows and Mac endpoints from data loss, malware, and unauthorized access by managing which devices can connect to your computers. Specifically, it restricts which external USB storage devices can connect to hosts that have Elastic Defend installed.


### Possible investigation steps

- Review the device mount event details to confirm the presence of a new device by checking the device.serial_number.
- Check for any subsequent file access or transfer events involving the new device to assess potential data exfiltration.
- Investigate the device's history by searching for any previous connections to other systems within the network to determine if it has been used elsewhere.
- Analyze any related alerts or logs for additional context or suspicious activities linked to the device.

### False positive analysis

- Frequent use of company-issued USB drives for legitimate data transfer can trigger alerts. Maintain a list of approved devices and create exceptions for these in the monitoring system.
- Software updates or installations via USB drives may be flagged. Identify and whitelist known update devices or processes to prevent unnecessary alerts.
- IT department activities involving USB devices for maintenance or troubleshooting can appear suspicious. Coordinate with IT to log and exclude these routine operations from triggering alerts.
- Devices used for regular backups might be detected as new. Ensure backup devices are registered and excluded from the rule to avoid false positives.
- Personal USB devices used by employees for non-work-related purposes can cause alerts. Implement a policy for registering personal devices and exclude them if deemed non-threatening.

### Response and remediation

- Immediately isolate the affected host from the network to prevent potential data exfiltration or further spread of malware.
- Block the device by serial number using the relevant Elastic Defend Device Control policy.
- Conduct a thorough scan of the isolated host using updated antivirus and anti-malware tools to identify and remove any malicious software introduced via the removable device.
- If malicious activity is confirmed, collect and preserve relevant logs and evidence for further forensic analysis and potential legal action.
- Notify the security team and relevant stakeholders about the incident, providing details of the device and any identified threats.
- Implement a temporary block on the use of removable devices across the network until the threat is fully contained and remediated.
- Enhance monitoring and detection capabilities by updating security tools and rules to better identify similar threats in the future, focusing on registry changes and device connections."""
references = [
"https://www.elastic.co/docs/solutions/security/manage-elastic-defend/trusted-devices", 
"https://www.elastic.co/docs/solutions/security/configure-elastic-defend/configure-an-integration-policy-for-elastic-defend#device-control"
]
risk_score = 21
rule_id = "483832a8-ffdd-4e11-8e96-e0224f7bda9b"
severity = "low"
tags = [
    "Domain: Endpoint", 
    "OS: Windows",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Use Case: Device Control",
    "Tactic: Initial Access",
    "Tactic: Exfiltration",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:(macos or windows) and event.type:device and event.action:mount and event.outcome:success and volume.removable:true
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1091"
name = "Replication Through Removable Media"
reference = "https://attack.mitre.org/techniques/T1091/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1052"
name = "Exfiltration Over Physical Medium"
reference = "https://attack.mitre.org/techniques/T1052/"

[[rule.threat.technique.subtechnique]]
id = "T1052.001"
name = "Exfiltration over USB"
reference = "https://attack.mitre.org/techniques/T1052/001/"

[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1091"
name = "Replication Through Removable Media"
reference = "https://attack.mitre.org/techniques/T1091/"

[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[rule.new_terms]
field = "new_terms_fields"
value = ["device.serial_number", "host.id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

Stages and Predicates

Stage 1: new_terms

host.os.type:(macos or windows) and event.type:device and event.action:mount and event.outcome:success and volume.removable:true

Indicators

These rows show field, operator, and value matches.

Payload Piped to Script Interpreter

#
Time window
10s
Sequence by
process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Detects when a script interpreter executes via a shell (sh, bash, zsh) or osascript with only a single argument, being the process name and followed immediately by a network connection. This activity occurs when script code gets piped to the interpreter via a shell and that code is intended to reach out to an external destination like a C2 server.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when a script interpreter executes via a shell (sh, bash, zsh) or osascript with only a single argument, being
the process name and followed immediately by a network connection. This activity occurs when script code gets piped to
the interpreter via a shell and that code is intended to reach out to an external destination like a C2 server.
"""
id = "e413073c-4d6b-40d4-9ef1-b4de22d137d3"
license = "Elastic License v2"
name = "Payload Piped to Script Interpreter"
os_list = ["macos"]
reference = ["https://github.com/nnsee/fileless-elf-exec"]
version = "1.0.14"

query = '''
sequence by process.parent.entity_id with maxspan=10s
[process where event.type == "start" and event.action == "exec" and
  process.name like~ ("zsh", "sh", "bash", "python*", "terminal") and
  process.args == "-c" and
  (
    process.command_line : ("*curl*|*", "*nscurl*|*", "*wget*|*", "*osascript*|*",
                            "*/dev/tcp/*", "*base64*|*", "*openssl*|*", "*nc *|*") or
    process.command_line : ("*curl*>*", "*wget*>*") or
    process.command_line : "*http*|*"
  )]
[process where event.type == "start" and event.action == "exec" and 
  process.name like~ ("python*", "perl*", "ruby*", "osascript") and
  process.parent.name in ("sh", "bash", "zsh", "osascript") and 
  process.args like~ ("python*", "perl*", "ruby*", "osascript") and 
  process.args_count == 1]
'''

min_endpoint_version = "8.3.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"

[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "8.3.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 10s, correlated by process.parent.entity_id.

Stage 1: process

[process where event.type == "start" and event.action == "exec" and
  process.name like~ ("zsh", "sh", "bash", "python*", "terminal") and
  process.args == "-c" and
  (
    process.command_line : ("*curl*|*", "*nscurl*|*", "*wget*|*", "*osascript*|*",
                            "*/dev/tcp/*", "*base64*|*", "*openssl*|*", "*nc *|*") or
    process.command_line : ("*curl*>*", "*wget*>*") or
    process.command_line : "*http*|*"
  )]

Stage 2: process

[process where event.type == "start" and event.action == "exec" and 
  process.name like~ ("python*", "perl*", "ruby*", "osascript") and
  process.parent.name in ("sh", "bash", "zsh", "osascript") and 
  process.args like~ ("python*", "perl*", "ruby*", "osascript") and 
  process.args_count == 1]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • -c corpus 91 (elastic 91)
field:"process.args" kind:eq value:"-c"
process.argswildcard
  • osascript corpus 2 (elastic 2)
  • perl* corpus 4 (elastic 4)
  • python* corpus 7 (elastic 7)
  • ruby* corpus 4 (elastic 4)
field:"process.args" kind:wildcard
process.args_counteq
  • 1 transforms: number corpus 50 (elastic 50)
field:"process.args_count" kind:eq value:"1"
process.command_linewildcard
  • */dev/tcp/* corpus 4 (elastic 4)
  • *base64*|*
  • *curl*>*
  • *curl*|*
  • *http*|*
  • *nc *|*
  • *nscurl*|*
  • *openssl*|*
  • *osascript*|*
  • *wget*>*
  • *wget*|*
field:"CommandLine" kind:wildcard
process.namewildcard
  • bash corpus 33 (elastic 33)
  • osascript corpus 31 (elastic 31)
  • perl* corpus 22 (elastic 22)
  • python* corpus 51 (elastic 51)
  • ruby* corpus 19 (elastic 19)
  • sh corpus 33 (elastic 33)
  • terminal corpus 3 (elastic 3)
  • zsh corpus 31 (elastic 31)
field:"process_basename" kind:wildcard
process.parent.namein
  • bash corpus 60 (elastic 60)
  • osascript corpus 9 (elastic 9)
  • sh corpus 60 (elastic 60)
  • zsh corpus 60 (elastic 60)
field:"parent_process_basename" kind:in

Potential Enumeration via Active Directory Web Service

#
Status
production
Severity
medium
Time window
3m
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies processes loading Active Directory related modules followed by a network connection to the ADWS dedicated TCP port. Adversaries may abuse the ADWS Windows service that allows Active Directory to be queried via this web service.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/01/31"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies processes loading Active Directory related modules followed by a network connection to the ADWS dedicated TCP
port. Adversaries may abuse the ADWS Windows service that allows Active Directory to be queried via this web service.
"""
from = "now-9m"
index = ["logs-endpoint.events.library-*", "logs-endpoint.events.network-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Enumeration via Active Directory Web Service"
references = ["https://github.com/FalconForceTeam/SOAPHound"]
risk_score = 47
rule_id = "9c951837-7d13-4b0c-be7a-f346623c8795"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence by process.entity_id with maxspan=3m
 [library where host.os.type == "windows" and
  dll.name : ("System.DirectoryServices*.dll", "System.IdentityModel*.dll") and
  not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
  not process.executable :
                ("?:\\windows\\system32\\dsac.exe",
                 "?:\\program files\\powershell\\?\\pwsh.exe",
                 "?:\\windows\\system32\\windowspowershell\\*.exe",
                 "?:\\windows\\syswow64\\windowspowershell\\*.exe",
                 "?:\\program files\\microsoft monitoring agent\\*.exe",
                 "?:\\windows\\adws\\microsoft.activedirectory.webservices.exe")]
 [network where host.os.type == "windows" and destination.port == 9389 and source.port >= 49152 and
  network.direction == "egress" and network.transport == "tcp" and not cidrmatch(destination.ip, "127.0.0.0/8", "::1/128")]
'''

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend
"""

note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Potential Enumeration via Active Directory Web Service

Active Directory Web Service (ADWS) facilitates querying Active Directory (AD) over a network, providing a web-based interface for directory services. Adversaries may exploit ADWS to enumerate network resources and user accounts, gaining insights into the environment. The detection rule identifies suspicious activity by monitoring processes that load AD-related modules and establish network connections to the ADWS port, indicating potential unauthorized enumeration attempts.

### Possible investigation steps

- Review the process entity ID to identify the specific process that triggered the alert and gather details such as the process name, executable path, and user context.
- Examine the user ID associated with the process to determine if it belongs to a legitimate user or service account, and verify if the user has a history of accessing Active Directory resources.
- Investigate the network connection details, focusing on the destination IP address and port 9389, to identify the target server and assess if it is a legitimate Active Directory Web Service endpoint.
- Check for any recent changes or unusual activity on the host machine, such as new software installations or configuration changes, that could explain the loading of Active Directory-related modules.
- Correlate the alert with other security events or logs from the same timeframe to identify any patterns or additional suspicious activities that might indicate a broader attack or reconnaissance effort.

### False positive analysis

- Legitimate administrative tools or scripts may load Active Directory-related modules and connect to the ADWS port. To handle this, create exceptions for known administrative processes that regularly perform these actions.
- Scheduled tasks or automated scripts running under service accounts might trigger the rule. Identify these tasks and exclude their associated user IDs or process paths from the detection rule.
- Security or monitoring software that queries Active Directory for legitimate purposes can cause false positives. Review and whitelist these applications by adding their executable paths to the exclusion list.
- Development or testing environments where developers frequently interact with Active Directory services may generate alerts. Consider excluding specific user IDs or process paths associated with these environments to reduce noise.
- Ensure that any exceptions or exclusions are regularly reviewed and updated to reflect changes in the environment or administrative practices.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes identified in the alert that are loading Active Directory-related modules and making network connections to the ADWS port.
- Conduct a thorough review of the affected system's user accounts and permissions to identify any unauthorized changes or access.
- Reset credentials for any accounts that were potentially compromised or used in the suspicious activity.
- Implement network segmentation to limit access to the ADWS port (9389) to only trusted systems and users.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Update and enhance monitoring rules to detect similar enumeration attempts in the future, focusing on unusual process behavior and network connections to critical services."""


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1018"
name = "Remote System Discovery"
reference = "https://attack.mitre.org/techniques/T1018/"

[[rule.threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"

[[rule.threat.technique.subtechnique]]
id = "T1069.002"
name = "Domain Groups"
reference = "https://attack.mitre.org/techniques/T1069/002/"

[[rule.threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"

[[rule.threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"

[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"

Stages and Predicates

Ordered sequence: each step below must occur in order within 3m, correlated by process.entity_id.

Stage 1: library

[library where host.os.type == "windows" and
  dll.name : ("System.DirectoryServices*.dll", "System.IdentityModel*.dll") and
  not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
  not process.executable :
                ("?:\\windows\\system32\\dsac.exe",
                 "?:\\program files\\powershell\\?\\pwsh.exe",
                 "?:\\windows\\system32\\windowspowershell\\*.exe",
                 "?:\\windows\\syswow64\\windowspowershell\\*.exe",
                 "?:\\program files\\microsoft monitoring agent\\*.exe",
                 "?:\\windows\\adws\\microsoft.activedirectory.webservices.exe")]

Stage 2: network

[network where host.os.type == "windows" and destination.port == 9389 and source.port >= 49152 and
  network.direction == "egress" and network.transport == "tcp" and not cidrmatch(destination.ip, "127.0.0.0/8", "::1/128")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.porteq
  • 9389 transforms: number
field:"DestinationPort" kind:eq value:"9389"
dll.namewildcard
  • System.DirectoryServices*.dll corpus 2 (elastic 2)
  • System.IdentityModel*.dll
field:"dll.name" kind:wildcard
network.directioneq
  • egress corpus 13 (elastic 13)
field:"Initiated" kind:eq value:"egress"
network.transporteq
  • tcp corpus 16 (elastic 16)
field:"Protocol" kind:eq value:"tcp"
source.portge
  • 49152 transforms: number corpus 16 (elastic 16)
field:"SourcePort" kind:ge value:"49152"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\windows\system32\dsac.exe, ?:\program files\powershell\?\pwsh.exe, ?:\windows\system32\windowspowershell\*.exe, ?:\windows\syswow64\windowspowershell\*.exe, ?:\program files\microsoft monitoring agent\*.exe, ?:\windows\adws\microsoft.activedirectory.webservices.exeexcludes:process.executable
user.idinS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
destination.ipcidr_match127.0.0.0/8, ::1/128excludes:destination.ip field:"destination.ip" value:"127.0.0.0/8" field:"destination.ip" value:"::1/128"

Potential Privilege Escalation via Linux DAC permissions

#
Status
production
Severity
low
Time window
9m
Group by
process.name
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies potential privilege escalation exploitation of DAC (Discretionary access control) file permissions. The rule identifies exploitation of DAC checks on sensitive file paths via suspicious processes whose capabilities include CAP_DAC_OVERRIDE (where a process can bypass all read write and execution checks) or CAP_DAC_READ_SEARCH (where a process can read any file or perform any executable permission on the directories).

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/01/08"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies potential privilege escalation exploitation of DAC (Discretionary access control) file permissions. The rule
identifies exploitation of DAC checks on sensitive file paths via suspicious processes whose capabilities include
CAP_DAC_OVERRIDE (where a process can bypass all read write and execution checks) or CAP_DAC_READ_SEARCH (where a
process can read any file or perform any executable permission on the directories).
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License v2"
name = "Potential Privilege Escalation via Linux DAC permissions"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Potential Privilege Escalation via Linux DAC permissions

Linux Discretionary Access Control (DAC) allows file owners to set permissions, potentially leading to privilege escalation if misconfigured. Adversaries exploit DAC by using processes with capabilities like CAP_DAC_OVERRIDE to bypass permission checks. The detection rule identifies suspicious processes accessing sensitive files, excluding benign activities, to flag potential misuse of DAC permissions.

### Possible investigation steps

- Review the process command line to identify the specific command executed and determine if it involves sensitive files like sudoers, passwd, shadow, or directories under /root/.
- Check the user ID associated with the process to verify if it is a non-root user attempting to access or modify sensitive files.
- Investigate the process name and executable path to ensure it is not part of the excluded benign processes or paths, such as tar, getent, or /usr/lib/*/lxc/rootfs/*.
- Analyze the parent process name to determine if it is a known benign parent like dpkg or gnome-shell, which might indicate a legitimate operation.
- Examine the process thread capabilities, specifically CAP_DAC_OVERRIDE or CAP_DAC_READ_SEARCH, to understand the level of access the process has and assess if it aligns with expected behavior for the user or application.
- Correlate the event with other logs or alerts to identify any patterns or sequences of activities that might indicate a broader attack or misconfiguration issue.

### False positive analysis

- Processes like "tar", "getent", "su", and others listed in the rule are known to perform legitimate operations on sensitive files. Exclude these processes from triggering alerts by adding them to the exception list in the detection rule.
- System management tools such as "dpkg" and "podman" may access sensitive files during routine operations. Consider excluding these tools if they are part of regular system maintenance activities.
- Processes running under user ID "0" (root) are often legitimate and necessary for system operations. Ensure that these are excluded from alerts to avoid unnecessary noise.
- Executables located in paths like /usr/lib/*/lxc/rootfs/* are typically part of containerized environments and may not pose a threat. Exclude these paths if they are part of your standard infrastructure.
- Parent processes such as "java" or those with names ending in "postinst" may be involved in legitimate software installations or updates. Review and exclude these if they are part of expected system behavior.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes identified by the detection rule, especially those with CAP_DAC_OVERRIDE or CAP_DAC_READ_SEARCH capabilities accessing sensitive files.
- Conduct a thorough review of the affected system's user accounts and permissions to identify and revoke any unauthorized privilege escalations.
- Restore any modified or compromised sensitive files, such as /etc/passwd or /etc/shadow, from a known good backup.
- Implement additional monitoring on the affected system to detect any further attempts at privilege escalation or unauthorized access.
- Escalate the incident to the security operations team for a comprehensive investigation to determine the root cause and potential impact.
- Apply security patches and updates to the affected system to mitigate any known vulnerabilities that could be exploited for privilege escalation."""
risk_score = 21
rule_id = "f7c70f2e-4616-439c-85ac-5b98415042fe"
setup = """## Setup


This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic 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.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- 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).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- 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.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:process and host.os.type:linux and event.type:start and event.action:exec and
(process.thread.capabilities.permitted:CAP_DAC_* or process.thread.capabilities.effective: CAP_DAC_*) and
process.command_line:(*/etc/sudoers* or */etc/passwd* or */etc/shadow* or */root/.ssh/* or /home/*/.ssh/*) and not (
  user.id : "0" or
  process.name : (
    "tar" or "getent" or "su" or "stat" or "dirname" or "chown" or "sudo" or "dpkg-split" or "dpkg-deb" or "dpkg" or
    "podman" or "awk" or "passwd" or "dpkg-maintscript-helper" or "mutt_dotlock" or "nscd" or "logger" or "gpasswd"
  ) or
  process.executable : /usr/lib/*/lxc/rootfs/* or
  process.parent.name : (
    "dpkg" or "java" or *postinst or "dpkg-preconfigure" or "gnome-shell"
  ) or
  process.parent.executable:(
    "/opt/microsoft/mdatp/sbin/wdavdaemon" or "/usr/bin/podman" or "/bin/podman" or
    /var/lib/awx/.local/share/containers/storage/overlay/* or ./merged/var/lib/awx/.local/share/containers/storage/overlay/* or
    "/var/ossec/bin/wazuh-modulesd" or /home/*/.local/share/containers/storage/overlay/* or /snap/* or /dev/fd/* or /tmp/newroot/* or
    "/usr/bin/google_guest_agent" or /var/lib/docker/overlay2/* or /var/lib/containers/* or "/usr/bin/gcc" or "/usr/bin/make" or "/usr/bin/ninja"
  ) or
  process.parent.command_line:(*ansible* or "runc init")
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"

[[rule.threat.technique.subtechnique]]
id = "T1003.008"
name = "/etc/passwd and /etc/shadow"
reference = "https://attack.mitre.org/techniques/T1003/008/"

[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"

[[rule.threat.technique.subtechnique]]
id = "T1552.004"
name = "Private Keys"
reference = "https://attack.mitre.org/techniques/T1552/004/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.name"]

[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"

Stages and Predicates

Stage 1: new_terms

event.category:process and host.os.type:linux and event.type:start and event.action:exec and
(process.thread.capabilities.permitted:CAP_DAC_* or process.thread.capabilities.effective: CAP_DAC_*) and
process.command_line:(*/etc/sudoers* or */etc/passwd* or */etc/shadow* or */root/.ssh.ssh/*) and not (
  user.id : "0" or
  process.name : (
    "tar" or "getent" or "su" or "stat" or "dirname" or "chown" or "sudo" or "dpkg-split" or "dpkg-deb" or "dpkg" or
    "podman" or "awk" or "passwd" or "dpkg-maintscript-helper" or "mutt_dotlock" or "nscd" or "logger" or "gpasswd"
  ) or
  process.executable : /usr/lib/*/lxc/rootfs/* or
  process.parent.name : (
    "dpkg" or "java" or *postinst or "dpkg-preconfigure" or "gnome-shell"
  ) or
  process.parent.executable:(
    "/opt/microsoft/mdatp/sbin/wdavdaemon" or "/usr/bin/podman" or "/bin/podman" or
    /var/lib/awx/.local/share/containers/storage/overlay/* or ./merged/var/lib/awx/.local/share/containers/storage/overlay/* or
    "/var/ossec/bin/wazuh-modulesd" or /home/*/.local/share/containers/storage/overlay/* or /snap/* or /dev/fd/* or /tmp/newroot/* or
    "/usr/bin/google_guest_agent" or /var/lib/docker/overlay2/* or /var/lib/containers/* or "/usr/bin/gcc" or "/usr/bin/make" or "/usr/bin/ninja"
  ) or
  process.parent.command_line:(*ansible* or "runc init")
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard/usr/lib/*/lxc/rootfs/*excludes:process.executable field:"process.executable" value:"/usr/lib/*/lxc/rootfs/*"
process.nameinawk, chown, dirname, dpkg, dpkg-deb, dpkg-maintscript-helper, dpkg-split, getent, gpasswd, logger, mutt_dotlock, nscd, passwd, podman, stat, su, sudo, tarexcludes:process.name
process.parent.command_lineeqrunc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"runc init"
process.parent.command_linematchansibleexcludes:process.parent.command_line field:"process.parent.command_line" value:"ansible"
process.parent.executableeq/bin/podmanexcludes:process.parent.executable field:"process.parent.executable" value:"/bin/podman"
process.parent.executableeq/opt/microsoft/mdatp/sbin/wdavdaemonexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/microsoft/mdatp/sbin/wdavdaemon"
process.parent.executableeq/usr/bin/gccexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/gcc"
process.parent.executableeq/usr/bin/google_guest_agentexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/google_guest_agent"
process.parent.executableeq/usr/bin/makeexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/make"
process.parent.executableeq/usr/bin/ninjaexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/ninja"
process.parent.executableeq/usr/bin/podmanexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/podman"
process.parent.executableeq/var/ossec/bin/wazuh-modulesdexcludes:process.parent.executable field:"process.parent.executable" value:"/var/ossec/bin/wazuh-modulesd"
process.parent.executablestarts_with./merged/var/lib/awx/.local/share/containers/storage/overlay/excludes:process.parent.executable field:"process.parent.executable" value:"./merged/var/lib/awx/.local/share/containers/storage/overlay/"
process.parent.executablestarts_with/dev/fd/excludes:process.parent.executable field:"process.parent.executable" value:"/dev/fd/"
process.parent.executablestarts_with/snap/excludes:process.parent.executable field:"process.parent.executable" value:"/snap/"
process.parent.executablestarts_with/tmp/newroot/excludes:process.parent.executable field:"process.parent.executable" value:"/tmp/newroot/"
process.parent.executablestarts_with/var/lib/awx/.local/share/containers/storage/overlay/excludes:process.parent.executable field:"process.parent.executable" value:"/var/lib/awx/.local/share/containers/storage/overlay/"
process.parent.executablestarts_with/var/lib/containers/excludes:process.parent.executable field:"process.parent.executable" value:"/var/lib/containers/"
process.parent.executablestarts_with/var/lib/docker/overlay2/excludes:process.parent.executable field:"process.parent.executable" value:"/var/lib/docker/overlay2/"
process.parent.executablewildcard/home/*/.local/share/containers/storage/overlay/*excludes:process.parent.executable field:"process.parent.executable" value:"/home/*/.local/share/containers/storage/overlay/*"
process.parent.nameends_withpostinstexcludes:process.parent.name field:"process.parent.name" value:"postinst"
process.parent.nameeqdpkgexcludes:process.parent.name field:"process.parent.name" value:"dpkg"
process.parent.nameeqdpkg-preconfigureexcludes:process.parent.name field:"process.parent.name" value:"dpkg-preconfigure"
process.parent.nameeqgnome-shellexcludes:process.parent.name field:"process.parent.name" value:"gnome-shell"
process.parent.nameeqjavaexcludes:process.parent.name field:"process.parent.name" value:"java"
user.ideq0excludes:user.id field:"user.id" value:"0"

Potential Privilege Escalation via OverlayFS

#
Time window
5s
Sequence by
process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Identifies an attempt to exploit a local privilege escalation (CVE-2023-2640 and CVE-2023-32629) via a flaw in Ubuntu's modifications to OverlayFS. These flaws allow the creation of specialized executables, which, upon execution, grant the ability to escalate privileges to root on the affected machine.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[rule]
description = """
Identifies an attempt to exploit a local privilege escalation (CVE-2023-2640 and CVE-2023-32629) via a flaw in Ubuntu's
modifications to OverlayFS. These flaws allow the creation of specialized executables, which, upon execution, grant the
ability to escalate privileges to root on the affected machine.
"""
id = "ca9de348-a09d-4c67-af21-5645b70003d0"
license = "Elastic License v2"
name = "Potential Privilege Escalation via OverlayFS"
os_list = ["linux"]
reference = [
    "https://www.wiz.io/blog/ubuntu-overlayfs-vulnerability",
    "https://twitter.com/liadeliyahu/status/1684841527959273472",
]
version = "1.0.9"

query = '''
sequence by process.parent.entity_id with maxspan=5s
  [process where event.action == "exec" and event.type == "start" and 
    process.name == "unshare" and process.args in ("-r", "-rm", "-m") and process.args : "*cap_setuid*"  and user.id != 0]
  [process where event.action == "uid_change" and event.type == "change" and user.id == 0]
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by process.parent.entity_id.

Stage 1: process

[process where event.action == "exec" and event.type == "start" and 
    process.name == "unshare" and process.args in ("-r", "-rm", "-m") and process.args : "*cap_setuid*"  and user.id != 0]

Stage 2: process

[process where event.action == "uid_change" and event.type == "change" and user.id == 0]

Indicators

These rows show field, operator, and value matches.

Potential Privilege Escalation via TCC bypass with fake TCC.db

#
Source
github.com/elastic/protections-artifacts

Identifies the creation of an alternate or fake TCC database potentially containing rogue macOS privacy preferences. The creation of another TCC database should not occur normally in any circumstance and should be considered highly suspicious.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the creation of an alternate or fake TCC database potentially containing rogue macOS privacy preferences. The
creation of another TCC database should not occur normally in any circumstance and should be considered highly
suspicious.
"""
id = "8446b30d-a9c4-4646-8261-979c06edd0ff"
license = "Elastic License v2"
name = "Potential Privilege Escalation via TCC bypass with fake TCC.db"
os_list = ["macos"]
reference = [
    "https://www.elastic.co/security-labs/inital-research-of-jokerspy",
    "https://www.microsoft.com/security/blog/2022/01/10/new-macos-vulnerability-powerdir-could-lead-to-unauthorized-user-data-access/",
]
version = "1.0.36"

query = '''
file where file.name : "TCC.db" and 
process.executable != null and not
event.action in ("open", "deletion") and
not process.code_signature.team_id == "UBF8T346G9" and
not process.executable like~ (
  "/Applications/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/Support/tccd",
  "/System/Library/PrivateFrameworks/TCC.framework/*",
  "/usr/bin/sysdiagnose",
  "/Applications/FortiClient.app/Contents/MacOS/FortiClient",
  "/Applications/MosyleSecurity.app/Contents/MacOS/MosyleSecurity",
  "/Applications/*/iOS.simruntime/*/System/Library/PrivateFrameworks/TCC.framework/tccd",
  "/Users/*/Downloads/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/tccd",
  "/Library/Developer/CoreSimulator/*",
  "/System/Library/Frameworks/FileProvider.framework/XPCServices/ArchiveService.xpc/Contents/MacOS/ArchiveService",
  "/System/Library/PrivateFrameworks/SystemMigration.framework/Versions/A/Resources/systemmigrationd",
  "/Applications/FortiClient.app/Contents/Frameworks/FortiClient Helper (Renderer).app/Contents/MacOS/FortiClient Helper (Renderer)",
  "/usr/libexec/xpcproxy", "/sbin/launchd") and 
not file.path like "/Volumes/*" and
not (event.action == "modification" and file.path like "/Users/*/Library/Application Support/com.apple.TCC/TCC.db" and not file.path like "/Users/*/*/Library/*") and
not file.path like
                ("/Users/*/Library/Developer/CoreSimulator/Devices/*/data/Library/TCC/TCC.db",
                 "/Users/*/Library/Developer/Xcode/UserData/Previews/Simulator Devices/*/data/Library/TCC/TCC.db",
                 "/private/var/folders/*/com.apple.desktopservices.ArchiveService/TemporaryItems/NSIRD_ArchiveService_*/logs/Accessibility/TCC.db")
'''

min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.006"
name = "TCC Manipulation"
reference = "https://attack.mitre.org/techniques/T1548/006/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: file

file where file.name : "TCC.db" and 
process.executable != null and not
event.action in ("open", "deletion") and
not process.code_signature.team_id == "UBF8T346G9" and
not process.executable like~ (
  "/Applications/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/Support/tccd",
  "/System/Library/PrivateFrameworks/TCC.framework/*",
  "/usr/bin/sysdiagnose",
  "/Applications/FortiClient.app/Contents/MacOS/FortiClient",
  "/Applications/MosyleSecurity.app/Contents/MacOS/MosyleSecurity",
  "/Applications/*/iOS.simruntime/*/System/Library/PrivateFrameworks/TCC.framework/tccd",
  "/Users/*/Downloads/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/tccd",
  "/Library/Developer/CoreSimulator/*",
  "/System/Library/Frameworks/FileProvider.framework/XPCServices/ArchiveService.xpc/Contents/MacOS/ArchiveService",
  "/System/Library/PrivateFrameworks/SystemMigration.framework/Versions/A/Resources/systemmigrationd",
  "/Applications/FortiClient.app/Contents/Frameworks/FortiClient Helper (Renderer).app/Contents/MacOS/FortiClient Helper (Renderer)",
  "/usr/libexec/xpcproxy", "/sbin/launchd") and 
not file.path like "/Volumes/*" and
not (event.action == "modification" and file.path like "/Users/*/Library/Application Support/com.apple.TCC/TCC.db" and not file.path like "/Users/*/*/Library/*") and
not file.path like
                ("/Users/*/Library/Developer/CoreSimulator/Devices/*/data/Library/TCC/TCC.db",
                 "/Users/*/Library/Developer/Xcode/UserData/Previews/Simulator Devices/*/data/Library/TCC/TCC.db",
                 "/private/var/folders/*/com.apple.desktopservices.ArchiveService/TemporaryItems/NSIRD_ArchiveService_*/logs/Accessibility/TCC.db")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard/Users/*/*/Library/*excludes:file.path field:"file.path" value:"/Users/*/*/Library/*"
event.actioneqmodificationexcludes:event.action field:"event.action" value:"modification"
file.pathwildcard/Users/*/Library/Application Support/com.apple.TCC/TCC.dbexcludes:file.path field:"file.path" value:"/Users/*/Library/Application Support/com.apple.TCC/TCC.db"
event.actionindeletion, openexcludes:event.action field:"event.action" value:"deletion" field:"event.action" value:"open"
file.pathstarts_with/Volumes/excludes:file.path field:"file.path" value:"/Volumes/"
file.pathwildcard/Users/*/Library/Developer/CoreSimulator/Devices/*/data/Library/TCC/TCC.db, /Users/*/Library/Developer/Xcode/UserData/Previews/Simulator Devices/*/data/Library/TCC/TCC.db, /private/var/folders/*/com.apple.desktopservices.ArchiveService/TemporaryItems/NSIRD_ArchiveService_*/logs/Accessibility/TCC.dbexcludes:file.path field:"file.path" value:"/Users/*/Library/Developer/CoreSimulator/Devices/*/data/Library/TCC/TCC.db" field:"file.path" value:"/Users/*/Library/Developer/Xcode/UserData/Previews/Simulator Devices/*/data/Library/TCC/TCC.db" field:"file.path" value:"/private/var/folders/*/com.apple.desktopservices.ArchiveService/TemporaryItems/NSIRD_ArchiveService_*/logs/Accessibility/TCC.db"
process.code_signature.team_ideqUBF8T346G9excludes:process.code_signature.team_id field:"process.code_signature.team_id" value:"UBF8T346G9"
process.executablewildcard/Applications/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/Support/tccd, /System/Library/PrivateFrameworks/TCC.framework/*, /usr/bin/sysdiagnose, /Applications/FortiClient.app/Contents/MacOS/FortiClient, /Applications/MosyleSecurity.app/Contents/MacOS/MosyleSecurity, /Applications/*/iOS.simruntime/*/System/Library/PrivateFrameworks/TCC.framework/tccd, /Users/*/Downloads/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/tccd, /Library/Developer/CoreSimulator/*, /System/Library/Frameworks/FileProvider.framework/XPCServices/ArchiveService.xpc/Contents/MacOS/ArchiveService, /System/Library/PrivateFrameworks/SystemMigration.framework/Versions/A/Resources/systemmigrationd, /Applications/FortiClient.app/Contents/Frameworks/FortiClient Helper (Renderer).app/Contents/MacOS/FortiClient Helper (Renderer), /usr/libexec/xpcproxy, /sbin/launchdexcludes:process.executable

Potential Redis Lua Use-After-Free RCE Attempt (CVE-2025-49844 / RediShell)

#
Status
production
Severity
critical
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects exploitation attempts targeting CVE-2025-49844 (RediShell), a CVSS 10.0 use-after-free vulnerability in the Redis Lua interpreter. An authenticated attacker sends an EVAL command containing a Lua script that calls string.rep() to create memory pressure and collectgarbage('collect') to force garbage collection, exploiting a use-after-free in the Lua parser to achieve remote code execution.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/06/11"
integration = ["network_traffic"]
maturity = "production"
updated_date = "2026/06/11"

[rule]
author = ["Elastic"]
description = """
This rule detects exploitation attempts targeting CVE-2025-49844 (RediShell), a CVSS 10.0 use-after-free
vulnerability in the Redis Lua interpreter. An authenticated attacker sends an EVAL command containing a Lua
script that calls string.rep() to create memory pressure and collectgarbage('collect') to force garbage
collection, exploiting a use-after-free in the Lua parser to achieve remote code execution.
"""
from = "now-9m"
index = ["logs-network_traffic.redis*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Redis Lua Use-After-Free RCE Attempt (CVE-2025-49844 / RediShell)"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Potential Redis Lua Use-After-Free RCE Attempt (CVE-2025-49844 / RediShell)

CVE-2025-49844 is a use-after-free in the Redis Lua interpreter. An authenticated attacker sends an EVAL command whose Lua script calls `string.rep()` to create memory pressure, then `collectgarbage('collect')` to force GC, triggering the use-after-free to achieve RCE. This rule matches on the `network_traffic.redis.query` field populated by the network_traffic (Packetbeat) Redis protocol module.

### Possible investigation steps

- Identify the source IP and determine whether it is a known trusted host or an internet address. Internet-exposed Redis (port 6379) with this pattern is almost certainly malicious.
- Confirm the destination Redis version. If unpatched (6.2.x branch: < 6.2.20; 7.2.x branch: < 7.2.11; 7.4.x branch: < 7.4.6; 8.0.x branch: < 8.0.4; 8.2.x branch: < 8.2.2), treat the alert as a high-confidence exploitation attempt.
- Review surrounding Redis commands (AUTH, CONFIG, SLAVEOF, DEBUG) from the same source IP for evidence of post-exploitation configuration tampering.
- Examine the destination host for evidence of reverse-shell establishment: outbound connections from the Redis process, new listening ports, or child process spawning (bash -i, nc, /dev/tcp patterns).
- Pivot to endpoint telemetry on the Redis host for process execution anomalies at or after the alert time.

### False positive analysis

- `string.rep()` and `collectgarbage('collect')` are valid Lua functions individually. Their deliberate combination inside a Redis EVAL is almost exclusively associated with CVE-2025-49844 or explicit security testing.
- Authorized penetration testing and vulnerability scanning against the CVE will trigger this rule. Validate against known scanner IPs and scheduled assessment windows before escalating.

### Response and remediation

- Immediately patch affected Redis instances: 6.2.x >= 6.2.20, 7.2.x >= 7.2.11, 7.4.x >= 7.4.6, 8.0.x >= 8.0.4, 8.2.x >= 8.2.2.
- Restrict Redis network access to trusted hosts only. Redis should never be directly reachable from the internet.
- Require authentication (`requirepass` or ACL) and rotate credentials if exploitation is suspected.
- If Lua scripting is not required, restrict EVAL via ACLs (`ACL SETUSER <user> -eval`).
- If successful exploitation is suspected, isolate the host, collect artifacts, and rotate all credentials stored in or accessible via Redis.
"""
references = [
    "https://nvd.nist.gov/vuln/detail/CVE-2025-49844",
    "https://redis.io/blog/redis-security-advisory-cve-2025-49844",
    "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
    "https://www.wiz.io/blog/pwn2own-berlin-2025-redis-cve-2025-49844",
]
risk_score = 99
rule_id = "9a1ba0ac-aa6f-4c0d-8c80-b7f6ea2efa36"
setup = """## Setup

This rule requires the Elastic **network_traffic** integration (Packetbeat via Elastic Agent) with the Redis
protocol module enabled. The rule matches on the `network_traffic.redis.query` field (keyword — human-readable command text) populated
for every Redis transaction; the raw wire bytes are available in `network_traffic.redis.request` (text) if
deeper inspection is needed.

### Enabling the Redis module

In the Elastic Agent `network_traffic` integration policy:
1. Add or confirm **Redis** in the protocols list with `enabled: true`.
2. Set **ports** to include `6379` (or the custom port your Redis instances listen on).
3. Deploy the sensor on the Redis host, on a SPAN/mirror port, or on a gateway that receives Redis traffic.

### TLS limitation — this rule only covers unencrypted Redis

Redis uses a plaintext protocol by default (port 6379, no TLS). Packetbeat can inspect the full request payload
on unencrypted connections, which is the configuration used by the vast majority of internet-exposed instances
(8,500+ vulnerable instances identified as of October 2025 were all unencrypted).

If TLS is configured for Redis (`tls-port`, `tls-cert-file`, and `tls-key-file` in redis.conf), Packetbeat cannot
inspect the payload without TLS decryption. For TLS-protected Redis deployments, supplement this rule with
endpoint detection (process command-line arguments, system call monitoring) on the Redis host itself.

"""
severity = "critical"
tags = [
    "Domain: Network",
    "Use Case: Threat Detection",
    "Use Case: Vulnerability",
    "Tactic: Initial Access",
    "Tactic: Execution",
    "Data Source: Network Packet Capture",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
network where data_stream.dataset == "network_traffic.redis" and
  network_traffic.redis.query like~ "*EVAL*" and
  network_traffic.redis.query like~ "*string.rep*" and
  network_traffic.redis.query like~ "*collectgarbage*"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.011"
name = "Lua"
reference = "https://attack.mitre.org/techniques/T1059/011/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

Stages and Predicates

Stage 1: network

network where data_stream.dataset == "network_traffic.redis" and
  network_traffic.redis.query like~ "*EVAL*" and
  network_traffic.redis.query like~ "*string.rep*" and
  network_traffic.redis.query like~ "*collectgarbage*"

Indicators

These rows show field, operator, and value matches.

RunDLL32 with Unusual Arguments

#
Source
github.com/elastic/protections-artifacts

Identifies unusual instances of RunDLL32 with suspicious keywords or paths in the process command line value. Adversaries may abuse rundll32.exe to proxy execution of malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies unusual instances of RunDLL32 with suspicious keywords or paths in the process command line value.
Adversaries may abuse rundll32.exe to proxy execution of malicious code.
"""
id = "cfaf983e-1129-464c-b0aa-270f42e20d3d"
license = "Elastic License v2"
name = "RunDLL32 with Unusual Arguments"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/dipping-into-danger",
    "https://www.elastic.co/security-labs/unmasking-financial-services-intrusion-ref0657",
    "https://www.elastic.co/security-labs/thawing-the-permafrost-of-icedid-summary",
]
version = "1.0.47"

query = '''
process where event.action == "start" and process.name : "rundll32.exe" and
  (
   /* suspicious extensions and paths */

   (process.command_line : "*\\AppData\\Local\\Temp\\*,*" and not process.command_line : "*.dll*") or
    process.command_line :
          ("*.jpg*,*",
           "*.png*,*",
           "*.gif*,*",
           "*.bmp*,*",
           "*.jpeg*,*",
           "*.TIFF*,*",
           "*.tmp*,*",
           "*.dat*,*",
           "*.txt*,*",
           "* ?:/*/*",
           "* ..\\*",
           "*:\\Users\\Public\\*,*",
           "*:\\Users\\*\\Documents\\*,*",
           "*:\\Users\\*\\Pictures\\*,*",
           "*:\\Users\\*\\Music\\*,*",
           "*:\\Windows\\Tasks\\*,*",
           "*:\\Windows\\System32\\tasks\\*,*",
           "*:\\Documents and Settings\\*,*",
           "*\\@SSL\\DavWWWRoot\\*",

           /* Issue #371 */
           "*.bin,*",
           "*.log,*",
           "*.nki,*",
           "*\\M?-*.dll,_run@*",
           "*%TEMP%\\*.cpl*",
           "*\\Users\\*\\Downloads\\*.cpl*",
           "*\\appdata\\roaming\\microsoft\\templates\\*,*",
           
           /* DLL exec by ordinal */
           "* #*", "*,#*") or
    process.command_line like "*rUNdlL32.eXe*" or

    /* fake Control_RunDLL export */
    (process.command_line : "*Control_RunDLL*" and not process.command_line : "*shell32.dll*Control_RunDLL*") or

    /* delayed execution */
    (process.parent.name : "cmd.exe" and process.parent.args : ("timeout", "ping", "choice") and process.parent.args : ("/nobreak", "/n", "/t")) or

    /* execution from temp with suspicious parent process tree */
    (process.command_line : "*\\AppData\\Local\\Temp\\*" and process.parent.name : ("wscript.exe", "cscript.exe", "wmiprvse.exe")) or

    /* suspicious parent powershell args */
    (process.parent.name : "powershell.exe" and
     process.parent.args : ("-enc", "IEX", "*wp-content*", "*wp-admin*", "*wp-includes*", "*$*$*$*$*$*", "*^*^*^*^*^*^*^*^*^*", "*.replace*") and
     not (process.args : "UpdatePerUserSystemParameters" and process.args : "USER32.DLL"))
    )

   /* False Positives */
   and not

  process.command_line :
           ("*JOBID=*",
            "*davclnt.dll,DavSetCookie*",
            "*PhotoViewer*ImageView_Fu*",
            "*url.dll,FileProtocolHandler*",
            "*zzzzInvokeManagedCustomActionOutOfProc*",
            "*,DeferredDelete*",
            "*:\\WINDOWS\\system32\\spool\\*",
            "*:\\Program Files (x86)\\*",
            "*:\\Program Files\\*",
            /* Issue #282 - FP */
            "*cryptext*CryptExt*",
            "*dfshim.dll*ShOpenVerbShortcut*",
            "*\\Documents\\DocuShare\\*",

            /* Issue #371 */
            "*ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile*",
            "*FirewallControlPanel.dll,ShowNotificationDialog*",
            "*--type=renderer*--log-file=*",
            "*--lang=*--log-file=*",
            "*--type=gpu-process*--user-data-dir=*",
            "*--type=gpu-process*--enable-chrome-runtime*",
            "*--type=gpu-process*--use-gl=*",
            
            "*shell32*OpenAs_RunDLL*",
            "*dfshim*ShOpenVerbExtension*",
            "*printui*PrintUIEntry*",
            "*mshtml*PrintHTML*",
            "*shell32*#44*",
            "*shell32.dll*ShellExec_RunDLL*#*",
            "*EDGEHTML*#*"
            ) and not
            
   (process.command_line : "*.tmp*" and
    process.parent.executable : ("?:\\Windows\\System32\\msiexec.exe", "?:\\Windows\\SysWOW64\\msiexec.exe") and
    process.parent.args : "-Embedding") and
  not process.args : "?:\\ProgramData\\Parallels\\RASLogs\\tmp*.tmp,StopMemshell" and
  not (process.args : "?:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_*\\acsnative.dll*" and
       process.parent.executable : "?:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_*\\acslaunch_*.exe") and
  not process.parent.executable :
              ("?:\\Program Files\\Common Files\\BullGuardInstall\\BullGuard*.exe",
               "?:\\Program Files (x86)\\Intuit\\QuickBooks 20??\\QBW??.EXE",
               "?:\\Program Files\\Intuit\\QuickBooks 2022\\QBW.EXE", 
               "C:\\Users\\Public (x86)\\Spectra\\temp\\smsx.exe") and
  not (user.name : "user" and process.args : "file.dll,#*") and
  not (process.name : "rundll32.exe" and process.args : "uxtheme.dll,#64" and process.args : "?:\\WINDOWS\\Resources\\Themes\\*") and 
  not process.parent.executable :
                         ("?:\\Program Files\\NVIDIA Corporation\\*.exe",
                          "?:\\Program Files (x86)\\Windows Media Components\\Encoder\\wmstypelib.exe",
                          "?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\AdobeCollabSync.exe") and
  not (process.name : "rundll32.exe" and
       process.args : ("dfshim.dll,ShArpMaintain",
                       "?:\\WINDOWS\\SYSTEM32\\MSHTML.dll,#125",
                       "dfshim.dll,ShOpenVerbApplication",
                       "?:\\WINDOWS\\System32\\shimgvw.dll,ImageView_PrintTo",
                       "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                       "?:\\Windows\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                       "c:\\EWDK??\\Program Files\\Microsoft Visual Studio\\*,#1",
                       "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper32.dll,#1", 
                       "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper64.dll,#1", 
                       "C:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_x86-64\\acsnative.dll,", 
                       "C:\\Windows\\TEMP\\*.tmp\\uninshlp.dll,DeleteExeAndDeleteSelf",
                       "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp\\BgInstallAssist.dll,RunDll_*",
                       "?:\\WINDOWS\\Installer\\MSI*.tmp*")) and
  not (process.name : "rundll32.exe" and
       process.args : "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp\\*" and
       process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp") and
  not (process.parent.executable : "?:\\Program Files*\\Splashtop\\Splashtop Remote\\Client for STB\\strwinclt.exe" and
       process.args : "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper64.dll,#1") and
  not (process.name : "rundll32.exe" and process.command_line :  "\"C:\\Windows\\System32\\rundll32.exe\" \"C:\\Users\\*\\AppData\\Local\\Temp\\GLF*.tmp\",RunDll32_KillDTG" and
       process.parent.name : "BelMonitor.exe") and
  not process.command_line : "rundll32.exe \"C:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper??.dll\",#1" and
  not (process.parent.code_signature.subject_name == "IDS Imaging Development Systems GmbH" and process.parent.code_signature.trusted == true) and
  not (process.parent.code_signature.subject_name == "Feitian Technologies Co., Ltd." and process.parent.code_signature.trusted == true)
'''

min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and process.name : "rundll32.exe" and
  (
   (process.command_line : "*\\AppData\\Local\\Temp\\*,*" and not process.command_line : "*.dll*") or
    process.command_line :
          ("*.jpg*,*",
           "*.png*,*",
           "*.gif*,*",
           "*.bmp*,*",
           "*.jpeg*,*",
           "*.TIFF*,*",
           "*.tmp*,*",
           "*.dat*,*",
           "*.txt*,*",
           "* ?:/*/*",
           "* ..\\*",
           "*:\\Users\\Public\\*,*",
           "*:\\Users\\*\\Documents\\*,*",
           "*:\\Users\\*\\Pictures\\*,*",
           "*:\\Users\\*\\Music\\*,*",
           "*:\\Windows\\Tasks\\*,*",
           "*:\\Windows\\System32\\tasks\\*,*",
           "*:\\Documents and Settings\\*,*",
           "*\\@SSL\\DavWWWRoot\\*",
           "*.bin,*",
           "*.log,*",
           "*.nki,*",
           "*\\M?-*.dll,_run@*",
           "*%TEMP%\\*.cpl*",
           "*\\Users\\*\\Downloads\\*.cpl*",
           "*\\appdata\\roaming\\microsoft\\templates\\*,*",
           "* #*", "*,#*") or
    process.command_line like "*rUNdlL32.eXe*" or
    (process.command_line : "*Control_RunDLL*" and not process.command_line : "*shell32.dll*Control_RunDLL*") or
    (process.parent.name : "cmd.exe" and process.parent.args : ("timeout", "ping", "choice") and process.parent.args : ("/nobreak", "/n", "/t")) or
    (process.command_line : "*\\AppData\\Local\\Temp\\*" and process.parent.name : ("wscript.exe", "cscript.exe", "wmiprvse.exe")) or
    (process.parent.name : "powershell.exe" and
     process.parent.args : ("-enc", "IEX", "*wp-content*", "*wp-admin*", "*wp-includes*", "*$*$*$*$*$*", "*^*^*^*^*^*^*^*^*^*", "*.replace*") and
     not (process.args : "UpdatePerUserSystemParameters" and process.args : "USER32.DLL"))
    )
   and not
  process.command_line :
           ("*JOBID=*",
            "*davclnt.dll,DavSetCookie*",
            "*PhotoViewer*ImageView_Fu*",
            "*url.dll,FileProtocolHandler*",
            "*zzzzInvokeManagedCustomActionOutOfProc*",
            "*,DeferredDelete*",
            "*:\\WINDOWS\\system32\\spool\\*",
            "*:\\Program Files (x86)\\*",
            "*:\\Program Files\\*",
            "*cryptext*CryptExt*",
            "*dfshim.dll*ShOpenVerbShortcut*",
            "*\\Documents\\DocuShare\\*",
            "*ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile*",
            "*FirewallControlPanel.dll,ShowNotificationDialog*",
            "*--type=renderer*--log-file=*",
            "*--lang=*--log-file=*",
            "*--type=gpu-process*--user-data-dir=*",
            "*--type=gpu-process*--enable-chrome-runtime*",
            "*--type=gpu-process*--use-gl=*",
            "*shell32*OpenAs_RunDLL*",
            "*dfshim*ShOpenVerbExtension*",
            "*printui*PrintUIEntry*",
            "*mshtml*PrintHTML*",
            "*shell32*#44*",
            "*shell32.dll*ShellExec_RunDLL*#*",
            "*EDGEHTML*#*"
            ) and not
   (process.command_line : "*.tmp*" and
    process.parent.executable : ("?:\\Windows\\System32\\msiexec.exe", "?:\\Windows\\SysWOW64\\msiexec.exe") and
    process.parent.args : "-Embedding") and
  not process.args : "?:\\ProgramData\\Parallels\\RASLogs\\tmp*.tmp,StopMemshell" and
  not (process.args : "?:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_*\\acsnative.dll*" and
       process.parent.executable : "?:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_*\\acslaunch_*.exe") and
  not process.parent.executable :
              ("?:\\Program Files\\Common Files\\BullGuardInstall\\BullGuard*.exe",
               "?:\\Program Files (x86)\\Intuit\\QuickBooks 20??\\QBW??.EXE",
               "?:\\Program Files\\Intuit\\QuickBooks 2022\\QBW.EXE",
               "C:\\Users\\Public (x86)\\Spectra\\temp\\smsx.exe") and
  not (user.name : "user" and process.args : "file.dll,#*") and
  not (process.name : "rundll32.exe" and process.args : "uxtheme.dll,#64" and process.args : "?:\\WINDOWS\\Resources\\Themes\\*") and
  not process.parent.executable :
                         ("?:\\Program Files\\NVIDIA Corporation\\*.exe",
                          "?:\\Program Files (x86)\\Windows Media Components\\Encoder\\wmstypelib.exe",
                          "?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\AdobeCollabSync.exe") and
  not (process.name : "rundll32.exe" and
       process.args : ("dfshim.dll,ShArpMaintain",
                       "?:\\WINDOWS\\SYSTEM32\\MSHTML.dll,#125",
                       "dfshim.dll,ShOpenVerbApplication",
                       "?:\\WINDOWS\\System32\\shimgvw.dll,ImageView_PrintTo",
                       "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                       "?:\\Windows\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                       "c:\\EWDK??\\Program Files\\Microsoft Visual Studio\\*,#1",
                       "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper32.dll,#1",
                       "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper64.dll,#1",
                       "C:\\Users\\Public\\IBM\\ClientSolutions\\Start_Programs\\Windows_x86-64\\acsnative.dll,",
                       "C:\\Windows\\TEMP\\*.tmp\\uninshlp.dll,DeleteExeAndDeleteSelf",
                       "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp\\BgInstallAssist.dll,RunDll_*",
                       "?:\\WINDOWS\\Installer\\MSI*.tmp*")) and
  not (process.name : "rundll32.exe" and
       process.args : "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp\\*" and
       process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\ns*.tmp") and
  not (process.parent.executable : "?:\\Program Files*\\Splashtop\\Splashtop Remote\\Client for STB\\strwinclt.exe" and
       process.args : "?:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper64.dll,#1") and
  not (process.name : "rundll32.exe" and process.command_line :  "\"C:\\Windows\\System32\\rundll32.exe\" \"C:\\Users\\*\\AppData\\Local\\Temp\\GLF*.tmp\",RunDll32_KillDTG" and
       process.parent.name : "BelMonitor.exe") and
  not process.command_line : "rundll32.exe \"C:\\ProgramData\\FastTrack Software\\Admin By Request\\ShellHelper??.dll\",#1" and
  not (process.parent.code_signature.subject_name == "IDS Imaging Development Systems GmbH" and process.parent.code_signature.trusted == true) and
  not (process.parent.code_signature.subject_name == "Feitian Technologies Co., Ltd." and process.parent.code_signature.trusted == true)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • * #*
  • * ..\* corpus 2 (elastic 2)
  • * ?:/*/* corpus 2 (elastic 2)
  • *%TEMP%\*.cpl*
  • *,#*
  • *.TIFF*,*
  • *.bin,*
  • *.bmp*,*
  • *.dat*,*
  • *.gif*,*
  • *.jpeg*,*
  • *.jpg*,*
  • *.log,*
  • *.nki,*
  • *.png*,*
  • *.tmp*,*
  • *.txt*,*
  • *:\Documents and Settings\*,*
  • *:\Users\*\Documents\*,*
  • *:\Users\*\Music\*,*
  • *:\Users\*\Pictures\*,*
  • *:\Users\Public\*,*
  • *:\Windows\System32\tasks\*,*
  • *:\Windows\Tasks\*,*
  • *Control_RunDLL* corpus 6 (sigma 3, splunk 2, elastic 1)
  • *\@SSL\DavWWWRoot\*
  • *\AppData\Local\Temp\* corpus 28 (sigma 26, elastic 2)
  • *\AppData\Local\Temp\*,*
  • *\M?-*.dll,_run@*
  • *\Users\*\Downloads\*.cpl*
  • *\appdata\roaming\microsoft\templates\*,*
  • *rUNdlL32.eXe*
field:"CommandLine" kind:wildcard
process.namewildcard
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
field:"process_basename" kind:wildcard value:"rundll32.exe"
process.parent.argswildcard
  • *$*$*$*$*$*
  • *.replace*
  • *^*^*^*^*^*^*^*^*^*
  • *wp-admin*
  • *wp-content*
  • *wp-includes*
  • -enc corpus 2 (elastic 2)
  • /n
  • /nobreak
  • /t
  • IEX
  • choice
  • ping
  • timeout
field:"process.parent.args" kind:wildcard
process.parent.namewildcard
  • cmd.exe corpus 37 (elastic 32, splunk 4, kusto 1)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • powershell.exe corpus 37 (elastic 35, splunk 1, kusto 1)
  • wmiprvse.exe corpus 24 (elastic 19, splunk 5)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq?:\ProgramData\FastTrack Software\Admin By Request\ShellHelper64.dll,#1excludes:process.args field:"process.args" value:"?:\ProgramData\FastTrack Software\Admin By Request\ShellHelper64.dll,#1"
process.parent.executablewildcard?:\Program Files*\Splashtop\Splashtop Remote\Client for STB\strwinclt.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files*\Splashtop\Splashtop Remote\Client for STB\strwinclt.exe"
process.argsequxtheme.dll,#64excludes:process.args field:"process.args" value:"uxtheme.dll,#64"
process.argsstarts_with?:\WINDOWS\Resources\Themes\excludes:process.args field:"process.args" value:"?:\WINDOWS\Resources\Themes\"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.argsstarts_withfile.dll,#excludes:process.args field:"process.args" value:"file.dll,#"
user.nameequserexcludes:user.name field:"user.name" value:"user"
process.argswildcard?:\Users\*\AppData\Local\Temp\ns*.tmp\*excludes:process.args field:"process.args" value:"?:\Users\*\AppData\Local\Temp\ns*.tmp\*"
process.parent.executablewildcard?:\Users\*\AppData\Local\Temp\ns*.tmpexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Temp\ns*.tmp"
process.argswildcard?:\Users\Public\IBM\ClientSolutions\Start_Programs\Windows_*\acsnative.dll*excludes:process.args field:"process.args" value:"?:\Users\Public\IBM\ClientSolutions\Start_Programs\Windows_*\acsnative.dll*"
process.parent.executablewildcard?:\Users\Public\IBM\ClientSolutions\Start_Programs\Windows_*\acslaunch_*.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\Public\IBM\ClientSolutions\Start_Programs\Windows_*\acslaunch_*.exe"
process.argswildcarddfshim.dll,ShArpMaintain, ?:\WINDOWS\SYSTEM32\MSHTML.dll,#125, dfshim.dll,ShOpenVerbApplication, ?:\WINDOWS\System32\shimgvw.dll,ImageView_PrintTo, ?:\Windows\System32\DriverStore\FileRepository\*, ?:\Windows\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification, c:\EWDK??\Program Files\Microsoft Visual Studio\*,#1, ?:\ProgramData\FastTrack Software\Admin By Request\ShellHelper32.dll,#1, ?:\ProgramData\FastTrack Software\Admin By Request\ShellHelper64.dll,#1, C:\Users\Public\IBM\ClientSolutions\Start_Programs\Windows_x86-64\acsnative.dll,, C:\Windows\TEMP\*.tmp\uninshlp.dll,DeleteExeAndDeleteSelf, ?:\Users\*\AppData\Local\Temp\ns*.tmp\BgInstallAssist.dll,RunDll_*, ?:\WINDOWS\Installer\MSI*.tmp*excludes:process.args
process.command_linematch.tmpexcludes:process.command_line field:"process.command_line" value:".tmp"
process.parent.argseq-Embeddingexcludes:process.parent.args field:"process.parent.args" value:"-Embedding"
process.parent.executableeq?:\Windows\System32\msiexec.exe, ?:\Windows\SysWOW64\msiexec.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\msiexec.exe" field:"process.parent.executable" value:"?:\Windows\SysWOW64\msiexec.exe"
process.command_linewildcard"C:\Windows\System32\rundll32.exe" "C:\Users\*\AppData\Local\Temp\GLF*.tmp",RunDll32_KillDTGexcludes:process.command_line
process.parent.nameeqBelMonitor.exeexcludes:process.parent.name field:"process.parent.name" value:"BelMonitor.exe"
process.parent.code_signature.subject_nameeqFeitian Technologies Co., Ltd.excludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"Feitian Technologies Co., Ltd."
process.parent.code_signature.trustedeqtrueexcludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true"
process.parent.code_signature.subject_nameeqIDS Imaging Development Systems GmbHexcludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"IDS Imaging Development Systems GmbH"
process.argswildcard?:\ProgramData\Parallels\RASLogs\tmp*.tmp,StopMemshellexcludes:process.args field:"process.args" value:"?:\ProgramData\Parallels\RASLogs\tmp*.tmp,StopMemshell"
process.command_lineeqrundll32.exe "C:\ProgramData\FastTrack Software\Admin By Request\ShellHelper??.dll",#1excludes:process.command_line
process.command_linewildcard*JOBID=*, *davclnt.dll,DavSetCookie*, *PhotoViewer*ImageView_Fu*, *url.dll,FileProtocolHandler*, *zzzzInvokeManagedCustomActionOutOfProc*, *,DeferredDelete*, *:\WINDOWS\system32\spool\*, *:\Program Files (x86)\*, *:\Program Files\*, *cryptext*CryptExt*, *dfshim.dll*ShOpenVerbShortcut*, *\Documents\DocuShare\*, *ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile*, *FirewallControlPanel.dll,ShowNotificationDialog*, *--type=renderer*--log-file=*, *--lang=*--log-file=*, *--type=gpu-process*--user-data-dir=*, *--type=gpu-process*--enable-chrome-runtime*, *--type=gpu-process*--use-gl=*, *shell32*OpenAs_RunDLL*, *dfshim*ShOpenVerbExtension*, *printui*PrintUIEntry*, *mshtml*PrintHTML*, *shell32*#44*, *shell32.dll*ShellExec_RunDLL*#*, *EDGEHTML*#*excludes:process.command_line
process.parent.executablewildcard?:\Program Files\Common Files\BullGuardInstall\BullGuard*.exe, ?:\Program Files (x86)\Intuit\QuickBooks 20??\QBW??.EXE, ?:\Program Files\Intuit\QuickBooks 2022\QBW.EXE, C:\Users\Public (x86)\Spectra\temp\smsx.exeexcludes:process.parent.executable
process.parent.executablewildcard?:\Program Files\NVIDIA Corporation\*.exe, ?:\Program Files (x86)\Windows Media Components\Encoder\wmstypelib.exe, ?:\Program Files\Adobe\Acrobat DC\Acrobat\AdobeCollabSync.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\NVIDIA Corporation\*.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\Windows Media Components\Encoder\wmstypelib.exe" field:"process.parent.executable" value:"?:\Program Files\Adobe\Acrobat DC\Acrobat\AdobeCollabSync.exe"

Scheduled Task Creation by an Unusual Process

#
Time window
5m
Sequence by
Effective_process.entity_id, process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the creation of a scheduled task by an unusual process such as script interpreters or recently dropped unsigned executables. This behavior is consistent with an adversary attempting to establish persistence.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the creation of a scheduled task by an unusual process such as script interpreters or recently dropped
unsigned executables. This behavior is consistent with an adversary attempting to establish persistence.
"""
id = "cb5fdbe3-84fa-4277-a967-1ffc0e8d3d25"
license = "Elastic License v2"
name = "Scheduled Task Creation by an Unusual Process"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/windows/win32/taskschd/daily-trigger-example--xml-",
    "https://www.elastic.co/security-labs/dipping-into-danger",
    "https://www.elastic.co/security-labs/spring-cleaning-with-latrodectus",
]
version = "1.0.44"

query = '''
sequence with maxspan=5m
   [process where event.action == "start" and
    (
     /* common initial access processes */
     process.name : ("wscript.exe", "cscript.exe", "regsvr32.exe", "mshta.exe", "rundll32.exe", "vbc.exe",
                     "msbuild.exe", "wmic.exe", "cmstp.exe", "RegAsm.exe", "installutil.exe","RegSvcs.exe",
                     "msxsl.exe", "xwizard.exe", "csc.exe", "winword.exe", "excel.exe", "powerpnt.exe",
                     "powershell.exe")  or

     (process.name : "javaw.exe" and process.args : "-jar" and process.args_count == 3 and
      process.args : ("?:\\Users\\*", "?:\\ProgramData\\*")) or

    /* unsigned or untrusted codesign */
    ((process.code_signature.trusted == false or process.code_signature.exists == false) and
      (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
      not process.code_signature.status : ("errorTimeStamp", "errorCode_endpoint*", "errorExpired", "errorChaining")) or

    /* common abused paths */
    (process.executable :
         ("?:\\Users\\Public\\*",
          "?:\\Users\\*\\AppData\\Roaming\\*",
          "?:\\ProgramData\\*",
          "?:\\Windows\\Microsoft.NET\\*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Rar*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*",
          "\\Device\\CdRom*") and not process.code_signature.trusted == true) or

    /* execution from a mounted device */
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*")
    ) and

    /* known FPs */
    not (process.name : "rundll32.exe" and process.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*" and process.parent.name : "msiexec.exe") and
    not (process.name : ("rundll32.exe", "regsvr32.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.code_signature.trusted == true and process.executable : ("?:\\Users\\*\\AppData\\Roaming\\*", "?:\\ProgramData\\*")) and
    not (process.name : "rundll32.exe" and process.args : "tsworkspace,TaskUpdateWorkspaces") and
    not (process.name : "rundll32.exe" and process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.command_line : "*pcrpf.dll,NotifyFirmwareUpdateStaged*") and
    not (process.executable : "\\Device\\Mup\\*\\OneDriveSetup.exe" and process.args : "/ALLUSERS") and
    not (process.name : "rundll32.exe" and
         process.command_line : ("*PWMTR32V.dll,InitializeSettingsDuringInstallation*", "*RunDll_EnableBits*")) and
    not (process.name : "powershell.exe" and
         process.command_line :
                   ("*:\\Program Files\\*", "*:\\Program Files (X86)\\*",
                    "*Packages\\Plugins\\Microsoft.AdminCenter.AdminCenter*",
                    "*:\\WINDOWS\\ccmcache\\*",
                    "*EEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBGADgAQQBjAHcA*",
                    "*UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAA*",
                    "*-EncodedCommand*",
                    "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" ")) and
    not (process.name : "powershell.exe" and
         process.parent.executable : ("?:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe",
                                      "?:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShellService.exe",
                                      "?:\\Program Files (x86)\\ITSPlatform\\plugin\\scripting\\platform-scripting-plugin.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe",
                                      "?:\\Program Files (x86)\\Lenovo\\VantageService\\*\\Lenovo.Vantage.AddinInstaller.exe",
                                      "?:\\ProgramData\\Lenovo\\LenovoNow\\Downloads\\LenovoNow.Updater.exe",
                                      "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoFirstRunExperiencePackage\\x86\\LenovoWelcomeTask.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\agentexecutor.exe",
                                      "C:\\Banyan\\Canopy\\Leaf\\leaf_desktop_app.exe",
                                      "?:\\windows\\system32\\msiexec.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe",
                                      "C:\\Windows\\CCM\\OSDRunPowerShellScript.exe",
                                      "C:\\Windows\\System32\\runonce.exe")) and
    not (process.name : "powershell.exe" and user.id : "S-1-5-18") and
    not (process.name : "powershell.exe" and process.parent.name : "powershell.exe" and process.parent.args : "-EncodedCommand" and process.parent.args : "cABvAHcAZQByAHMAaABlAGw*") and
    not (process.name : "powershell.exe" and process.args : ("-nomeAgente", "\\\\*\\*.ps1", "& 'C:\\oracle_unified_agent\\scripts\\unified-agent-permissions.ps1' ; exit $($LASTEXITCODE)")) and
    not (process.parent.name : "rundll32.exe" and process.parent.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*") and
    not (process.name : "rundll32.exe" and process.command_line : ("*zzzzInvokeManagedCustomActionOutOfProc*", "*tsworkspace,WorkspaceSilentSetup*")) and
    not process.executable :
                ("?:\\Program Files (x86)\\*.exe",
                 "?:\\Program Files\\*.exe",
                 "?:\\Windows\\SysWOW64\\OneDriveSetup.exe",
                 "?:\\Windows\\System32\\MRT.exe",
                 "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\Update\\OneDriveSetup.exe",
                 "C:\\Windows\\SystemTemp\\SupportAssistAgent\\*\\SupportAssistDeployment.exe") and
    /* DOCs opened from network file share trigger an office default scheduled task */
    not (process.name : ("winword.exe", "excel.exe", "powerpnt.exe") and not process.working_directory : "C:\\*") and
    not process.hash.sha256 :
                  ("3d95157908cee58d19193c93c5f2b0a06910b8123a4211b0ea059ff66f2506e0",
                   "79dbc3cf0d4cdc0f2150ab5e2bf3457ba54297202500f26f1a1d48e455f7c54a",
                   "62d96982e2c2d58682471af9a9d0727ba49199d48b7766c318886e8e7e23670a",
                   "ef330f95416162866f5d8b9cd509066ab4168cfcc66e305006be1952905d47e6",
                   "cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd",
                   "3c1169568774b7ce8a96e137983b059f030eb3983c369cfb12ea2c59cf3f56ad",
                   "edaf602006b53dc936a35d0f9e6de51c552c0203ebe814cb68b1d5cbc81f4b49",
                   "82c97648fa358c31fb47e44762938738ad3080880b84b69d9c303d708ab160c2",
                   "4aff93803f1915f3a10f19a1d1e065483c4d11221e3c2792b3de1807c7bf1d9a",
                   "f9e86b3a6275429f5dbecccc2020e498032a96fc02dd8bdb2a1cc5b5bf2b473b",
                   "7b20331e03018ca74f0212aff3d5a1a66e2375188691df56c9b2b89ba84ad38b",
                   "dc3bcf4dee3b8c3ca0062284f53e5f717085bd3f3ac6b1ac70492425a7cf2474",
                   "81fac89743d43b741a009541a9c365ed3213f49cf6314d9c50418ab0d9e82528",
                   "7d2c761823b183cd34a8c1c0b7b6f572d26a0265bfe65afe913faf60d27de844",
                   "f943329f6399ecd418268484bc61d98887b7fc8454c2409a79adc3b965ae75a0",
                   "ae27abffcc06755840792abb83a67b847782afa01bb26c2631671ed3932930b6",
                   "6af431b97e8571a2c072a746a44b5e0dcb3685268f75459e789063e03b7698cb",
                   "b31ed4807259472689f984e348f10e15125fae9df1298e6befddd5411a2a7dda",
                   "d0916c34fb5a3580baf74f401277ceb480eec5b4e0a61aea3400f2491922019a") and
    not (process.name : "powershell.exe" and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.name : "powershell.exe" and
         process.parent.executable : ("C:\\WINDOWS\\_ScriptingFramework\\Modul\\Engine.exe",
                                      "C:\\Windows\\System32\\gpscript.exe",
                                      "C:\\Windows\\IMECache\\*\\RjImeHost.exe")) and
    process.pe.original_file_name != "Adobe Installer" and
    not process.parent.executable :
                       ("C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe",
                        "C:\\Program Files (x86)\\AOMEI\\AOMEI Backupper\\*\\unins*.exe",
                        "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dcconfigexec.exe",
                        "C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe",
                        "C:\\Program Files (x86)\\AOMEI\\AOMEI Backupper\\*\\unins*.exe",
                        "C:\\Program Files (x86)\\Common Files\\InstallShield\\*.exe",
                        "C:\\Program Files\\RepairTech\\Syncro\\Syncro.App.Runner.exe",
                        "C:\\Program Files (x86)\\*\\unins*.exe") and
    not (process.name : "powershell.exe" and process.args : "RemoteSigned") and
    not (process.name : "cscript.exe" and process.parent.executable : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*", "C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\*.tmp")) and
    not (process.name : "powershell.exe" and process.parent.code_signature.subject_name in ("Patch My PC, LLC", "Grammarly, Inc.", "FastTrack Software ApS") and process.parent.code_signature.trusted == true)
   ] by process.entity_id
   [file where event.action : "creation" and process.name : "svchost.exe" and
    file.path : ("?:\\Windows\\Tasks\\*", "?:\\Windows\\System32\\Tasks\\*") and

    /* excluding via Powershell cmdline is also vulnerable to evasion */
    not (Effective_process.name : "powershell.exe" and
          file.path :
             ("?:\\WINDOWS\\System32\\Tasks\\PSWindowsUpdate",
              "?:\\Windows\\System32\\Tasks\\npcapwatchdog",
              "?:\\Windows\\System32\\Tasks\\ChocoUpgrade",
              "?:\\Windows\\System32\\Tasks\\ansible-ansible.windows.win_updates",
              "?:\\Windows\\System32\\Tasks\\Microsoft\\Windows\\PowerShell\\ScheduledJobs\\ansible-win-updates",
              "?:\\WINDOWS\\System32\\Tasks\\PRISM Monitoring - System Data",
              "?:\\Windows\\System32\\Tasks\\PRISM Cloud Monitoring - System Data")) and

    not (file.name : "Microsoft Office 1? Sync Maintenance for *" and file.size >= 5200 and file.size <= 5300 and
         Effective_process.name : ("winword.exe", "excel.exe", "powerpnt.exe")) and
    not (file.name : "OneDrive Standalone Update Task-S-1-5-21-*" and Effective_process.executable : "\\Device\\Mup\\*") and
    not (file.path :  "C:\\Windows\\System32\\Tasks\\Microsoft\\Windows\\RemoteApp and Desktop Connections Update\\*" and Effective_process.executable : "C:\\Windows\\System32\\xwizard.exe") and
    not (file.name like ("TSS-Framework_wsusutil", "PSAppDeployToolkit_MicrosoftCorporation_*") and Effective_process.name : "powershell.exe")
    ] by Effective_process.entity_id
'''

min_endpoint_version = "8.8.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by Effective_process.entity_id, process.entity_id.

Stage 1: process

[process where event.action == "start" and
    (
     process.name : ("wscript.exe", "cscript.exe", "regsvr32.exe", "mshta.exe", "rundll32.exe", "vbc.exe",
                     "msbuild.exe", "wmic.exe", "cmstp.exe", "RegAsm.exe", "installutil.exe","RegSvcs.exe",
                     "msxsl.exe", "xwizard.exe", "csc.exe", "winword.exe", "excel.exe", "powerpnt.exe",
                     "powershell.exe")  or
     (process.name : "javaw.exe" and process.args : "-jar" and process.args_count == 3 and
      process.args : ("?:\\Users\\*", "?:\\ProgramData\\*")) or
    ((process.code_signature.trusted == false or process.code_signature.exists == false) and
      (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
      not process.code_signature.status : ("errorTimeStamp", "errorCode_endpoint*", "errorExpired", "errorChaining")) or
    (process.executable :
         ("?:\\Users\\Public\\*",
          "?:\\Users\\*\\AppData\\Roaming\\*",
          "?:\\ProgramData\\*",
          "?:\\Windows\\Microsoft.NET\\*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\Rar*",
          "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*",
          "\\Device\\CdRom*") and not process.code_signature.trusted == true) or
    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not process.executable : "C:\\*")
    ) and
    not (process.name : "rundll32.exe" and process.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*" and process.parent.name : "msiexec.exe") and
    not (process.name : ("rundll32.exe", "regsvr32.exe") and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.code_signature.trusted == true and process.executable : ("?:\\Users\\*\\AppData\\Roaming\\*", "?:\\ProgramData\\*")) and
    not (process.name : "rundll32.exe" and process.args : "tsworkspace,TaskUpdateWorkspaces") and
    not (process.name : "rundll32.exe" and process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and process.command_line : "*pcrpf.dll,NotifyFirmwareUpdateStaged*") and
    not (process.executable : "\\Device\\Mup\\*\\OneDriveSetup.exe" and process.args : "/ALLUSERS") and
    not (process.name : "rundll32.exe" and
         process.command_line : ("*PWMTR32V.dll,InitializeSettingsDuringInstallation*", "*RunDll_EnableBits*")) and
    not (process.name : "powershell.exe" and
         process.command_line :
                   ("*:\\Program Files\\*", "*:\\Program Files (X86)\\*",
                    "*Packages\\Plugins\\Microsoft.AdminCenter.AdminCenter*",
                    "*:\\WINDOWS\\ccmcache\\*",
                    "*EEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBGADgAQQBjAHcA*",
                    "*UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAA*",
                    "*-EncodedCommand*",
                    "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" ")) and
    not (process.name : "powershell.exe" and
         process.parent.executable : ("?:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe",
                                      "?:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShellService.exe",
                                      "?:\\Program Files (x86)\\ITSPlatform\\plugin\\scripting\\platform-scripting-plugin.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe",
                                      "?:\\Program Files (x86)\\Lenovo\\VantageService\\*\\Lenovo.Vantage.AddinInstaller.exe",
                                      "?:\\ProgramData\\Lenovo\\LenovoNow\\Downloads\\LenovoNow.Updater.exe",
                                      "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoFirstRunExperiencePackage\\x86\\LenovoWelcomeTask.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\agentexecutor.exe",
                                      "C:\\Banyan\\Canopy\\Leaf\\leaf_desktop_app.exe",
                                      "?:\\windows\\system32\\msiexec.exe",
                                      "?:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe",
                                      "C:\\Windows\\CCM\\OSDRunPowerShellScript.exe",
                                      "C:\\Windows\\System32\\runonce.exe")) and
    not (process.name : "powershell.exe" and user.id : "S-1-5-18") and
    not (process.name : "powershell.exe" and process.parent.name : "powershell.exe" and process.parent.args : "-EncodedCommand" and process.parent.args : "cABvAHcAZQByAHMAaABlAGw*") and
    not (process.name : "powershell.exe" and process.args : ("-nomeAgente", "\\\\*\\*.ps1", "& 'C:\\oracle_unified_agent\\scripts\\unified-agent-permissions.ps1' ; exit $($LASTEXITCODE)")) and
    not (process.parent.name : "rundll32.exe" and process.parent.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*") and
    not (process.name : "rundll32.exe" and process.command_line : ("*zzzzInvokeManagedCustomActionOutOfProc*", "*tsworkspace,WorkspaceSilentSetup*")) and
    not process.executable :
                ("?:\\Program Files (x86)\\*.exe",
                 "?:\\Program Files\\*.exe",
                 "?:\\Windows\\SysWOW64\\OneDriveSetup.exe",
                 "?:\\Windows\\System32\\MRT.exe",
                 "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\Update\\OneDriveSetup.exe",
                 "C:\\Windows\\SystemTemp\\SupportAssistAgent\\*\\SupportAssistDeployment.exe") and
    not (process.name : ("winword.exe", "excel.exe", "powerpnt.exe") and not process.working_directory : "C:\\*") and
    not process.hash.sha256 :
                  ("3d95157908cee58d19193c93c5f2b0a06910b8123a4211b0ea059ff66f2506e0",
                   "79dbc3cf0d4cdc0f2150ab5e2bf3457ba54297202500f26f1a1d48e455f7c54a",
                   "62d96982e2c2d58682471af9a9d0727ba49199d48b7766c318886e8e7e23670a",
                   "ef330f95416162866f5d8b9cd509066ab4168cfcc66e305006be1952905d47e6",
                   "cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd",
                   "3c1169568774b7ce8a96e137983b059f030eb3983c369cfb12ea2c59cf3f56ad",
                   "edaf602006b53dc936a35d0f9e6de51c552c0203ebe814cb68b1d5cbc81f4b49",
                   "82c97648fa358c31fb47e44762938738ad3080880b84b69d9c303d708ab160c2",
                   "4aff93803f1915f3a10f19a1d1e065483c4d11221e3c2792b3de1807c7bf1d9a",
                   "f9e86b3a6275429f5dbecccc2020e498032a96fc02dd8bdb2a1cc5b5bf2b473b",
                   "7b20331e03018ca74f0212aff3d5a1a66e2375188691df56c9b2b89ba84ad38b",
                   "dc3bcf4dee3b8c3ca0062284f53e5f717085bd3f3ac6b1ac70492425a7cf2474",
                   "81fac89743d43b741a009541a9c365ed3213f49cf6314d9c50418ab0d9e82528",
                   "7d2c761823b183cd34a8c1c0b7b6f572d26a0265bfe65afe913faf60d27de844",
                   "f943329f6399ecd418268484bc61d98887b7fc8454c2409a79adc3b965ae75a0",
                   "ae27abffcc06755840792abb83a67b847782afa01bb26c2631671ed3932930b6",
                   "6af431b97e8571a2c072a746a44b5e0dcb3685268f75459e789063e03b7698cb",
                   "b31ed4807259472689f984e348f10e15125fae9df1298e6befddd5411a2a7dda",
                   "d0916c34fb5a3580baf74f401277ceb480eec5b4e0a61aea3400f2491922019a") and
    not (process.name : "powershell.exe" and process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
    not (process.name : "powershell.exe" and
         process.parent.executable : ("C:\\WINDOWS\\_ScriptingFramework\\Modul\\Engine.exe",
                                      "C:\\Windows\\System32\\gpscript.exe",
                                      "C:\\Windows\\IMECache\\*\\RjImeHost.exe")) and
    process.pe.original_file_name != "Adobe Installer" and
    not process.parent.executable :
                       ("C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe",
                        "C:\\Program Files (x86)\\AOMEI\\AOMEI Backupper\\*\\unins*.exe",
                        "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dcconfigexec.exe",
                        "C:\\Windows\\highsystem.NET\\Client\\hdnClSvc.NET.exe",
                        "C:\\Program Files (x86)\\AOMEI\\AOMEI Backupper\\*\\unins*.exe",
                        "C:\\Program Files (x86)\\Common Files\\InstallShield\\*.exe",
                        "C:\\Program Files\\RepairTech\\Syncro\\Syncro.App.Runner.exe",
                        "C:\\Program Files (x86)\\*\\unins*.exe") and
    not (process.name : "powershell.exe" and process.args : "RemoteSigned") and
    not (process.name : "cscript.exe" and process.parent.executable : ("?:\\Program Files (x86)\\*", "?:\\Program Files\\*", "C:\\Users\\*\\AppData\\Local\\Temp\\is-*.tmp\\*.tmp")) and
    not (process.name : "powershell.exe" and process.parent.code_signature.subject_name in ("Patch My PC, LLC", "Grammarly, Inc.", "FastTrack Software ApS") and process.parent.code_signature.trusted == true)
   ] by process.entity_id

Stage 2: file

[file where event.action : "creation" and process.name : "svchost.exe" and
    file.path : ("?:\\Windows\\Tasks\\*", "?:\\Windows\\System32\\Tasks\\*") and
    not (Effective_process.name : "powershell.exe" and
          file.path :
             ("?:\\WINDOWS\\System32\\Tasks\\PSWindowsUpdate",
              "?:\\Windows\\System32\\Tasks\\npcapwatchdog",
              "?:\\Windows\\System32\\Tasks\\ChocoUpgrade",
              "?:\\Windows\\System32\\Tasks\\ansible-ansible.windows.win_updates",
              "?:\\Windows\\System32\\Tasks\\Microsoft\\Windows\\PowerShell\\ScheduledJobs\\ansible-win-updates",
              "?:\\WINDOWS\\System32\\Tasks\\PRISM Monitoring - System Data",
              "?:\\Windows\\System32\\Tasks\\PRISM Cloud Monitoring - System Data")) and
    not (file.name : "Microsoft Office 1? Sync Maintenance for *" and file.size >= 5200 and file.size <= 5300 and
         Effective_process.name : ("winword.exe", "excel.exe", "powerpnt.exe")) and
    not (file.name : "OneDrive Standalone Update Task-S-1-5-21-*" and Effective_process.executable : "\\Device\\Mup\\*") and
    not (file.path :  "C:\\Windows\\System32\\Tasks\\Microsoft\\Windows\\RemoteApp and Desktop Connections Update\\*" and Effective_process.executable : "C:\\Windows\\System32\\xwizard.exe") and
    not (file.name like ("TSS-Framework_wsusutil", "PSAppDeployToolkit_MicrosoftCorporation_*") and Effective_process.name : "powershell.exe")
    ] by Effective_process.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionwildcard
  • creation corpus 8 (elastic 8)
field:"EventType" kind:wildcard value:"creation"
file.pathwildcard
  • ?:\Windows\System32\Tasks\* corpus 6 (elastic 6)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
field:"TargetFilename" kind:wildcard
process.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.relative_file_creation_timele
  • 300 transforms: number corpus 11 (elastic 11)
field:"process.Ext.relative_file_creation_time" kind:le value:"300"
process.Ext.relative_file_name_modify_timele
  • 300 transforms: number corpus 9 (elastic 9)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"300"
process.argswildcard
  • -jar corpus 8 (elastic 8)
  • ?:\ProgramData\* corpus 3 (elastic 3)
  • ?:\Users\* corpus 4 (elastic 4)
field:"process.args" kind:wildcard
process.args_counteq
  • 3 transforms: number corpus 22 (elastic 22)
field:"process.args_count" kind:eq value:"3"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\* corpus 18 (elastic 18)
  • ?:\Users\*\AppData\Local\Temp\7z* corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Temp\BNZ.* corpus 7 (elastic 7)
  • ?:\Users\*\AppData\Local\Temp\Rar* corpus 3 (elastic 3)
  • ?:\Users\*\AppData\Local\Temp\Temp?_* corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Roaming\* corpus 5 (elastic 5)
  • ?:\Users\Public\* corpus 22 (elastic 22)
  • ?:\Windows\Microsoft.NET\* corpus 11 (elastic 11)
  • \Device\CdRom* corpus 2 (elastic 2)
field:"Image" kind:wildcard
process.namewildcard
  • RegAsm.exe corpus 25 (elastic 24, splunk 1)
  • RegSvcs.exe corpus 22 (elastic 21, splunk 1)
  • cmstp.exe corpus 25 (elastic 25)
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • excel.exe corpus 34 (elastic 34)
  • installutil.exe corpus 36 (elastic 32, splunk 4)
  • javaw.exe corpus 9 (elastic 9)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msxsl.exe corpus 22 (elastic 22)
  • powerpnt.exe corpus 31 (elastic 31)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • svchost.exe corpus 21 (elastic 20, splunk 1)
  • vbc.exe corpus 8 (elastic 8)
  • winword.exe corpus 35 (elastic 35)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
  • xwizard.exe corpus 16 (elastic 16)
field:"process_basename" kind:wildcard
process.pe.original_file_namene
  • Adobe Installer
field:"OriginalFileName" kind:ne value:"Adobe Installer"
process.working_directorywildcard
  • C:\*
field:"CurrentDirectory" kind:wildcard value:"C:\*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.working_directorystarts_withC:\excludes:process.working_directory field:"process.working_directory" value:"C:\"
process.nameeqwinword.exe, excel.exe, powerpnt.exeexcludes:process.name field:"process.name" value:"winword.exe" field:"process.name" value:"excel.exe" field:"process.name" value:"powerpnt.exe"
process.argseq/ALLUSERSexcludes:process.args field:"process.args" value:"/ALLUSERS"
process.executablewildcard\Device\Mup\*\OneDriveSetup.exeexcludes:process.executable field:"process.executable" value:"\Device\Mup\*\OneDriveSetup.exe"
process.argseqRemoteSignedexcludes:process.args field:"process.args" value:"RemoteSigned"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.argseqtsworkspace,TaskUpdateWorkspacesexcludes:process.args field:"process.args" value:"tsworkspace,TaskUpdateWorkspaces"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.argsstarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.args field:"process.args" value:"?:\Program Files\" field:"process.args" value:"?:\Program Files (x86)\"
process.nameeqrundll32.exe, regsvr32.exeexcludes:process.name field:"process.name" value:"rundll32.exe" field:"process.name" value:"regsvr32.exe"
process.argswildcard-nomeAgente, \\*\*.ps1, & 'C:\oracle_unified_agent\scripts\unified-agent-permissions.ps1' ; exit $($LASTEXITCODE)excludes:process.args field:"process.args" value:"-nomeAgente" field:"process.args" value:"\\*\*.ps1" field:"process.args" value:"& 'C:\oracle_unified_agent\scripts\unified-agent-permissions.ps1' ; exit $($LASTEXITCODE)"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Users\*\AppData\Roaming\*, ?:\ProgramData\*excludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\Roaming\*" field:"process.executable" value:"?:\ProgramData\*"
process.command_linematchPWMTR32V.dll,InitializeSettingsDuringInstallation, RunDll_EnableBitsexcludes:process.command_line field:"process.command_line" value:"PWMTR32V.dll,InitializeSettingsDuringInstallation" field:"process.command_line" value:"RunDll_EnableBits"
process.command_linematchpcrpf.dll,NotifyFirmwareUpdateStagedexcludes:process.command_line field:"process.command_line" value:"pcrpf.dll,NotifyFirmwareUpdateStaged"
process.parent.executableeq?:\Windows\System32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe"
process.command_linematchzzzzInvokeManagedCustomActionOutOfProc, tsworkspace,WorkspaceSilentSetupexcludes:process.command_line field:"process.command_line" value:"zzzzInvokeManagedCustomActionOutOfProc" field:"process.command_line" value:"tsworkspace,WorkspaceSilentSetup"
process.command_linematchzzzzInvokeManagedCustomActionOutOfProcexcludes:process.command_line field:"process.command_line" value:"zzzzInvokeManagedCustomActionOutOfProc"
process.parent.nameeqmsiexec.exeexcludes:process.parent.name field:"process.parent.name" value:"msiexec.exe"
process.command_linewildcard*:\Program Files\*, *:\Program Files (X86)\*, *Packages\Plugins\Microsoft.AdminCenter.AdminCenter*, *:\WINDOWS\ccmcache\*, *EEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBGADgAQQBjAHcA*, *UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAA*, *-EncodedCommand*, "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" excludes:process.command_line
process.nameeqcscript.exeexcludes:process.name field:"process.name" value:"cscript.exe"
process.parent.executablewildcard?:\Program Files (x86)\*, ?:\Program Files\*, C:\Users\*\AppData\Local\Temp\is-*.tmp\*.tmpexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\*" field:"process.parent.executable" value:"?:\Program Files\*" field:"process.parent.executable" value:"C:\Users\*\AppData\Local\Temp\is-*.tmp\*.tmp"
process.parent.argseq-EncodedCommandexcludes:process.parent.args field:"process.parent.args" value:"-EncodedCommand"
process.parent.argsstarts_withcABvAHcAZQByAHMAaABlAGwexcludes:process.parent.args field:"process.parent.args" value:"cABvAHcAZQByAHMAaABlAGw"
process.parent.nameeqpowershell.exeexcludes:process.parent.name field:"process.parent.name" value:"powershell.exe"
process.parent.code_signature.subject_nameinFastTrack Software ApS, Grammarly, Inc., Patch My PC, LLCexcludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"FastTrack Software ApS" field:"process.parent.code_signature.subject_name" value:"Grammarly, Inc." field:"process.parent.code_signature.subject_name" value:"Patch My PC, LLC"
process.parent.code_signature.trustedeqtrueexcludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true"
process.parent.executablewildcard?:\Program Files (x86)\Microsoft Intune Management Extension\AgentExecutor.exe, ?:\Program Files (x86)\Spiceworks Agent Shell\AgentShellService.exe, ?:\Program Files (x86)\ITSPlatform\plugin\scripting\platform-scripting-plugin.exe, ?:\Program Files (x86)\Microsoft Intune Management Extension\Microsoft.Management.Services.IntuneWindowsAgent.exe, ?:\Program Files (x86)\Lenovo\VantageService\*\Lenovo.Vantage.AddinInstaller.exe, ?:\ProgramData\Lenovo\LenovoNow\Downloads\LenovoNow.Updater.exe, ?:\ProgramData\Lenovo\ImController\Plugins\LenovoFirstRunExperiencePackage\x86\LenovoWelcomeTask.exe, ?:\Program Files (x86)\Microsoft Intune Management Extension\agentexecutor.exe, C:\Banyan\Canopy\Leaf\leaf_desktop_app.exe, ?:\windows\system32\msiexec.exe, ?:\Program Files (x86)\Microsoft Intune Management Extension\Microsoft.Management.Services.IntuneWindowsAgent.exe, C:\Windows\CCM\OSDRunPowerShellScript.exe, C:\Windows\System32\runonce.exeexcludes:process.parent.executable
process.parent.executablewildcardC:\WINDOWS\_ScriptingFramework\Modul\Engine.exe, C:\Windows\System32\gpscript.exe, C:\Windows\IMECache\*\RjImeHost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\WINDOWS\_ScriptingFramework\Modul\Engine.exe" field:"process.parent.executable" value:"C:\Windows\System32\gpscript.exe" field:"process.parent.executable" value:"C:\Windows\IMECache\*\RjImeHost.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.parent.command_linematchzzzzInvokeManagedCustomActionOutOfProcexcludes:process.parent.command_line field:"process.parent.command_line" value:"zzzzInvokeManagedCustomActionOutOfProc"
process.parent.nameeqrundll32.exeexcludes:process.parent.name field:"process.parent.name" value:"rundll32.exe"
process.executablewildcard?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\SysWOW64\OneDriveSetup.exe, ?:\Windows\System32\MRT.exe, ?:\Users\*\AppData\Local\Microsoft\OneDrive\Update\OneDriveSetup.exe, C:\Windows\SystemTemp\SupportAssistAgent\*\SupportAssistDeployment.exeexcludes:process.executable
process.hash.sha256eq3d95157908cee58d19193c93c5f2b0a06910b8123a4211b0ea059ff66f2506e0, 79dbc3cf0d4cdc0f2150ab5e2bf3457ba54297202500f26f1a1d48e455f7c54a, 62d96982e2c2d58682471af9a9d0727ba49199d48b7766c318886e8e7e23670a, ef330f95416162866f5d8b9cd509066ab4168cfcc66e305006be1952905d47e6, cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd, 3c1169568774b7ce8a96e137983b059f030eb3983c369cfb12ea2c59cf3f56ad, edaf602006b53dc936a35d0f9e6de51c552c0203ebe814cb68b1d5cbc81f4b49, 82c97648fa358c31fb47e44762938738ad3080880b84b69d9c303d708ab160c2, 4aff93803f1915f3a10f19a1d1e065483c4d11221e3c2792b3de1807c7bf1d9a, f9e86b3a6275429f5dbecccc2020e498032a96fc02dd8bdb2a1cc5b5bf2b473b, 7b20331e03018ca74f0212aff3d5a1a66e2375188691df56c9b2b89ba84ad38b, dc3bcf4dee3b8c3ca0062284f53e5f717085bd3f3ac6b1ac70492425a7cf2474, 81fac89743d43b741a009541a9c365ed3213f49cf6314d9c50418ab0d9e82528, 7d2c761823b183cd34a8c1c0b7b6f572d26a0265bfe65afe913faf60d27de844, f943329f6399ecd418268484bc61d98887b7fc8454c2409a79adc3b965ae75a0, ae27abffcc06755840792abb83a67b847782afa01bb26c2631671ed3932930b6, 6af431b97e8571a2c072a746a44b5e0dcb3685268f75459e789063e03b7698cb, b31ed4807259472689f984e348f10e15125fae9df1298e6befddd5411a2a7dda, d0916c34fb5a3580baf74f401277ceb480eec5b4e0a61aea3400f2491922019aexcludes:process.hash.sha256
process.parent.executablewildcardC:\Windows\highsystem.NET\Client\hdnClSvc.NET.exe, C:\Program Files (x86)\AOMEI\AOMEI Backupper\*\unins*.exe, C:\Program Files (x86)\ManageEngine\UEMS_Agent\bin\dcconfigexec.exe, C:\Windows\highsystem.NET\Client\hdnClSvc.NET.exe, C:\Program Files (x86)\AOMEI\AOMEI Backupper\*\unins*.exe, C:\Program Files (x86)\Common Files\InstallShield\*.exe, C:\Program Files\RepairTech\Syncro\Syncro.App.Runner.exe, C:\Program Files (x86)\*\unins*.exeexcludes:process.parent.executable
Effective_process.executableeqC:\Windows\System32\xwizard.exeexcludes:Effective_process.executable field:"Effective_process.executable" value:"C:\Windows\System32\xwizard.exe"
file.pathstarts_withC:\Windows\System32\Tasks\Microsoft\Windows\RemoteApp and Desktop Connections Update\excludes:file.path field:"file.path" value:"C:\Windows\System32\Tasks\Microsoft\Windows\RemoteApp and Desktop Connections Update\"
Effective_process.executablestarts_with\Device\Mup\excludes:Effective_process.executable field:"Effective_process.executable" value:"\Device\Mup\"
file.namestarts_withOneDrive Standalone Update Task-S-1-5-21-excludes:file.name field:"file.name" value:"OneDrive Standalone Update Task-S-1-5-21-"
Effective_process.nameeqpowershell.exeexcludes:Effective_process.name field:"Effective_process.name" value:"powershell.exe"
file.namewildcardTSS-Framework_wsusutil, PSAppDeployToolkit_MicrosoftCorporation_*excludes:file.name field:"file.name" value:"TSS-Framework_wsusutil" field:"file.name" value:"PSAppDeployToolkit_MicrosoftCorporation_*"
file.patheq?:\WINDOWS\System32\Tasks\PSWindowsUpdate, ?:\Windows\System32\Tasks\npcapwatchdog, ?:\Windows\System32\Tasks\ChocoUpgrade, ?:\Windows\System32\Tasks\ansible-ansible.windows.win_updates, ?:\Windows\System32\Tasks\Microsoft\Windows\PowerShell\ScheduledJobs\ansible-win-updates, ?:\WINDOWS\System32\Tasks\PRISM Monitoring - System Data, ?:\Windows\System32\Tasks\PRISM Cloud Monitoring - System Dataexcludes:file.path
Effective_process.nameeqwinword.exe, excel.exe, powerpnt.exeexcludes:Effective_process.name field:"Effective_process.name" value:"winword.exe" field:"Effective_process.name" value:"excel.exe" field:"Effective_process.name" value:"powerpnt.exe"
file.namestarts_withMicrosoft Office 1? Sync Maintenance for excludes:file.name field:"file.name" value:"Microsoft Office 1? Sync Maintenance for "
file.sizege5200excludes:file.size field:"file.size" value:"5200"
file.sizele5300excludes:file.size field:"file.size" value:"5300"

Spike in Bytes Sent to an External Device

#
Status
production
Severity
low
Author
Elastic
Source
github.com/elastic/detection-rules

A machine learning job has detected high bytes of data written to an external device. In a typical operational setting, there is usually a predictable pattern or a certain range of data that is written to external devices. An unusually large amount of data being written is anomalous and can signal illicit data copying or transfer activities.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/09/22"
integration = ["ded", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has detected high bytes of data written to an external device. In a typical operational setting,
there is usually a predictable pattern or a certain range of data that is written to external devices. An unusually
large amount of data being written is anomalous and can signal illicit data copying or transfer activities.
"""
from = "now-2h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "ded_high_bytes_written_to_external_device_ea"
name = "Spike in Bytes Sent to an External Device"
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/ded",
    "https://www.elastic.co/blog/detect-data-exfiltration-activity-with-kibanas-new-integration",
]
risk_score = 21
rule_id = "35a3b253-eea8-46f0-abd3-68bdd47e6e3d"
setup = """## Setup

The rule requires the Data Exfiltration Detection integration assets to be installed, as well as network and file events collected by integrations such as Elastic Defend and Network Packet Capture (for network events only).

### Data Exfiltration Detection Setup
The Data Exfiltration Detection integration detects data exfiltration activity by identifying abnormalities in network and file events. Anomalies are detected using Elastic's Anomaly Detection feature.

#### Prerequisite Requirements:
- Fleet is required for Data Exfiltration Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- File events collected by the Elastic Defend integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).

#### The following steps should be executed to install assets associated with the Data Exfiltration Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Data Exfiltration Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Data Source: Elastic Defend",
    "Use Case: Data Exfiltration Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Exfiltration",
    "Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Spike in Bytes Sent to an External Device

The detection rule leverages machine learning to identify anomalies in data transfer patterns to external devices, which typically follow predictable trends. Adversaries may exploit this by transferring large volumes of data to external media for exfiltration. The rule detects deviations from normal behavior, flagging potential illicit data transfers for further investigation.

### Possible investigation steps

- Review the alert details to identify the specific external device involved and the volume of data transferred.
- Correlate the time of the anomaly with user activity logs to determine if the data transfer aligns with any known or authorized user actions.
- Check historical data transfer patterns for the involved device to assess whether the detected spike is truly anomalous or part of a legitimate operational change.
- Investigate the user account associated with the data transfer for any signs of compromise or unusual behavior, such as recent password changes or failed login attempts.
- Examine the content and type of data transferred, if possible, to assess the sensitivity and potential impact of the data exfiltration.
- Cross-reference the device and user activity with other security alerts or incidents to identify any related suspicious activities or patterns.

### False positive analysis

- Regular backups to external devices can trigger false positives. Users should identify and exclude backup operations from the rule's scope by specifying known backup software or devices.
- Software updates or installations that involve large data transfers to external media may be misclassified. Users can create exceptions for these activities by defining specific update processes or installation paths.
- Data archiving processes that periodically transfer large volumes of data to external storage can be mistaken for exfiltration. Users should whitelist these scheduled archiving tasks by recognizing the associated patterns or schedules.
- Media content creation or editing, such as video production, often involves significant data transfers. Users can exclude these activities by identifying and excluding the relevant applications or file types.
- Temporary data transfers for legitimate business purposes, like transferring project files to a client, can be flagged. Users should document and exclude these known business processes by specifying the involved devices or file types.

### Response and remediation

- Immediately isolate the affected device from the network to prevent further data exfiltration.
- Conduct a forensic analysis of the device to identify the source and scope of the data transfer, focusing on the files transferred and any associated processes or applications.
- Review and revoke any unnecessary permissions or access rights that may have facilitated the data transfer to the external device.
- Notify the security operations center (SOC) and relevant stakeholders about the incident for awareness and potential escalation.
- Implement additional monitoring on similar devices and network segments to detect any further anomalous data transfer activities.
- Update and enforce data transfer policies to restrict unauthorized use of external devices, ensuring compliance with organizational security standards.
- Consider deploying endpoint detection and response (EDR) solutions to enhance visibility and control over data movements to external devices."""
[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1052"
name = "Exfiltration Over Physical Medium"
reference = "https://attack.mitre.org/techniques/T1052/"

[[rule.threat.technique.subtechnique]]
id = "T1052.001"
name = "Exfiltration over USB"
reference = "https://attack.mitre.org/techniques/T1052/001/"

[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"

Spike in Number of Connections Made from a Source IP

#
Status
production
Severity
low
Author
Elastic
Source
github.com/elastic/detection-rules

A machine learning job has detected a high count of destination IPs establishing an RDP connection with a single source IP. Once an attacker has gained access to one system, they might attempt to access more in the network in search of valuable assets, data, or further access points.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/10/12"
integration = ["lmd", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 70
author = ["Elastic"]
description = """
A machine learning job has detected a high count of destination IPs establishing an RDP connection with a single source
IP. Once an attacker has gained access to one system, they might attempt to access more in the network in search of
valuable assets, data, or further access points.
"""
from = "now-12h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "lmd_high_rdp_distinct_count_destination_ip_for_source_ea"
name = "Spike in Number of Connections Made from a Source IP"
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/lmd",
    "https://www.elastic.co/blog/detecting-lateral-movement-activity-a-new-kibana-integration",
    "https://www.elastic.co/blog/remote-desktop-protocol-connections-elastic-security",
]
risk_score = 21
rule_id = "3e0561b5-3fac-4461-84cc-19163b9aaa61"
setup = """## Setup

This rule requires the `host.ip` field to be populated.
For **Elastic Defend** events on versions **8.18 and above**, this field is **disabled by default**.

If you are using **Elastic Defend**, ensure host IP collection is enabled by following the configuration steps in the
[helper guide](https://www.elastic.co/docs/solutions/security/configure-elastic-defend/configure-data-volume-for-elastic-endpoint#host-fields).

The rule requires the Lateral Movement Detection integration assets to be installed, as well as file and Windows RDP process events collected by the Elastic Defend integration.

### Lateral Movement Detection Setup
The Lateral Movement Detection integration detects lateral movement activity by identifying abnormalities in file and Windows RDP events. Anomalies are detected using Elastic's Anomaly Detection feature.

#### Prerequisite Requirements:
- Fleet is required for Lateral Movement Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Windows RDP process events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).

#### The following steps should be executed to install assets associated with the Lateral Movement Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Lateral Movement Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Data Source: Elastic Defend",
    "Use Case: Lateral Movement Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Lateral Movement",
    "Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Spike in Number of Connections Made from a Source IP

Remote Desktop Protocol (RDP) is a common tool for remote management, but adversaries exploit it for lateral movement within networks. By establishing numerous connections from a single IP, attackers seek to expand their access. This detection rule leverages machine learning to identify unusual spikes in RDP connections, signaling potential unauthorized access attempts, and aids in early threat identification.

### Possible investigation steps

- Review the source IP address to determine if it is a known or trusted entity within the network.
- Analyze the list of destination IPs to identify any unusual or unauthorized systems being accessed.
- Check the timestamps of the connections to see if they align with expected activity patterns or occur during unusual hours.
- Investigate the user account associated with the RDP connections to verify if it has been compromised or is being misused.
- Correlate the spike in connections with any recent changes or incidents in the network that might explain the activity.
- Examine network logs and RDP session logs for any signs of suspicious behavior or anomalies during the connection attempts.

### False positive analysis

- Routine administrative tasks can trigger spikes in RDP connections. Regularly scheduled maintenance or software updates may cause a high number of connections from a single IP. To manage this, identify and whitelist IPs associated with known administrative activities.
- Automated scripts or tools used for network management might establish multiple RDP connections. Review and document these tools, then create exceptions for their IP addresses to prevent false alerts.
- Load balancers or proxy servers can appear as a single source IP making numerous connections. Verify the network architecture and exclude these IPs from the rule to avoid misidentification.
- Security scans or vulnerability assessments conducted by internal teams can result in a spike of connections. Coordinate with security teams to recognize these activities and exclude their IPs from triggering the rule.
- Remote work solutions or VPNs might centralize connections through a single IP, leading to false positives. Identify these IPs and adjust the rule to accommodate legitimate remote access patterns.

### Response and remediation

- Isolate the affected system immediately to prevent further lateral movement within the network. Disconnect it from the network or place it in a quarantine VLAN.
- Terminate any unauthorized RDP sessions originating from the identified source IP to halt ongoing unauthorized access attempts.
- Conduct a thorough review of the affected system for signs of compromise, including checking for unauthorized user accounts, changes in system configurations, and the presence of malware or suspicious files.
- Reset credentials for any accounts accessed via the compromised system to prevent further unauthorized access using stolen credentials.
- Implement network segmentation to limit RDP access to only necessary systems and users, reducing the attack surface for lateral movement.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the full scope of the breach.
- Update and enhance monitoring rules to detect similar patterns of unusual RDP connection spikes, ensuring early detection of future attempts."""
[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"

[[rule.threat.technique.subtechnique]]
id = "T1021.001"
name = "Remote Desktop Protocol"
reference = "https://attack.mitre.org/techniques/T1021/001/"

[[rule.threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"

[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

Suspicious Interpreter Execution Detected via Defend for Containers

#
Status
production
Severity
medium
Time window
6m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects when a process executes a suspicious interpreter command inside a container. These commands are commonly used by attackers to execute malicious code or exfiltrate data.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/02/06"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/07/29"

[rule]
author = ["Elastic"]
description = """
This rule detects when a process executes a suspicious interpreter command inside a container.
These commands are commonly used by attackers to execute malicious code or exfiltrate data.
"""
from = "now-6m"
index = ["logs-cloud_defend.process*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Suspicious Interpreter Execution Detected via Defend for Containers"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Suspicious Interpreter Execution Detected via Defend for Containers

This detection flags activity inside a Linux container launching Perl, PHP, Lua, Python, or Ruby with inline code execution and high-risk functions commonly used for spawning processes, decoding payloads, or opening network connections. It matters because attackers often abuse these one-liners to run malware or exfiltrate data without dropping files, blending into normal admin shell activity. A common pattern is a `python -c` one-liner that base64-decodes a second-stage script and executes it, then initiates an outbound socket for command-and-control.

### Possible investigation steps

- Review the full inline interpreter code and decode any embedded payloads (e.g., base64/zlib/rot13) to determine its intent, IOCs, and whether it fetches or launches a second stage.  
- Identify the originating interactive session and actor by correlating the container’s TTY/exec session metadata with orchestrator audit logs (e.g., Kubernetes exec/attach) to determine who/what initiated it and from where.  
- Assess whether the container image, entrypoint, and recent deployment changes are expected for this workload, and check for signs of container escape attempts or host access (mounted sockets, privileged flags, hostPath mounts).  
- Pivot from the alert time to related activity in the same container for child processes, file writes, cron/systemd modifications, and persistence artifacts that indicate follow-on actions beyond a one-liner.  
- Check for unexpected outbound connections or DNS lookups from the container around execution time, and validate any contacted domains/IPs against threat intel and known-good service dependencies.

### False positive analysis

- A developer or SRE opens an interactive shell in the container to troubleshoot and runs a quick inline one-liner (e.g., `python -c`/`php -r`/`ruby -e`) to test network connectivity, decode/transform a string (base64/zlib), or call a subprocess for diagnostics, which matches the suspicious function patterns.  
- During an interactive container exec session, an administrator performs emergency maintenance or incident response actions using an interpreter one-liner to fetch configuration/state, invoke system utilities, or validate service behavior (e.g., `socket.connect`, `os.system`, `curl_exec`, `IO.popen`), producing a benign but high-risk inline command signature.

### Response and remediation

- Quarantine the affected workload by scaling it to zero or cordoning the node and blocking egress for the namespace while preserving the pod and container filesystem for evidence capture.  
- Terminate the interactive session and kill the interpreter process tree, then collect the full command line, any decoded inline payload, and any retrieved scripts or binaries from the container for malware analysis.  
- Hunt and remove follow-on artifacts by searching the container for newly created executables, modified startup scripts, cron entries, webshells, or injected environment variables, and redeploy from a known-good image rather than “cleaning” the live container.  
- Rotate credentials and secrets exposed to the container (service account tokens, API keys, database passwords) and invalidate active sessions if the one-liner performed network calls, decoded payloads, or spawned subprocesses.  
- Escalate to the incident response team if the inline code includes base64/zlib decoding, establishes a socket connection, downloads a second stage, or any similar activity is observed across multiple pods/namespaces.  
- Harden against recurrence by restricting `exec/attach` access, enforcing least-privilege pod security (no privileged, no host mounts, read-only root filesystem), and using egress allowlists plus image signing/admission controls to block unauthorized images and interactive debug containers."""
references = [
    "https://flare.io/learn/resources/blog/teampcp-cloud-native-ransomware",
]
risk_score = 47
rule_id = "cd24c340-b778-44bd-ab69-2f739bd70ce1"
severity = "medium"
tags = [
    "Data Source: Elastic Defend for Containers",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.parent.executable != null and (
  (
    process.executable like ("/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*") and
    process.args == "-e" and process.args like~ (
      "*system(*", "*exec(*", "*IO.popen(*", "*Open3.popen3(*", "*spawn(*", "*eval(*",
      "*load(*IO::*", "*load(*Marshal*", "*load(*Fiddle*", "*load(*Zlib*", "*load(*Base64*",
      "*zlib.inflate(*", "*zlib.deflate(*", "*zlib.decompress(*", "*zlib.uncompress(*", "*zlib.compress(*",
      "*Marshal.load(*", "*Fiddle.dlopen(*", "*Fiddle::Function.new(*", "*base64*", "*zlib*", 
      "*net/http*", "*socket.new*", "*open-uri*", "*pack(*"
    )
  ) or
  process.executable like ("/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*") and
  process.args == "-r" and process.args like~ (
    "*exec(*", "*system(*", "*shell_exec(*", "*passthru(*", "*proc_open(*", "*pcntl_exec(*", "*popen(*", 
    "*eval(*", "*assert(*", "*create_function(*", "*preg_replace(*e*", "*include(*", "*require(*",
    "*base64_decode(*", "*gzinflate(*", "*gzuncompress(*", "*str_rot13(*", "*urldecode(*", "*chr(*", 
    "*ord(*", "*strrev(*", "*strtr(*", "*pack(*", "*unpack(*", "*curl_exec(*", "*curl_multi_exec(*",
    "*file_get_contents(*", "*fopen(*", "*fsockopen(*", "*pfsockopen(*", "*stream_socket_client(*",
    "*socket_create(*", "*socket_connect(*", "*socket_write(*", "*socket_read(*", "*mail(*",
    "*move_uploaded_file(*"
  ) or
  process.executable like ("/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*") and
  process.args == "-e" and process.args like~ (
    "*os.execute(*", "*io.popen(*", "*load(*", "*loadstring(*", "*require(*", "*dofile(*",
    "*package.loadlib(*", "*base64.decode(*", "*base64.encode(*", "*zlib.inflate(*",
    "*zlib.deflate(*", "*zlib.decompress(*", "*zlib.compress(*", "*socket.bind(*",
    "*socket.connect(*", "*socket.receive(*", "*socket.send(*", "*socket.tcp(*",
    "*socket.udp(*", "*socket.listen(*", "*socket.accept(*", "*net.http.request(*",
    "*net.http.get(*", "*net.http.post(*", "*http.request(*", "*http.get(*", "*http.post(*"
  ) or
  process.executable like ("/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*") and
  process.args == "-c" and process.args like~ (
    "*exec(*base64*", "*exec(*decode(*", "*exec(*marshal*", "*exec(*pickle*", "*eval(*exec(*",
    "*eval(*", "*subprocess.popen(*", "*subprocess.run(*", "*pickle.loads(*", "*marshal.loads(*",
    "*binascii*", "*os.system(*", "*os.popen(*", "*pty.*", "*dup2*", "*fileno()*", "*connect(*",
    "*bind(*", "*execve(*", "*base64*", "*base32*", "*base16*", "*base85*", "*decode(*",
    "*zlib.*", "*[::-1]*", "*socket.socket(*", "*socket.connect(*", "*socket.bind(*"
  ) or
  process.executable like ("/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*") and
  process.args like "-e*" and process.args like~ (
    "*system(*", "*exec(*", "*IO.popen(*", "*Open3.popen3(*", "*spawn(*", "*eval(*", "*load(*",
    "*Marshal.load(*", "*Fiddle.dlopen(*", "*Fiddle::Function.new(*", "*base64*", "*zlib*", 
    "*net/http*", "*socket*", "*open-uri*", "*pack(*", "*unpack(*"
  )
) and container.id like "?*"
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[[rule.threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"

[[rule.threat.technique.subtechnique]]
id = "T1059.011"
name = "Lua"
reference = "https://attack.mitre.org/techniques/T1059/011/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"

[[rule.threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"

[[rule.threat.technique]]
id = "T1095"
name = "Non-Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1095/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.parent.executable != null and (
  (
    process.executable like ("/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*") and
    process.args == "-e" and process.args like~ (
      "*system(*", "*exec(*", "*IO.popen(*", "*Open3.popen3(*", "*spawn(*", "*eval(*",
      "*load(*IO::*", "*load(*Marshal*", "*load(*Fiddle*", "*load(*Zlib*", "*load(*Base64*",
      "*zlib.inflate(*", "*zlib.deflate(*", "*zlib.decompress(*", "*zlib.uncompress(*", "*zlib.compress(*",
      "*Marshal.load(*", "*Fiddle.dlopen(*", "*Fiddle::Function.new(*", "*base64*", "*zlib*", 
      "*net/http*", "*socket.new*", "*open-uri*", "*pack(*"
    )
  ) or
  process.executable like ("/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*") and
  process.args == "-r" and process.args like~ (
    "*exec(*", "*system(*", "*shell_exec(*", "*passthru(*", "*proc_open(*", "*pcntl_exec(*", "*popen(*", 
    "*eval(*", "*assert(*", "*create_function(*", "*preg_replace(*e*", "*include(*", "*require(*",
    "*base64_decode(*", "*gzinflate(*", "*gzuncompress(*", "*str_rot13(*", "*urldecode(*", "*chr(*", 
    "*ord(*", "*strrev(*", "*strtr(*", "*pack(*", "*unpack(*", "*curl_exec(*", "*curl_multi_exec(*",
    "*file_get_contents(*", "*fopen(*", "*fsockopen(*", "*pfsockopen(*", "*stream_socket_client(*",
    "*socket_create(*", "*socket_connect(*", "*socket_write(*", "*socket_read(*", "*mail(*",
    "*move_uploaded_file(*"
  ) or
  process.executable like ("/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*") and
  process.args == "-e" and process.args like~ (
    "*os.execute(*", "*io.popen(*", "*load(*", "*loadstring(*", "*require(*", "*dofile(*",
    "*package.loadlib(*", "*base64.decode(*", "*base64.encode(*", "*zlib.inflate(*",
    "*zlib.deflate(*", "*zlib.decompress(*", "*zlib.compress(*", "*socket.bind(*",
    "*socket.connect(*", "*socket.receive(*", "*socket.send(*", "*socket.tcp(*",
    "*socket.udp(*", "*socket.listen(*", "*socket.accept(*", "*net.http.request(*",
    "*net.http.get(*", "*net.http.post(*", "*http.request(*", "*http.get(*", "*http.post(*"
  ) or
  process.executable like ("/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*") and
  process.args == "-c" and process.args like~ (
    "*exec(*base64*", "*exec(*decode(*", "*exec(*marshal*", "*exec(*pickle*", "*eval(*exec(*",
    "*eval(*", "*subprocess.popen(*", "*subprocess.run(*", "*pickle.loads(*", "*marshal.loads(*",
    "*binascii*", "*os.system(*", "*os.popen(*", "*pty.*", "*dup2*", "*fileno()*", "*connect(*",
    "*bind(*", "*execve(*", "*base64*", "*base32*", "*base16*", "*base85*", "*decode(*",
    "*zlib.*", "*[::-1]*", "*socket.socket(*", "*socket.connect(*", "*socket.bind(*"
  ) or
  process.executable like ("/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*") and
  process.args like "-e*" and process.args like~ (
    "*system(*", "*exec(*", "*IO.popen(*", "*Open3.popen3(*", "*spawn(*", "*eval(*", "*load(*",
    "*Marshal.load(*", "*Fiddle.dlopen(*", "*Fiddle::Function.new(*", "*base64*", "*zlib*", 
    "*net/http*", "*socket*", "*open-uri*", "*pack(*", "*unpack(*"
  )
) and container.id like "?*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
container.idwildcard
  • ?*
field:"container.id" kind:wildcard value:"?*"
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • -c
  • -e
  • -r
field:"process.args" kind:eq
process.argswildcard
  • *Fiddle.dlopen(*
  • *Fiddle.dlopen(*
  • *Fiddle::Function.new(*
  • *Fiddle::Function.new(*
  • *IO.popen(*
  • *IO.popen(*
  • *Marshal.load(*
  • *Marshal.load(*
  • *Open3.popen3(*
  • *Open3.popen3(*
  • *[::-1]*
  • *assert(*
  • *base16*
  • *base32*
  • *base64*
  • *base64*
  • *base64.decode(*
  • *base64.encode(*
  • *base64_decode(*
  • *base85*
  • *binascii*
  • *bind(*
  • *chr(*
  • *connect(*
  • *create_function(*
  • *curl_exec(*
  • *curl_multi_exec(*
  • *decode(*
  • *dofile(*
  • *dup2*
  • *eval(*
  • *eval(*
  • *eval(*exec(*
  • *exec(*
  • *exec(*
  • *exec(*base64*
  • *exec(*decode(*
  • *exec(*marshal*
  • *exec(*pickle*
  • *execve(*
  • +89 more values (see full rule source)
field:"process.args" kind:wildcard
process.executablewildcard
  • /bin/lua*
  • /bin/perl*
  • /bin/php*
  • /bin/python*
  • /bin/ruby*
  • /usr/bin/lua*
  • /usr/bin/perl*
  • /usr/bin/php*
  • /usr/bin/python*
  • /usr/bin/ruby*
  • /usr/local/bin/lua*
  • /usr/local/bin/perl*
  • /usr/local/bin/php*
  • /usr/local/bin/python*
  • /usr/local/bin/ruby*
field:"Image" kind:wildcard
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Suspicious Mining Process Creation Event

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies service creation events of common mining services, possibly indicating the infection of a system with a cryptominer.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/02/08"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies service creation events of common mining services, possibly indicating the infection of a system with a
cryptominer.
"""
from = "now-9m"
index = ["endgame-*", "logs-crowdstrike.fdr*", "logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Mining Process Creation Event"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating Suspicious Mining Process Creation Event

Cryptomining exploits system resources to mine cryptocurrency, often without user consent, impacting performance and security. Adversaries may deploy mining services on Linux systems, disguising them as legitimate processes. The detection rule identifies the creation of known mining service files, signaling potential unauthorized mining activity. By monitoring these specific file creation events, security teams can swiftly respond to and mitigate cryptomining threats.

### Possible investigation steps

- Review the alert details to identify which specific mining service file was created, focusing on the file names listed in the query such as "aliyun.service" or "moneroocean_miner.service".
- Check the creation timestamp of the suspicious file to determine when the potential unauthorized mining activity began.
- Investigate the process that created the file by examining system logs or using process monitoring tools to identify the parent process and any associated command-line arguments.
- Analyze the system for additional indicators of compromise, such as unexpected network connections or high CPU usage, which may suggest active cryptomining.
- Verify the legitimacy of the file by comparing it against known hashes of legitimate services or using threat intelligence sources to identify known malicious files.
- Assess the system for any other suspicious activities or anomalies that may indicate further compromise or persistence mechanisms.

### False positive analysis

- Legitimate administrative scripts or services may create files with names similar to known mining services. Verify the origin and purpose of such files before taking action.
- System administrators might deploy custom monitoring or management services that inadvertently match the file names in the detection rule. Review and whitelist these services if they are confirmed to be non-threatening.
- Automated deployment tools or scripts could create service files as part of routine operations. Ensure these tools are properly documented and exclude them from the detection rule if they are verified as safe.
- Some legitimate software installations might use generic service names that overlap with those flagged by the rule. Cross-check with software documentation and exclude these from alerts if they are confirmed to be benign.

### Response and remediation

- Isolate the affected Linux system from the network to prevent further unauthorized mining activity and potential lateral movement by the adversary.
- Terminate any suspicious processes associated with the identified mining services, such as aliyun.service, moneroocean_miner.service, or others listed in the detection query.
- Remove the malicious service files from the system to prevent them from being restarted or reused by the attacker.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malware or persistence mechanisms.
- Review and update system and application patches to close any vulnerabilities that may have been exploited to deploy the mining services.
- Monitor network traffic for unusual outbound connections that may indicate communication with mining pools or command and control servers, and block these connections if detected.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the potential impact on other systems within the network."""
risk_score = 47
rule_id = "e2258f48-ba75-4248-951b-7c885edf18c2"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic 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.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- 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).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- 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.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "creation" and event.action in ("creation", "file_create_event") and (
  (
    file.name like~ (
      "moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service"
    )
  ) or
  (
    process.executable like "/usr/local/share/aliyun-assist/*/aliyun-service" and file.name like~ "aliyun.service"
  )
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1496"
name = "Resource Hijacking"
reference = "https://attack.mitre.org/techniques/T1496/"

[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

[[rule.threat.technique.subtechnique]]
id = "T1543.002"
name = "Systemd Service"
reference = "https://attack.mitre.org/techniques/T1543/002/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.type == "creation" and event.action in ("creation", "file_create_event") and (
  (
    file.name like~ (
      "moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service"
    )
  ) or
  (
    process.executable like "/usr/local/share/aliyun-assist/*/aliyun-service" and file.name like~ "aliyun.service"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • creation
  • file_create_event
field:"EventType" kind:in
event.typeeq
  • creation
field:"event.type" kind:eq value:"creation"
file.namewildcard
  • aliyun.service
  • apache4.service
  • c3pool_miner.service
  • moneroocean_miner.service
  • pastebin.service
  • pnsd.service
  • xvf.service
field:"file.name" kind:wildcard
process.executablewildcard
  • /usr/local/share/aliyun-assist/*/aliyun-service
field:"Image" kind:wildcard value:"/usr/local/share/aliyun-assist/*/aliyun-service"

UAC Bypass Attempt via SilentCleanup Task DLL Search Order Hijacking

#
Time window
1m
Sequence by
process.entity_id, process.parent.entity_id, user.id
Source
github.com/elastic/protections-artifacts

Identifies attempts to bypass User Account Control (UAC) via DLL search order hijacking. Attackers may attempt to bypass UAC to stealthily execute code with elevated permissions.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) via DLL search order hijacking. Attackers may attempt to bypass
UAC to stealthily execute code with elevated permissions.
"""
id = "9389bb8e-fadc-42ca-8598-28e2bb94edee"
license = "Elastic License v2"
name = "UAC Bypass Attempt via SilentCleanup Task DLL Search Order Hijacking"
os_list = ["windows"]
reference = ["https://github.com/EncodeGroup/UAC-SilentClean"]
version = "1.0.28"

query = '''
sequence by user.id with maxspan=1m
   [library where
    dll.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\WindowsApps\\api-ms-win-core-kernel32-legacy-l1.dll" and
    process.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe"] by process.entity_id
   [process where event.action == "start" and process.Ext.token.integrity_level_name == "high" and
    process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe" and
    not (process.executable : ("?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe", "?:\\Windows\\System32\\wermgr.exe") and
         process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft *")] by process.parent.entity_id
'''

min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id, user.id.

Stage 1: library

[library where
    dll.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\WindowsApps\\api-ms-win-core-kernel32-legacy-l1.dll" and
    process.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe"] by process.entity_id

Stage 2: process

[process where event.action == "start" and process.Ext.token.integrity_level_name == "high" and
    process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe" and
    not (process.executable : ("?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe", "?:\\Windows\\System32\\wermgr.exe") and
         process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft *")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Back to all Elastic rules