Detection rules › Elastic

Elastic rules: 0s

Attempt to Disable Auditd Service

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

Adversaries may attempt to disable the Auditd service to evade detection. Auditd is a Linux service that provides system auditing and logging. Disabling the Auditd service can prevent the system from logging important security events, which can be used to detect malicious activity.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment
Impact

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Adversaries may attempt to disable the Auditd service to evade detection. Auditd is a Linux service that provides system
auditing and logging. Disabling the Auditd service can prevent the system from logging important security events, which
can be used to detect malicious activity.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Attempt to Disable Auditd Service"
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 Disable Auditd Service

Auditd is a critical Linux service responsible for system auditing and logging, capturing security-relevant events. Adversaries may target this service to evade detection by disabling it, thus preventing the logging of their activities. The detection rule identifies suspicious processes attempting to stop or disable Auditd, such as using commands like `service stop` or `systemctl disable`, signaling potential defense evasion tactics.

### Possible investigation steps

- Review the process details to identify the user account associated with the suspicious command execution, focusing on the process fields such as process.name and process.args.
- Check the system logs for any preceding or subsequent suspicious activities around the time of the alert, particularly looking for other defense evasion tactics or unauthorized access attempts.
- Investigate the command history of the user identified to determine if there are any other unauthorized or suspicious commands executed.
- Verify the current status of the Auditd service on the affected host to ensure it is running and properly configured.
- Correlate the alert with any other security events or alerts from the same host or user to identify potential patterns or broader attack campaigns.

### False positive analysis

- System administrators may intentionally stop or disable the Auditd service during maintenance or troubleshooting. To handle this, create exceptions for known maintenance windows or specific administrator accounts.
- Automated scripts or configuration management tools might stop or disable Auditd as part of routine system updates or deployments. Identify these scripts and whitelist their activities to prevent false alerts.
- Some Linux distributions or custom setups might have alternative methods for managing services that could trigger this rule. Review and adjust the detection criteria to align with the specific service management practices of your environment.
- In environments where Auditd is not used or is replaced by another logging service, the rule might trigger unnecessarily. Consider disabling the rule or adjusting its scope in such cases.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further malicious activity and potential lateral movement by the adversary.
- Terminate any suspicious processes identified in the alert that are attempting to disable the Auditd service to stop the adversary's actions.
- Re-enable and restart the Auditd service on the affected system to ensure that auditing and logging are resumed, capturing any further suspicious activities.
- Conduct a thorough review of the system logs and audit records to identify any unauthorized changes or additional indicators of compromise that may have occurred prior to the alert.
- Apply any necessary security patches or updates to the affected system to address vulnerabilities that may have been exploited by the adversary.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may be affected.
- Implement enhanced monitoring and alerting for similar activities across the network to detect and respond to future attempts to disable critical security services."""
risk_score = 47
rule_id = "6a058ed6-4e9f-49f3-8f8e-f32165ae7ebf"
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: 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") and (
  (process.name == "service" and process.args == "stop") or
  (process.name == "chkconfig" and process.args == "off") or
  (process.name == "update-rc.d" and process.args in ("remove", "disable")) or
  (process.name == "systemctl" and process.args in ("disable", "stop", "kill", "mask"))
) and
process.args in ("auditd", "auditd.service") and 
not ?process.parent.name == "auditd.prerm"
'''

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

[[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/"

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

[[rule.threat.technique]]
id = "T1489"
name = "Service Stop"
reference = "https://attack.mitre.org/techniques/T1489/"

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

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.name == "service" and process.args == "stop") or
  (process.name == "chkconfig" and process.args == "off") or
  (process.name == "update-rc.d" and process.args in ("remove", "disable")) or
  (process.name == "systemctl" and process.args in ("disable", "stop", "kill", "mask"))
) and
process.args in ("auditd", "auditd.service") and 
not ?process.parent.name == "auditd.prerm"

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.argseq
  • off
  • stop
field:"process.args" kind:eq
process.argsin
  • auditd
  • auditd.service
  • disable
  • kill
  • mask
  • remove
  • stop
field:"process.args" kind:in
process.nameeq
  • chkconfig
  • service
  • systemctl
  • update-rc.d
field:"process_basename" kind:eq

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.nameeqauditd.prermexcludes:process.parent.name field:"process.parent.name" value:"auditd.prerm"

AWS S3 Bucket MFA Delete Disabled

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

Detects when MFA Delete is disabled on an Amazon S3 bucket. MFA Delete is an additional layer of security for versioned S3 buckets that requires multi-factor authentication to permanently delete object versions or disable versioning. When MFA Delete is disabled, an adversary with S3 write access and a compromised long-term access key can permanently delete object versions, a critical step in ransomware attacks that target S3 versioning as a backup mechanism. MFA Delete is configured via PutBucketVersioning with the MfaDelete parameter set to Disabled.

Known False Positives

  • Disabling MFA Delete when rotating the root account credentials used to manage versioning may trigger this rule. This operation requires root account credentials and is uncommon in automated pipelines.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/08/14"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/14"

[rule]
author = ["Elastic"]
description = """
Detects when MFA Delete is disabled on an Amazon S3 bucket. MFA Delete is an additional layer of
security for versioned S3 buckets that requires multi-factor authentication to permanently delete
object versions or disable versioning. When MFA Delete is disabled, an adversary with S3 write
access and a compromised long-term access key can permanently delete object versions, a critical
step in ransomware attacks that target S3 versioning as a backup mechanism. MFA Delete is
configured via PutBucketVersioning with the MfaDelete parameter set to Disabled.
"""
false_positives = [
    """
    Disabling MFA Delete when rotating the root account credentials used to manage versioning
    may trigger this rule. This operation requires root account credentials and is uncommon
    in automated pipelines.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS S3 Bucket MFA Delete Disabled"
note = """## Triage and analysis

### Investigating AWS S3 Bucket MFA Delete Disabled

MFA Delete protects versioned S3 buckets by requiring MFA authentication to permanently delete object versions or change the versioning state. This protection is specifically designed to prevent ransomware from destroying version history after encrypting the current object copies. Disabling MFA Delete removes this safeguard and is a recognized ransomware preparation step.

Importantly, only the AWS account root user can enable or disable MFA Delete. A `PutBucketVersioning` call disabling MFA Delete from a non-root identity is a strong indicator of root credential compromise or unauthorized use.

### Possible investigation steps

- Identify the caller from `aws.cloudtrail.user_identity.type`. If this is not a `Root` identity, treat it as high-confidence unauthorized access.
- Check `aws.cloudtrail.request_parameters` to confirm `VersioningConfiguration={... MfaDelete=Disabled}` is present.
- Review all API calls by the same identity in the surrounding window for other data-destruction or encryption-related actions.
- Check whether object versioning remains enabled on the affected bucket. If both versioning and MFA Delete are disabled, the bucket has no object-level recovery protection.
- Investigate whether MFA was presented (`aws.cloudtrail.additional_eventdata` contains MFA information for requests that required it).

### Response and remediation

- If unauthorized, immediately re-enable MFA Delete using root credentials and verify that object version history is intact.
- Rotate all credentials associated with the calling identity.
- Review S3 object versions for any permanent deletions that occurred after MFA Delete was disabled.
- Enable AWS Config rules to detect versioning and MFA Delete configuration changes.
"""
references = [
    "https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiFactorAuthenticationDelete.html",
    "https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html",
    "https://rhinosecuritylabs.com/aws/s3-ransomware-part-1-attack-vector/",
    "https://www.halcyon.ai/blog/abusing-aws-native-services-ransomware-encrypting-s3-buckets-with-sse-c",
]
risk_score = 73
rule_id = "b8654454-2757-41b4-ae1a-69b3be704c28"
setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. S3 management events are logged by default."
severity = "high"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS S3",
    "Rule Type: Custom Query (KQL)",
    "Tactic: Impact",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "s3.amazonaws.com"
    and event.action: "PutBucketVersioning"
    and event.outcome: "success"
    and aws.cloudtrail.flattened.request_parameters.VersioningConfiguration.MfaDelete: "Disabled"
'''

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "s3.amazonaws.com"
    and event.action: "PutBucketVersioning"
    and event.outcome: "success"
    and aws.cloudtrail.flattened.request_parameters.VersioningConfiguration.MfaDelete: "Disabled"

Indicators

These rows show field, operator, and value matches.

Azure Storage Account Key Regenerated

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

Identifies a rotation to storage account access keys in Azure. Regenerating access keys can affect any applications or Azure services that are dependent on the storage account key. Adversaries may regenerate a key as a means of acquiring credentials to access systems and resources.

Known False Positives

  • It's recommended that you rotate your access keys periodically to help keep your storage account secure. Normal key rotation can be exempted from the rule. An abnormal time frame and/or a key rotation from unfamiliar users, hosts, or locations should be investigated.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/08/19"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies a rotation to storage account access keys in Azure. Regenerating access keys can affect any applications or
Azure services that are dependent on the storage account key. Adversaries may regenerate a key as a means of acquiring
credentials to access systems and resources.
"""
false_positives = [
    """
    It's recommended that you rotate your access keys periodically to help keep your storage account secure. Normal key
    rotation can be exempted from the rule. An abnormal time frame and/or a key rotation from unfamiliar users, hosts,
    or locations should be investigated.
    """,
]
from = "now-9m"
index = ["logs-azure.activitylogs-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure Storage Account Key Regenerated"
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 Azure Storage Account Key Regenerated

Azure Storage Account keys are critical credentials that grant access to storage resources. They are often used by applications and services to authenticate and interact with Azure Storage. Adversaries may regenerate these keys to gain unauthorized access, potentially disrupting services or exfiltrating data. The detection rule monitors for key regeneration events, flagging successful operations as potential indicators of credential misuse, thus enabling timely investigation and response.

### Possible investigation steps

- Review the Azure activity logs to identify the specific storage account associated with the key regeneration event by examining the operation_name field for "MICROSOFT.STORAGE/STORAGEACCOUNTS/REGENERATEKEY/ACTION".
- Check the event.outcome field to confirm the success of the key regeneration and gather details about the user or service principal that initiated the action.
- Investigate the user or service principal's recent activities in Azure to determine if there are any other suspicious actions or patterns that could indicate unauthorized access or misuse.
- Assess the impact on applications and services that rely on the affected storage account key by identifying dependencies and checking for any service disruptions or anomalies.
- Review access policies and permissions for the storage account to ensure they are appropriately configured and consider implementing additional security measures, such as Azure Key Vault, to manage and rotate keys securely.

### False positive analysis

- Routine key rotation by administrators or automated scripts can trigger alerts. To manage this, identify and document regular key rotation schedules and exclude these events from alerts.
- Development and testing environments often regenerate keys frequently. Exclude these environments from alerts by filtering based on environment tags or resource names.
- Third-party integrations or services that require periodic key regeneration might cause false positives. Work with service owners to understand these patterns and create exceptions for known, legitimate services.
- Azure policies or compliance checks that enforce key rotation can also lead to false positives. Coordinate with compliance teams to align detection rules with policy schedules and exclude these events.
- Ensure that any automated processes that regenerate keys are logged and documented. Use this documentation to create exceptions for these processes in the detection rule.

### Response and remediation

- Immediately revoke the regenerated storage account keys to prevent unauthorized access. This can be done through the Azure portal or using Azure CLI commands.
- Identify and update all applications and services that rely on the compromised storage account keys with new, secure keys to restore functionality and prevent service disruption.
- Conduct a thorough review of access logs and audit trails to identify any unauthorized access or data exfiltration attempts that may have occurred using the regenerated keys.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems or accounts have been compromised.
- Implement conditional access policies and multi-factor authentication (MFA) for accessing Azure resources to enhance security and prevent similar incidents.
- Review and update the storage account's access policies and permissions to ensure that only authorized users and applications have the necessary access.
- Enhance monitoring and alerting mechanisms to detect future unauthorized key regeneration attempts promptly, ensuring timely response to potential threats.

## Setup

The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal",
]
risk_score = 21
rule_id = "1e0b832e-957e-43ae-b319-db82d228c908"
severity = "low"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Use Case: Identity and Access Audit",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",

]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.STORAGE/STORAGEACCOUNTS/REGENERATEKEY/ACTION" and event.outcome:(Success or success)
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.STORAGE/STORAGEACCOUNTS/REGENERATEKEY/ACTION" and event.outcome:(Success or success)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
azure.activitylogs.operation_nameeq
  • MICROSOFT.STORAGE/STORAGEACCOUNTS/REGENERATEKEY/ACTION
field:"azure.activitylogs.operation_name" kind:eq value:"MICROSOFT.STORAGE/STORAGEACCOUNTS/REGENERATEKEY/ACTION"
data_stream.dataseteq
  • azure.activitylogs corpus 38 (elastic 38)
field:"data_stream.dataset" kind:eq value:"azure.activitylogs"
event.outcomein
  • Success corpus 306 (elastic 306)
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:in

CrowdStrike External Alerts

#

This is a third-party alert feed, not a detection over modeled telemetry. Another security product raised the finding; this rule forwards or reshapes it into the SIEM. It is searchable for reference but is excluded from the detection-rule browse and the ATT&CK coverage matrix.

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

Generates a detection alert for each CrowdStrike alert written to the configured indices. Enabling this rule allows you to immediately begin investigating CrowdStrike alerts in the app.

Rule Body

[metadata]
creation_date = "2025/07/31"
integration = ["crowdstrike"]
maturity = "production"
promotion = true
updated_date = "2025/10/17"

[rule]
author = ["Elastic"]
description = """
Generates a detection alert for each CrowdStrike alert written to the configured indices. Enabling this rule allows you
to immediately begin investigating CrowdStrike alerts in the app.
"""
from = "now-2m"
index = ["logs-crowdstrike.alert-*"]
interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "CrowdStrike External Alerts"
note = """## Triage and analysis

### Investigating CrowdStrike External Alerts

CrowdStrike Falcon is a cloud-native endpoint protection platform that delivers real-time threat detection and response capabilities. The rule captures security alerts generated by Falcon and enables analysts to investigate threats rapidly based on behavioral indicators and threat intelligence.

### Possible investigation steps

- Review the associated process, file path, and command line to determine whether the activity is legitimate or suspicious.
- Investigate the user account and host involved in the alert to validate whether the activity was authorized.
- Cross-reference the alert with CrowdStrike Falcon console for additional context, including process tree, behavioral tags, and threat intelligence matches.
- Check for any related alerts from the same host, user, or file hash to identify whether this is part of a larger attack chain.
- Consult the Crowdstrike investigation guide and resources tagged in the alert for specific guidance on handling similar threats.

### False positive analysis

- Alerts involving known and trusted software tools (e.g., remote administration tools) may be false positives. Confirm intent before excluding.
- Security assessments or penetration testing activities might mimic real threats. Validate the activity with responsible teams.
- Scheduled jobs, IT scripts, or automation tools may trigger alerts if they behave similarly to malicious code.
- Review alerts based on detection confidence levels and behavioral scoring to filter out low-confidence or known-benign triggers.

### Response and remediation

- Isolate affected endpoints to prevent lateral movement if malicious behavior is confirmed.
- Quarantine any identified malicious files and block related hashes or domains.
- Investigate how the threat entered the environment and close any exploited vulnerabilities.
- Reset credentials for compromised user accounts or escalate to incident response.
- Review CrowdStrike Falcon policies and detections to fine-tune future alerting and response coverage.
- Document the findings and update detection logic or exceptions accordingly.
"""
references = ["https://docs.elastic.co/en/integrations/crowdstrike"]
risk_score = 47
rule_id = "aeebe561-c338-4118-9924-8cb4e478aa58"
rule_name_override = "crowdstrike.alert.name"
setup = """## Setup

### CrowdStrike Alert Integration
This rule is designed to capture alert events generated by the CrowdStrike integration and promote them as Elastic detection alerts.

To capture CrowdStrike alerts, install and configure the CrowdStrike integration to ingest alert events into the `logs-crowdstrike.alert-*` index pattern.

If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same CrowdStrike events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:crowdstrike.alert to avoid receiving duplicate alerts.

### Additional notes

For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "medium"
tags = [
    "Data Source: Crowdstrike",
    "Use Case: Threat Detection",
    "Resources: Investigation Guide",
    "Promotion: External Alerts",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.kind: alert and data_stream.dataset: crowdstrike.alert
'''


[[rule.risk_score_mapping]]
field = "crowdstrike.alert.incident.score"
operator = "equals"
value = ""

[[rule.severity_mapping]]
field = "event.severity"
operator = "equals"
severity = "low"
value = "21"

[[rule.severity_mapping]]
field = "event.severity"
operator = "equals"
severity = "medium"
value = "47"

[[rule.severity_mapping]]
field = "event.severity"
operator = "equals"
severity = "high"
value = "73"

[[rule.severity_mapping]]
field = "event.severity"
operator = "equals"
severity = "critical"
value = "99"


Stages and Predicates

Stage 1: query

event.kind: alert and data_stream.dataset: crowdstrike.alert

Indicators

These rows show field, operator, and value matches.

Curl or Wget Egress Network Connection via LoLBin

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

This rule detects the execution of curl or wget binaries through a GTFOBin (living-off-the-land) technique in Linux environments. Attackers may exploit these utilities to download and execute malicious files from the internet while attempting to evade detection. The rule specifically targets binaries that are capable of executing shell commands directly from the proxied binary, rather than just spawning a shell.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/11/20"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects the execution of curl or wget binaries through a GTFOBin (living-off-the-land) technique in Linux
environments. Attackers may exploit these utilities to download and execute malicious files from the internet while
attempting to evade detection. The rule specifically targets binaries that are capable of executing shell commands
directly from the proxied binary, rather than just spawning a shell.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-endpoint.events.network*"]
language = "eql"
license = "Elastic License v2"
name = "Curl or Wget Egress Network Connection via LoLBin"
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 Curl or Wget Egress Network Connection via LoLBin

This detects outbound connections from curl or wget when they are launched via living-off-the-land binaries that can execute shell commands, signaling proxy execution to mask activity. It matters because attackers abuse trusted utilities to fetch payloads, stage command-and-control, or exfiltrate while evading simple controls. Example: an attacker uses awk or busybox to run curl to an external host, downloads a script into /tmp, pipes it to sh, or saves a binary and runs it under the proxy’s context.

### Possible investigation steps

- Pull the full process tree around the event and review the parent LoLBin’s command line for signs of proxy execution such as pipelines to a shell, write-to-file flags (-o/-O), exfil options (--data/--upload-file), or TLS bypass (-k), noting working directory and effective user for context.
- Identify any paths or filenames used by the transfer and inspect the filesystem for newly created or modified artifacts in temp locations, recording hashes, timestamps, permission changes (e.g., chmod +x), and any immediate execution or persistence actions.
- Correlate the outbound destination with threat intelligence and internal allowlists, examine DNS/SNI/certificate details, and flag unusual ports or use of proxies/TOR that suggest evasion.
- Validate whether the parent LoLBin and its execution path align with legitimate software or maintenance workflows on the host, and broaden the search for similar executions across hosts within the same timeframe.
- Hunt for follow-on activity including new listeners, reverse shells, additional outbound beacons, or other GTFOBins invoking curl/wget, and tie findings back to the same domains/IPs or dropped filesystem artifacts.

### False positive analysis

- During legitimate dependency installation or build workflows, pip/npm/gem/bundler/yarn may run post-install hooks that invoke curl/wget to fetch supplemental files from public mirrors, with the package manager as the parent process.
- Operations or maintenance tasks may use watch/busybox/run-parts/awk to proxy execution of curl/wget for external availability checks or bootstrap downloads in init scripts, producing short-lived egress that matches the LoLBin-parent pattern.

### Response and remediation

- Immediately isolate the affected Linux host or apply an outbound block, terminate active curl/wget and their invoking LoLBins (e.g., awk, busybox, run-parts), and add temporary firewall/DNS rules to deny the contacted domain/IP and port.
- Enumerate and delete files fetched via curl/wget (-o/-O) in /tmp, /var/tmp, /dev/shm, and user home (including scripts piped to sh), remove any persistence added (new cron entries, systemd units, rc.local edits), and record hashes/paths for evidence.
- Rotate credentials or tokens exposed via -u/--header or ~/.netrc, purge malicious proxy settings and config files (http_proxy/https_proxy environment, ~/.wgetrc, ~/.curlrc), and revoke SSH keys or cookies discovered alongside the downloads.
- Restore the system by reimaging or reinstalling if tampering is suspected, re-enable egress only after validation, verify application functionality, and re-enroll the endpoint with EDR while limiting curl/wget usage to approved service accounts.
- Escalate to incident response if curl/wget is piped to a shell (e.g., curl https://... | sh), a downloaded binary is made executable and run (chmod +x followed by execution), the destination matches known malicious infrastructure, or torify/torsocks/proxy chaining is used.
- Harden by mounting /tmp, /var/tmp, and /dev/shm with noexec/nosuid/nodev, enforcing AppArmor/SELinux to restrict curl/wget network access and file writes, constraining GTFOBins from spawning shells, and requiring egress via a proxy allowlist with TLS validation (disallow --insecure/-k).
"""
references = ["https://gtfobins.github.io/#+shell"]
risk_score = 47
rule_id = "d1ee711a-a3ba-4d73-b5ab-84cab5b37fb3"
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",
    "Tactic: Execution",
    "Tactic: Command and Control",
    "Tactic: Exfiltration",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence with maxspan=3s
  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name in (
     "aa-exec", "aoss", "awk", "run-parts", "bundle", "bundler", "busctl", "busybox", "byebug", "c89", "c99", "cabal",
     "capsh", "cdist", "certbot", "check_by_ssh", "choom", "cobc", "cowsay", "cowthink", "cpio", "cpulimit", "csvtool",
     "dc", "distcc", "easy_install", "emacs", "enscript", "expect", "find", "flock", "gawk", "gcc", "gdb", "gem",
     "genie", "ghc", "ghci", "gimp", "grc", "gtester", "ionice", "irb", "jjs", "jrunscript", "knife", "latex",
     "latexmk", "lftp", "logsave", "ltrace", "mail", "mawk", "msgfilter", "multitime", "mysql", "nawk", "neofetch",
     "nice", "nohup", "npm", "nroff", "nsenter", "octave", "openvpn", "pandoc", "pdb", "pdflatex", "pdftex", "perf",
     "pexec", "pip", "rake", "rc", "rlwrap", "rpmdb", "rpmquery", "rpmverify", "rsync", "rtorrent", "runscript",
     "rview", "rvim", "script", "scrot", "sed", "service", "setarch", "setlock", "sg", "socat", "softlimit", "split",
     "sqlite3", "sqlmap", "sshpass", "start-stop-daemon", "stdbuf", "tar", "taskset",
     "tasksh", "tex", "time", "tmate", "torify", "torsocks", "tshark", "valgrind", "vi", "view",
     "vim", "vimdiff", "watch", "xdg-user-dir", "xdotool", "xelatex", "xetex", "yarn", "zip", "zypper"
   ) and not (
     process.executable == "/tmp/newroot/unshare" or
     process.parent.args in (
       "/etc/.agent/server_agent.sh", "/nessus/update2.sh", "/etc/cron.daily/spamassassin", "/etc/cron.daily/rkhunter",
       "buildkit-runc", "/usr/sbin/spamassassin-maint"
     ) or
     process.parent.executable like (
       "/usr/local/bin/fail2ban_cluster.sh", "/script/downloadArtifacts.sh", "/etc/cron.daily/rkhunter",
       "/usr/bin/bbb-conf", "/usr/sbin/sos", "/usr/bin/make", "/var/lib/amagent/*", "/etc/cron.daily/spamassassin",
       "/usr/lib/cron/run-crons", "/usr/sbin/spamassassin-maint", "/usr/sbin/oracle-libs-update"
     ) or
     process.parent.name in ("rkhunter", "vivaldi-stable.postinst", "runc") or
     process.parent.command_line == "runc init" or
     process.parent.command_line like "/home/*/bin/DownloadExchangeFiles_mcx*" or
     process.command_line in (
       "nice -10 /opt/aws/discovery/update", "xargs -n 1 curl -o lpsc -L", "/usr/bin/ruby /usr/bin/rake run:server_hooks",
       "nohup ./update2.sh"
     ) or
     process.parent.command_line in ("/bin/sh -c nice -n 15 $HOME/bin/cron.pl > /dev/null 2>&1", "/bin/sh /etc/cron.daily/rkhunter") or
     process.command_line like ("*/home/linuxbrew/.linuxbrew/*", "*Homebrew*", "*webhook*") or
     process.args like ("/usr/lib/jvm/*", "/root/.forge/provision-*.sh", "/usr/src/ucrm/scripts/update-certificates.sh", "/etc/periodic/weekly/update_mmdb.sh") or
     (process.name == "nohup" and process.command_line like "nohup /usr/*/*.sh") or
     (process.name == "julia" and process.parent.name == "julia")
   )
  ] by process.entity_id
  [network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and
   process.name in ("wget", "curl") 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"
     )
   )
  ] by process.parent.entity_id
'''

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

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

[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"

[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/"

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

[[rule.threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"

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

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

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

Stages and Predicates

Ordered sequence: each step below must occur in order within 3s, correlated by 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.name in (
     "aa-exec", "aoss", "awk", "run-parts", "bundle", "bundler", "busctl", "busybox", "byebug", "c89", "c99", "cabal",
     "capsh", "cdist", "certbot", "check_by_ssh", "choom", "cobc", "cowsay", "cowthink", "cpio", "cpulimit", "csvtool",
     "dc", "distcc", "easy_install", "emacs", "enscript", "expect", "find", "flock", "gawk", "gcc", "gdb", "gem",
     "genie", "ghc", "ghci", "gimp", "grc", "gtester", "ionice", "irb", "jjs", "jrunscript", "knife", "latex",
     "latexmk", "lftp", "logsave", "ltrace", "mail", "mawk", "msgfilter", "multitime", "mysql", "nawk", "neofetch",
     "nice", "nohup", "npm", "nroff", "nsenter", "octave", "openvpn", "pandoc", "pdb", "pdflatex", "pdftex", "perf",
     "pexec", "pip", "rake", "rc", "rlwrap", "rpmdb", "rpmquery", "rpmverify", "rsync", "rtorrent", "runscript",
     "rview", "rvim", "script", "scrot", "sed", "service", "setarch", "setlock", "sg", "socat", "softlimit", "split",
     "sqlite3", "sqlmap", "sshpass", "start-stop-daemon", "stdbuf", "tar", "taskset",
     "tasksh", "tex", "time", "tmate", "torify", "torsocks", "tshark", "valgrind", "vi", "view",
     "vim", "vimdiff", "watch", "xdg-user-dir", "xdotool", "xelatex", "xetex", "yarn", "zip", "zypper"
   ) and not (
     process.executable == "/tmp/newroot/unshare" or
     process.parent.args in (
       "/etc/.agent/server_agent.sh", "/nessus/update2.sh", "/etc/cron.daily/spamassassin", "/etc/cron.daily/rkhunter",
       "buildkit-runc", "/usr/sbin/spamassassin-maint"
     ) or
     process.parent.executable like (
       "/usr/local/bin/fail2ban_cluster.sh", "/script/downloadArtifacts.sh", "/etc/cron.daily/rkhunter",
       "/usr/bin/bbb-conf", "/usr/sbin/sos", "/usr/bin/make", "/var/lib/amagent/*", "/etc/cron.daily/spamassassin",
       "/usr/lib/cron/run-crons", "/usr/sbin/spamassassin-maint", "/usr/sbin/oracle-libs-update"
     ) or
     process.parent.name in ("rkhunter", "vivaldi-stable.postinst", "runc") or
     process.parent.command_line == "runc init" or
     process.parent.command_line like "/home/*/bin/DownloadExchangeFiles_mcx*" or
     process.command_line in (
       "nice -10 /opt/aws/discovery/update", "xargs -n 1 curl -o lpsc -L", "/usr/bin/ruby /usr/bin/rake run:server_hooks",
       "nohup ./update2.sh"
     ) or
     process.parent.command_line in ("/bin/sh -c nice -n 15 $HOME/bin/cron.pl > /dev/null 2>&1", "/bin/sh /etc/cron.daily/rkhunter") or
     process.command_line like ("*/home/linuxbrew/.linuxbrew/*", "*Homebrew*", "*webhook*") or
     process.args like ("/usr/lib/jvm/*", "/root/.forge/provision-*.sh", "/usr/src/ucrm/scripts/update-certificates.sh", "/etc/periodic/weekly/update_mmdb.sh") or
     (process.name == "nohup" and process.command_line like "nohup /usr/*/*.sh") or
     (process.name == "julia" and process.parent.name == "julia")
   )
  ] by process.entity_id

Stage 2: network

[network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and
   process.name in ("wget", "curl") 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"
     )
   )
  ] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted
  • exec
field:"EventType" kind:eq
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.namein
  • aa-exec
  • aoss
  • awk
  • bundle
  • bundler
  • busctl
  • busybox
  • byebug
  • c89
  • c99
  • cabal
  • capsh
  • cdist
  • certbot
  • check_by_ssh
  • choom
  • cobc
  • cowsay
  • cowthink
  • cpio
  • cpulimit
  • csvtool
  • curl
  • dc
  • distcc
  • easy_install
  • emacs
  • enscript
  • expect
  • find
  • flock
  • gawk
  • gcc
  • gdb
  • gem
  • genie
  • ghc
  • ghci
  • gimp
  • grc
  • +82 more values (see full rule source)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linewildcardnohup /usr/*/*.shexcludes:process.command_line field:"process.command_line" value:"nohup /usr/*/*.sh"
process.nameeqnohupexcludes:process.name field:"process.name" value:"nohup"
process.nameeqjuliaexcludes:process.name field:"process.name" value:"julia"
process.parent.nameeqjuliaexcludes:process.parent.name field:"process.parent.name" value:"julia"
process.argswildcard/usr/lib/jvm/*, /root/.forge/provision-*.sh, /usr/src/ucrm/scripts/update-certificates.sh, /etc/periodic/weekly/update_mmdb.shexcludes:process.args
process.command_linein/usr/bin/ruby /usr/bin/rake run:server_hooks, nice -10 /opt/aws/discovery/update, nohup ./update2.sh, xargs -n 1 curl -o lpsc -Lexcludes:process.command_line
process.command_linematch/home/linuxbrew/.linuxbrew/, Homebrew, webhookexcludes:process.command_line field:"process.command_line" value:"/home/linuxbrew/.linuxbrew/" field:"process.command_line" value:"Homebrew" field:"process.command_line" value:"webhook"
process.executableeq/tmp/newroot/unshareexcludes:process.executable field:"process.executable" value:"/tmp/newroot/unshare"
process.parent.argsin/etc/.agent/server_agent.sh, /etc/cron.daily/rkhunter, /etc/cron.daily/spamassassin, /nessus/update2.sh, /usr/sbin/spamassassin-maint, buildkit-runcexcludes:process.parent.args
process.parent.command_lineeqrunc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"runc init"
process.parent.command_linein/bin/sh -c nice -n 15 $HOME/bin/cron.pl > /dev/null 2>&1, /bin/sh /etc/cron.daily/rkhunterexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/sh -c nice -n 15 $HOME/bin/cron.pl > /dev/null 2>&1" field:"process.parent.command_line" value:"/bin/sh /etc/cron.daily/rkhunter"
process.parent.command_linewildcard/home/*/bin/DownloadExchangeFiles_mcx*excludes:process.parent.command_line field:"process.parent.command_line" value:"/home/*/bin/DownloadExchangeFiles_mcx*"
process.parent.executablewildcard/usr/local/bin/fail2ban_cluster.sh, /script/downloadArtifacts.sh, /etc/cron.daily/rkhunter, /usr/bin/bbb-conf, /usr/sbin/sos, /usr/bin/make, /var/lib/amagent/*, /etc/cron.daily/spamassassin, /usr/lib/cron/run-crons, /usr/sbin/spamassassin-maint, /usr/sbin/oracle-libs-updateexcludes:process.parent.executable
process.parent.nameinrkhunter, runc, vivaldi-stable.postinstexcludes:process.parent.name field:"process.parent.name" value:"rkhunter" field:"process.parent.name" value:"runc" field:"process.parent.name" value:"vivaldi-stable.postinst"
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::/8excludes: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

CVE-2023-0386 Exploitation Attempt

#
Source
github.com/elastic/protections-artifacts

Detects an attempt to exploit the CVE-2023-0386 local privilege escalation vulnerability.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[rule]
description = "Detects an attempt to exploit the CVE-2023-0386 local privilege escalation vulnerability."
id = "22145fc0-dc4c-4187-8397-4d20162fc391"
license = "Elastic License v2"
name = "CVE-2023-0386 Exploitation Attempt"
os_list = ["linux"]
reference = [
    "https://securityonline.info/poc-exploit-released-for-linux-kernel-privilege-escalation-cve-2023-0386-bug/",
    "https://github.com/xkaneiki/CVE-2023-0386",
]
version = "1.0.12"

query = '''
process where event.type == "start" and event.action == "exec" and 
    process.name : "fusermount*" and 
    process.args : "-o" and 
    process.args : "rw,nosuid,nodev" and 
    process.args : "./*" and 
    process.parent.name : "fuse"
'''

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

[[actions]]
action = "kill_process"
field = "process.parent.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.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and 
    process.name : "fusermount*" and 
    process.args : "-o" and 
    process.args : "rw,nosuid,nodev" and 
    process.args : "./*" and 
    process.parent.name : "fuse"

Indicators

These rows show field, operator, and value matches.

Dual Persistence via Startup and Scheduled Task

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

Identifies the creation of two persistence items via startup followed by scheduled task by an unsigned executable. Adversaries may use this technique to maintain multiple methods of persistence on an endpoint.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the creation of two persistence items via startup followed by scheduled task by an unsigned executable.
Adversaries may use this technique to maintain multiple methods of persistence on an endpoint.
"""
id = "8eb8bf95-872b-43c9-9f7c-528d795d6b4e"
license = "Elastic License v2"
name = "Dual Persistence via Startup and Scheduled Task"
os_list = ["windows"]
reference = ["https://docs.microsoft.com/en-us/previous-versions/technet-magazine/ee851671(v=msdn.10)"]
version = "1.0.16"

query = '''
sequence with maxspan=3m
 [any where event.category in ("registry", "file") and
  process.executable : ("?:\\*", "\\Device\\Mup*") and
  event.action != "deletion" and user.id like ("S-1-5-21*", "S-1-12-*") and 
  not process.code_signature.status like ("trusted", "errorExpired", "errorCode_endpoint*") and 
   (
    (registry.data.strings != null and 
     not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and
     registry.path :
              ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
	       "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
	       "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
	       "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load", 
	       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
	       "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript", 
	       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun")) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and not file.name : "desktop.ini")
   )] by process.entity_id
  [file where event.action != "deletion" and
   file.path : "?:\\Windows\\System32\\Tasks\\*" and file.name != null] by Effective_process.entity_id
'''

min_endpoint_version = "8.4.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.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"


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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: any

[any where event.category in ("registry", "file") and
  process.executable : ("?:\\*", "\\Device\\Mup*") and
  event.action != "deletion" and user.id like ("S-1-5-21*", "S-1-12-*") and 
  not process.code_signature.status like ("trusted", "errorExpired", "errorCode_endpoint*") and 
   (
    (registry.data.strings != null and 
     not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and
     registry.path :
              ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
	       "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
	       "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
	       "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load", 
	       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
	       "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript", 
	       "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec", 
	       "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun")) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and not file.name : "desktop.ini")
   )] by process.entity_id

Stage 2: file

[file where event.action != "deletion" and
   file.path : "?:\\Windows\\System32\\Tasks\\*" and file.name != null] by Effective_process.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
event.categoryin
  • file corpus 15 (elastic 15)
  • registry corpus 10 (elastic 10)
field:"event.category" kind:in
file.nameis_not_null
  • (no value, null check)
field:"file.name" kind:is_not_null
file.pathwildcard
  • ?:\*\Microsoft\Windows\Start Menu\Programs\Startup\* corpus 9 (elastic 9)
  • ?:\Windows\System32\Tasks\* corpus 6 (elastic 6)
field:"TargetFilename" kind:wildcard
process.executablewildcard
  • ?:\* corpus 18 (elastic 18)
  • \Device\Mup* corpus 4 (elastic 4)
field:"Image" kind:wildcard
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.pathwildcard
  • H*\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\Microsoft\Windows\CurrentVersion\Run\* corpus 12 (elastic 12)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run\* corpus 11 (elastic 11)
  • HKEY_USERS\*\Environment\UserInitMprLogonScript corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Command Processor\Autorun corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Ctf\LangBarAddin\*\FilePath corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Internet Explorer\Extensions\*\Exec corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\Load corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Shell corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logoff\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logon\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\Script corpus 11 (elastic 11)
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 8 (elastic 8)
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit corpus 8 (elastic 8)
field:"TargetObject" kind:wildcard
user.idwildcard
  • S-1-12-* corpus 21 (elastic 21)
  • S-1-5-21* corpus 21 (elastic 21)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Execution via Obfuscated PowerShell Script

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of PowerShell with potentially obfuscated content. This behavior is often observed during malware installation leveraging PowerShell.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of PowerShell with potentially obfuscated content. This behavior is often observed during
malware installation leveraging PowerShell.
"""
id = "ce95fc52-051e-4409-9c99-f2daf3e6e609"
license = "Elastic License v2"
name = "Execution via Obfuscated PowerShell Script"
os_list = ["windows"]
version = "1.0.11"

query = '''
api where process.Ext.api.name == "AmsiScanBuffer" and
 process.name : "powershell.exe" and user.id != "S-1-5-18" and

  /* obfuscated content */
  process.Ext.api.parameters.buffer : ("*-bxor*", "*:sptth*", "*//:p##h*", "*.rEplAcE(([chAr]*", "*$pShOMe[*", "*$ShellId[*", "*$env:Public[*",
  "*$env:ComSpec[*", "*ecalper-*", "*]rahc[*", "*NoiSsErpXe-eKoVNi*", "*elbairav-*", "*ECNErEFERpESObREv$*", "*.Name[3,11,2]*",
  "*sailA-teS*", "*]rtPtnI[*", "*-ekovnI*", "*TVqQAAMAAAAEAAAA*", "*System.Management.Automation.$([cHAr]*") and

  not (process.Ext.api.parameters.buffer : "*-bxor*" and process.Ext.api.parameters.buffer : "#powershellskript *") and
  not (process.Ext.api.parameters.buffer : "*-bxor*" and process.Ext.api.parameters.buffer : ("*-bxor 0xFFFF0000*", "*Ansible.Basic.AnsibleModule*")) and
  not (process.Ext.api.parameters.buffer : ("function Get-DbaProductKey*", "function Invoke-DbaDbDecryptObjec*") and process.Ext.api.parameters.buffer : "* -bxor *") and
  not (process.Ext.api.parameters.size >= 155000 and process.Ext.api.parameters.buffer : "*HSTITest_Encoded*TVqQAAMAAAAEAAAA*") and
  not (process.Ext.api.parameters.size == 38324 and
       process.command_line : "*AkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApAC*") and
  not process.Ext.api.parameters.content_name :
                    ("?:\\Program Files\\*.ps1",
                     "?:\\Program Files (x86)\\*.ps1",
                     "D:\\*", "E:\\*", "F:\\*", "I:\\*", "X:\\*",
                     "C:\\ProgramData\\NinjaRMMAgent\\scripting\\*.ps1",
                     "C:\\ProgramData\\chocolatey\\*.ps1",
                     "C:\\WINDOWS\\IMECache\\*",
                     "C:\\ProgramData\\CentraStage\\Packages\\*\\command.ps1") and
  not process.command_line : "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -windowstyle hidden -nologo Invoke-Expression $env:Include" and
  not process.parent.executable : ("C:\\Program Files (x86)\\ManageSoft\\Tracker\\ndtrack.exe",
                                   "C:\\Program Files (x86)\\CentraStage\\Gui.exe",
                                   "C:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShell.exe",
                                   "C:\\Program Files\\SentinelOne\\Sentinel Agent *\\Addons\\SentinelAddonHost.exe",
                                   "C:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShellService.exe",
                                   "C:\\Program Files\\Microsoft VS Code\\Code.exe",
                                   "C:\\Windows\\System32\\gpscript.exe",
                                   "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                   "C:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe",
                                   "C:\\Windows\\System32\\drivers\\Intel\\ICPS\\IntelConnectivityNetworkService.exe",
                                   "C:\\Program Files\\Axis Communications\\AXIS Camera Station\\Components\\AXIS System Health Monitoring\\AXISSystemHealthMonitoring.exe")
'''

min_endpoint_version = "8.16.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "AmsiScanBuffer" and
 process.name : "powershell.exe" and user.id != "S-1-5-18" and
  process.Ext.api.parameters.buffer : ("*-bxor*", "*:sptth*", "*//:p##h*", "*.rEplAcE(([chAr]*", "*$pShOMe[*", "*$ShellId[*", "*$env:Public[*",
  "*$env:ComSpec[*", "*ecalper-*", "*]rahc[*", "*NoiSsErpXe-eKoVNi*", "*elbairav-*", "*ECNErEFERpESObREv$*", "*.Name[3,11,2]*",
  "*sailA-teS*", "*]rtPtnI[*", "*-ekovnI*", "*TVqQAAMAAAAEAAAA*", "*System.Management.Automation.$([cHAr]*") and
  not (process.Ext.api.parameters.buffer : "*-bxor*" and process.Ext.api.parameters.buffer : "#powershellskript *") and
  not (process.Ext.api.parameters.buffer : "*-bxor*" and process.Ext.api.parameters.buffer : ("*-bxor 0xFFFF0000*", "*Ansible.Basic.AnsibleModule*")) and
  not (process.Ext.api.parameters.buffer : ("function Get-DbaProductKey*", "function Invoke-DbaDbDecryptObjec*") and process.Ext.api.parameters.buffer : "* -bxor *") and
  not (process.Ext.api.parameters.size >= 155000 and process.Ext.api.parameters.buffer : "*HSTITest_Encoded*TVqQAAMAAAAEAAAA*") and
  not (process.Ext.api.parameters.size == 38324 and
       process.command_line : "*AkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApAC*") and
  not process.Ext.api.parameters.content_name :
                    ("?:\\Program Files\\*.ps1",
                     "?:\\Program Files (x86)\\*.ps1",
                     "D:\\*", "E:\\*", "F:\\*", "I:\\*", "X:\\*",
                     "C:\\ProgramData\\NinjaRMMAgent\\scripting\\*.ps1",
                     "C:\\ProgramData\\chocolatey\\*.ps1",
                     "C:\\WINDOWS\\IMECache\\*",
                     "C:\\ProgramData\\CentraStage\\Packages\\*\\command.ps1") and
  not process.command_line : "\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -windowstyle hidden -nologo Invoke-Expression $env:Include" and
  not process.parent.executable : ("C:\\Program Files (x86)\\ManageSoft\\Tracker\\ndtrack.exe",
                                   "C:\\Program Files (x86)\\CentraStage\\Gui.exe",
                                   "C:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShell.exe",
                                   "C:\\Program Files\\SentinelOne\\Sentinel Agent *\\Addons\\SentinelAddonHost.exe",
                                   "C:\\Program Files (x86)\\Spiceworks Agent Shell\\AgentShellService.exe",
                                   "C:\\Program Files\\Microsoft VS Code\\Code.exe",
                                   "C:\\Windows\\System32\\gpscript.exe",
                                   "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                   "C:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe",
                                   "C:\\Windows\\System32\\drivers\\Intel\\ICPS\\IntelConnectivityNetworkService.exe",
                                   "C:\\Program Files\\Axis Communications\\AXIS Camera Station\\Components\\AXIS System Health Monitoring\\AXISSystemHealthMonitoring.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • AmsiScanBuffer corpus 18 (elastic 18)
field:"process.Ext.api.name" kind:eq value:"AmsiScanBuffer"
process.Ext.api.parameters.bufferwildcard
  • *$ShellId[*
  • *$env:ComSpec[*
  • *$env:Public[*
  • *$pShOMe[*
  • *-bxor*
  • *-ekovnI*
  • *.Name[3,11,2]*
  • *.rEplAcE(([chAr]*
  • *//:p##h*
  • *:sptth*
  • *ECNErEFERpESObREv$*
  • *NoiSsErpXe-eKoVNi*
  • *System.Management.Automation.$([cHAr]*
  • *TVqQAAMAAAAEAAAA*
  • *]rahc[*
  • *]rtPtnI[*
  • *ecalper-*
  • *elbairav-*
  • *sailA-teS*
field:"process.Ext.api.parameters.buffer" kind:wildcard
process.namewildcard
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
field:"process_basename" kind:wildcard value:"powershell.exe"
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.Ext.api.parameters.buffermatch -bxor excludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:" -bxor "
process.Ext.api.parameters.bufferstarts_withfunction Get-DbaProductKey, function Invoke-DbaDbDecryptObjecexcludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:"function Get-DbaProductKey" field:"process.Ext.api.parameters.buffer" value:"function Invoke-DbaDbDecryptObjec"
process.Ext.api.parameters.buffermatch-bxor 0xFFFF0000, Ansible.Basic.AnsibleModuleexcludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:"-bxor 0xFFFF0000" field:"process.Ext.api.parameters.buffer" value:"Ansible.Basic.AnsibleModule"
process.Ext.api.parameters.buffermatch-bxorexcludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:"-bxor"
process.Ext.api.parameters.bufferstarts_with#powershellskript excludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:"#powershellskript "
process.Ext.api.parameters.bufferwildcard*HSTITest_Encoded*TVqQAAMAAAAEAAAA*excludes:process.Ext.api.parameters.buffer field:"process.Ext.api.parameters.buffer" value:"*HSTITest_Encoded*TVqQAAMAAAAEAAAA*"
process.Ext.api.parameters.sizege155000excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"155000"
process.Ext.api.parameters.sizeeq38324excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"38324"
process.command_linematchAkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApACexcludes:process.command_line field:"process.command_line" value:"AkAGUAeABlAGMAXwB3AHIAYQBwAHAAZQByAF8AcwB0AHIALgBTAHAAbABpAHQAKABAACgAIgBgADAAYAAwAGAAMABgADAAIgApAC"
process.Ext.api.parameters.content_namewildcard?:\Program Files\*.ps1, ?:\Program Files (x86)\*.ps1, D:\*, E:\*, F:\*, I:\*, X:\*, C:\ProgramData\NinjaRMMAgent\scripting\*.ps1, C:\ProgramData\chocolatey\*.ps1, C:\WINDOWS\IMECache\*, C:\ProgramData\CentraStage\Packages\*\command.ps1excludes:process.Ext.api.parameters.content_name
process.command_lineeq"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -windowstyle hidden -nologo Invoke-Expression $env:Includeexcludes:process.command_line
process.parent.executablewildcardC:\Program Files (x86)\ManageSoft\Tracker\ndtrack.exe, C:\Program Files (x86)\CentraStage\Gui.exe, C:\Program Files (x86)\Spiceworks Agent Shell\AgentShell.exe, C:\Program Files\SentinelOne\Sentinel Agent *\Addons\SentinelAddonHost.exe, C:\Program Files (x86)\Spiceworks Agent Shell\AgentShellService.exe, C:\Program Files\Microsoft VS Code\Code.exe, C:\Windows\System32\gpscript.exe, C:\Program Files\Windows Defender Advanced Threat Protection\SenseIR.exe, C:\Program Files (x86)\Microsoft Intune Management Extension\AgentExecutor.exe, C:\Windows\System32\drivers\Intel\ICPS\IntelConnectivityNetworkService.exe, C:\Program Files\Axis Communications\AXIS Camera Station\Components\AXIS System Health Monitoring\AXISSystemHealthMonitoring.exeexcludes:process.parent.executable

File Downloaded via Curl or Wget to Hidden Directory

#
Source
github.com/elastic/protections-artifacts

This rule detects when the curl or wget command is used to download a file to a writeable hidden directory, such as /tmp, /var/tmp, or /dev/shm. This behavior is used by threat actors to evade detection and may indicate command and control activity.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
This rule detects when the curl or wget command is used to download a file to a writeable hidden directory, such as
/tmp, /var/tmp, or /dev/shm. This behavior is used by threat actors to evade detection and may indicate command and
control activity.
"""
id = "dc1cee03-4923-4c6b-b00b-8a5c323bb753"
license = "Elastic License v2"
name = "File Downloaded via Curl or Wget to Hidden Directory"
os_list = ["linux"]
version = "1.0.12"

query = '''
process where event.type == "start" and event.action == "exec" and (
  (process.name == "wget" and process.args like ("-o", "--output-*") and
   process.args like ("/tmp*/.*", "/var/tmp*/.*", "/dev/shm/*", "-o-")) or
  (process.name == "curl" and process.args in ("--output", "-o") and
   process.args like ("/tmp*/.*", "/var/tmp*/.*", "/dev/shm/*"))
) and not (
  process.parent.executable in (
    "/Tools/aw_api.sh", "tools/dialyzer/run.sh", "/bin/kubectl", "/srv/kube-proxy-run", "/srv/kubelet/run",
    "/usr/bin/makepkg"
  ) or
  process.parent.executable like ("/run/containerd/*", "/tmp/.mount_vagran*/usr/bin/ruby") or
  process.parent.command_line in ("bash /usr/bin/maldet -u", "runc init") or
  process.command_line like (
    "*/tmp/.dialyzer_analysis*", "*.ansible*", "curl -s https://gist.githubusercontent.com/*bashrc_downlord",
    "*github.com/prefix-dev/pixi*", "*heroku-java-metrics-agent*"
  ) or
  process.args like (
    "https://release-registry.services.sentry.io/apps/sentry-cli/*package=sentry-cli",
    "https*github*astral-sh/rye/*",
    "https://github.com/codecrafters-io/*"
  ) or
  process.working_directory like ("/tmp/wbrashear/easybuild/*", "/var/tmp/pamac-build-*")
)
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"


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

[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

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  (process.name == "wget" and process.args like ("-o", "--output-*") and
   process.args like ("/tmp*/.*", "/var/tmp*/.*", "/dev/shm/*", "-o-")) or
  (process.name == "curl" and process.args in ("--output", "-o") and
   process.args like ("/tmp*/.*", "/var/tmp*/.*", "/dev/shm/*"))
) and not (
  process.parent.executable in (
    "/Tools/aw_api.sh", "tools/dialyzer/run.sh", "/bin/kubectl", "/srv/kube-proxy-run", "/srv/kubelet/run",
    "/usr/bin/makepkg"
  ) or
  process.parent.executable like ("/run/containerd/*", "/tmp/.mount_vagran*/usr/bin/ruby") or
  process.parent.command_line in ("bash /usr/bin/maldet -u", "runc init") or
  process.command_line like (
    "*/tmp/.dialyzer_analysis*", "*.ansible*", "curl -s https://gist.githubusercontent.com/*bashrc_downlord",
    "*github.com/prefix-dev/pixi*", "*heroku-java-metrics-agent*"
  ) or
  process.args like (
    "https://release-registry.services.sentry.io/apps/sentry-cli/*package=sentry-cli",
    "https*github*astral-sh/rye/*",
    "https://github.com/codecrafters-io/*"
  ) or
  process.working_directory like ("/tmp/wbrashear/easybuild/*", "/var/tmp/pamac-build-*")
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcardhttps://release-registry.services.sentry.io/apps/sentry-cli/*package=sentry-cli, https*github*astral-sh/rye/*, https://github.com/codecrafters-io/*excludes:process.args field:"process.args" value:"https://release-registry.services.sentry.io/apps/sentry-cli/*package=sentry-cli" field:"process.args" value:"https*github*astral-sh/rye/*" field:"process.args" value:"https://github.com/codecrafters-io/*"
process.command_linewildcard*/tmp/.dialyzer_analysis*, *.ansible*, curl -s https://gist.githubusercontent.com/*bashrc_downlord, *github.com/prefix-dev/pixi*, *heroku-java-metrics-agent*excludes:process.command_line
process.parent.command_lineinbash /usr/bin/maldet -u, runc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"bash /usr/bin/maldet -u" field:"process.parent.command_line" value:"runc init"
process.parent.executablein/Tools/aw_api.sh, /bin/kubectl, /srv/kube-proxy-run, /srv/kubelet/run, /usr/bin/makepkg, tools/dialyzer/run.shexcludes:process.parent.executable
process.parent.executablewildcard/run/containerd/*, /tmp/.mount_vagran*/usr/bin/rubyexcludes:process.parent.executable field:"process.parent.executable" value:"/run/containerd/*" field:"process.parent.executable" value:"/tmp/.mount_vagran*/usr/bin/ruby"
process.working_directorystarts_with/tmp/wbrashear/easybuild/, /var/tmp/pamac-build-excludes:process.working_directory field:"process.working_directory" value:"/tmp/wbrashear/easybuild/" field:"process.working_directory" value:"/var/tmp/pamac-build-"

GKE Creation or Modification of Sensitive Role

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

Detects creation or modification of GKE Roles or ClusterRoles that grant high-risk permissions, such as wildcard access or RBAC escalation verbs (bind, escalate, impersonate), which may enable privilege escalation or unauthorized access within the cluster.

Known False Positives

  • Platform installers, GitOps controllers, and RBAC refactoring may legitimately create roles with broad permissions. Baseline approved automation and tune exclusions for known operators.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/07/10"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/10"

[rule]
author = ["Elastic"]
description = """
Detects creation or modification of GKE Roles or ClusterRoles that grant high-risk permissions, such as wildcard
access or RBAC escalation verbs (bind, escalate, impersonate), which may enable privilege escalation or unauthorized
access within the cluster.
"""
false_positives = [
    """
    Platform installers, GitOps controllers, and RBAC refactoring may legitimately create roles with broad permissions.
    Baseline approved automation and tune exclusions for known operators.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Creation or Modification of Sensitive Role"
note = """## Triage and analysis

### Investigating GKE Creation or Modification of Sensitive Role

This rule detects allowed create, update, or patch actions on Roles and ClusterRoles that introduce high-risk RBAC
permissions, including wildcard access and escalation verbs like bind, escalate, or impersonate.

### Possible investigation steps

- Identify `client.user.email`, `source.ip`, and `user_agent.original`.
- Review `gcp.audit.resource_name`, `event.action`, and `gcp.audit.request` for the changed role.
- Enumerate RoleBindings or ClusterRoleBindings that reference the role and hunt for follow-on secret or exec activity.

### False positive analysis

- GitOps or platform bootstrap may create broad roles during onboarding. `system:addon-manager` patch reconciliation on built-in Roles and ClusterRoles is excluded.

### Response and remediation

- Revert unauthorized roles, remove unexpected bindings, and restrict RBAC change permissions to governed pipelines.

"""
setup = "The GCP Fleet integration with GKE audit logs enabled is required. Request body capture on RBAC resources is required."
references = [
    "https://kubernetes.io/docs/reference/access-authn-authz/rbac/",
    "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "2af7f1d7-d02c-476f-a130-e17ea4e556e6"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
  "io.k8s.authorization.rbac.v1.roles.create" or
  "io.k8s.authorization.rbac.v1.roles.update" or
  "io.k8s.authorization.rbac.v1.roles.patch" or
  "io.k8s.authorization.rbac.v1.clusterroles.create" or
  "io.k8s.authorization.rbac.v1.clusterroles.update" or
  "io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not source.ip:("::1" or "127.0.0.1") and not (
  client.user.email:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" and
  gcp.audit.request.metadata.name:(admin or edit) and
  event.action:"io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not (
  client.user.email:"system:addon-manager" and
  event.action:(
    "io.k8s.authorization.rbac.v1.roles.patch" or
    "io.k8s.authorization.rbac.v1.clusterroles.patch"
  )
) and (
  gcp.audit.request.rules.verbs:("*" or escalate or bind or impersonate) or
  (
    gcp.audit.request.rules.verbs:("*" or create or patch or update) and
    gcp.audit.request.rules.resources:(
      "*" or clusterroles or clusterrolebindings or roles or rolebindings or
      pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
    )
  ) or
  (
    gcp.audit.request.rules.verbs:("*" or get or list) and
    gcp.audit.request.rules.resources:("*" or secrets)
  ) or
  gcp.audit.response.rules.verbs:("*" or escalate or bind or impersonate) or
  (
    gcp.audit.response.rules.verbs:("*" or create or patch or update) and
    gcp.audit.response.rules.resources:(
      "*" or clusterroles or clusterrolebindings or roles or rolebindings or
      pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
    )
  ) or
  (
    gcp.audit.response.rules.verbs:("*" or get or list) and
    gcp.audit.response.rules.resources:("*" or secrets)
  )
)
'''

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.006"
name = "Additional Container Cluster Roles"
reference = "https://attack.mitre.org/techniques/T1098/006/"

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "client.user.email",
    "source.ip",
    "user_agent.original",
    "event.action",
    "event.outcome",
    "gcp.audit.resource_name",
    "gcp.audit.request.kind",
    "data_stream.namespace",
]

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:(
  "io.k8s.authorization.rbac.v1.roles.create" or
  "io.k8s.authorization.rbac.v1.roles.update" or
  "io.k8s.authorization.rbac.v1.roles.patch" or
  "io.k8s.authorization.rbac.v1.clusterroles.create" or
  "io.k8s.authorization.rbac.v1.clusterroles.update" or
  "io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not source.ip:("::1" or "127.0.0.1") and not (
  client.user.email:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" and
  gcp.audit.request.metadata.name:(admin or edit) and
  event.action:"io.k8s.authorization.rbac.v1.clusterroles.patch"
) and not (
  client.user.email:"system:addon-manager" and
  event.action:(
    "io.k8s.authorization.rbac.v1.roles.patch" or
    "io.k8s.authorization.rbac.v1.clusterroles.patch"
  )
) and (
  gcp.audit.request.rules.verbs:("*" or escalate or bind or impersonate) or
  (
    gcp.audit.request.rules.verbs:("*" or create or patch or update) and
    gcp.audit.request.rules.resources:(
      "*" or clusterroles or clusterrolebindings or roles or rolebindings or
      pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
    )
  ) or
  (
    gcp.audit.request.rules.verbs:("*" or get or list) and
    gcp.audit.request.rules.resources:("*" or secrets)
  ) or
  gcp.audit.response.rules.verbs:("*" or escalate or bind or impersonate) or
  (
    gcp.audit.response.rules.verbs:("*" or create or patch or update) and
    gcp.audit.response.rules.resources:(
      "*" or clusterroles or clusterrolebindings or roles or rolebindings or
      pods/exec or serviceaccounts/token or nodes/proxy or daemonsets
    )
  ) or
  (
    gcp.audit.response.rules.verbs:("*" or get or list) and
    gcp.audit.response.rules.resources:("*" or secrets)
  )
)

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.authorization.rbac.v1.clusterroles.create corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.clusterroles.patch corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.clusterroles.update corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.roles.create corpus 2 (elastic 2)
  • io.k8s.authorization.rbac.v1.roles.patch corpus 3 (elastic 3)
  • io.k8s.authorization.rbac.v1.roles.update corpus 3 (elastic 3)
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
gcp.audit.request.rules.resourcesin
  • * corpus 2 (elastic 2)
  • clusterrolebindings corpus 2 (elastic 2)
  • clusterroles corpus 2 (elastic 2)
  • daemonsets corpus 2 (elastic 2)
  • nodes/proxy corpus 2 (elastic 2)
  • pods/exec corpus 2 (elastic 2)
  • rolebindings corpus 2 (elastic 2)
  • roles corpus 2 (elastic 2)
  • secrets corpus 2 (elastic 2)
  • serviceaccounts/token corpus 2 (elastic 2)
field:"gcp.audit.request.rules.resources" kind:in
gcp.audit.request.rules.verbsin
  • * corpus 2 (elastic 2)
  • bind corpus 2 (elastic 2)
  • create corpus 2 (elastic 2)
  • escalate corpus 2 (elastic 2)
  • get corpus 2 (elastic 2)
  • impersonate corpus 2 (elastic 2)
  • list corpus 2 (elastic 2)
  • patch corpus 2 (elastic 2)
  • update corpus 2 (elastic 2)
field:"gcp.audit.request.rules.verbs" kind:in
gcp.audit.response.rules.resourcesin
  • *
  • clusterrolebindings
  • clusterroles
  • daemonsets
  • nodes/proxy
  • pods/exec
  • rolebindings
  • roles
  • secrets
  • serviceaccounts/token
field:"gcp.audit.response.rules.resources" kind:in
gcp.audit.response.rules.verbsin
  • *
  • bind
  • create
  • escalate
  • get
  • impersonate
  • list
  • patch
  • update
field:"gcp.audit.response.rules.verbs" kind:in
service.nameeq
  • k8s.io corpus 28 (elastic 28)
field:"ServiceName" kind:eq value:"k8s.io"

Exclusions

The rule actively suppresses these predicates.

GKE Suspicious Assignment of Controller Service Account

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

Detects a request to attach a built-in kube-controller-manager service account to a pod running in the kube-system namespace on GKE. These service accounts are admin-equivalent and are not normally assigned to arbitrary pods. An attacker who can create pods in kube-system can abuse these tokens for cluster-wide privilege escalation.

Known False Positives

  • Built-in controller service accounts are rarely assigned to running pods. False positives should be rare; allowlist documented platform automation by actor when baselined.

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Telemetry Coverage

PlatformRecord / event type
Kubernetescreate-pods: create pods

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/07/10"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/07/10"

[rule]
author = ["Elastic"]
description = """
Detects a request to attach a built-in kube-controller-manager service account to a pod running in the kube-system
namespace on GKE. These service accounts are admin-equivalent and are not normally assigned to arbitrary pods. An attacker
who can create pods in kube-system can abuse these tokens for cluster-wide privilege escalation.
"""
false_positives = [
    """
    Built-in controller service accounts are rarely assigned to running pods. False positives should be rare; allowlist
    documented platform automation by actor when baselined.
    """,
]
from = "now-6m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Suspicious Assignment of Controller Service Account"
note = """## Triage and analysis

### Investigating GKE Suspicious Assignment of Controller Service Account

This rule flags pod create events in kube-system that assign a built-in kube-controller-manager service account.

### Possible investigation steps

- Review `client.user.email`, `gcp.audit.request.spec.serviceAccountName`, and container images.
- Determine whether the pod aligns with expected platform operations.
- Assess permissions of the assigned service account and hunt for follow-on secret or RBAC activity.

### False positive analysis

- Built-in controller service accounts should not be mounted on user-created pods. Allowlist known automation by actor if a documented exception exists.

### Response and remediation

- Delete suspicious pods, revoke the service account token, and restrict pod create permissions in kube-system.

"""
setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."
references = [
    "https://www.paloaltonetworks.com/apps/pan/public/downloadResource?pagePath=/content/pan/en_US/resources/whitepapers/kubernetes-privilege-escalation-excessive-permissions-in-popular-platforms",
    "https://kubernetes.io/docs/reference/access-authn-authz/rbac/#controller-roles",
]
risk_score = 47
rule_id = "e2f60d42-e0ea-4a03-a151-942bb5b86c0b"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:"io.k8s.core.v1.pods.create" and gcp.audit.request.metadata.namespace:"kube-system" and
gcp.audit.request.spec.serviceAccountName:(
  attachdetach-controller or certificate-controller or cloud-provider or
  clusterrole-aggregation-controller or cronjob-controller or daemon-set-controller or deployment-controller or
  disruption-controller or endpoint-controller or expand-controller or generic-garbage-collector or
  horizontal-pod-autoscaler or job-controller or namespace-controller or node-controller or
  persistent-volume-binder or pod-garbage-collector or pv-protection-controller or pvc-protection-controller or
  replicaset-controller or replication-controller or resourcequota-controller or root-ca-cert-publisher or
  route-controller or service-account-controller or service-controller or statefulset-controller or ttl-controller
)
'''

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

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[[rule.threat.technique.subtechnique]]
id = "T1078.001"
name = "Default Accounts"
reference = "https://attack.mitre.org/techniques/T1078/001/"

[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/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "client.user.email",
    "source.ip",
    "user_agent.original",
    "event.action",
    "event.outcome",
    "gcp.audit.resource_name",
    "gcp.audit.request.spec.serviceAccountName",
    "gcp.audit.request.spec.containers.image",
    "data_stream.namespace",
]

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and
event.action:"io.k8s.core.v1.pods.create" and gcp.audit.request.metadata.namespace:"kube-system" and
gcp.audit.request.spec.serviceAccountName:(
  attachdetach-controller or certificate-controller or cloud-provider or
  clusterrole-aggregation-controller or cronjob-controller or daemon-set-controller or deployment-controller or
  disruption-controller or endpoint-controller or expand-controller or generic-garbage-collector or
  horizontal-pod-autoscaler or job-controller or namespace-controller or node-controller or
  persistent-volume-binder or pod-garbage-collector or pv-protection-controller or pvc-protection-controller or
  replicaset-controller or replication-controller or resourcequota-controller or root-ca-cert-publisher or
  route-controller or service-account-controller or service-controller or statefulset-controller or ttl-controller
)

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.actioneq
  • io.k8s.core.v1.pods.create corpus 3 (elastic 3)
field:"EventType" kind:eq value:"io.k8s.core.v1.pods.create"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
gcp.audit.request.metadata.namespaceeq
  • kube-system
field:"gcp.audit.request.metadata.namespace" kind:eq value:"kube-system"
gcp.audit.request.spec.serviceAccountNamein
  • attachdetach-controller
  • certificate-controller
  • cloud-provider
  • clusterrole-aggregation-controller
  • cronjob-controller
  • daemon-set-controller
  • deployment-controller
  • disruption-controller
  • endpoint-controller
  • expand-controller
  • generic-garbage-collector
  • horizontal-pod-autoscaler
  • job-controller
  • namespace-controller
  • node-controller
  • persistent-volume-binder
  • pod-garbage-collector
  • pv-protection-controller
  • pvc-protection-controller
  • replicaset-controller
  • replication-controller
  • resourcequota-controller
  • root-ca-cert-publisher
  • route-controller
  • service-account-controller
  • service-controller
  • statefulset-controller
  • ttl-controller
field:"gcp.audit.request.spec.serviceAccountName" kind:in
service.nameeq
  • k8s.io corpus 28 (elastic 28)
field:"ServiceName" kind:eq value:"k8s.io"

JAVA Application Execution from Suspicious Paths

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

Identifies the execution of a Java JAR application from suspicious file paths such as downloads and compression utilities extraction paths.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a Java JAR application from suspicious file paths such as downloads and compression
utilities extraction paths.
"""
id = "b5d02713-e392-47c4-b38b-10b68dbc00a6"
license = "Elastic License v2"
name = "JAVA Application Execution from Suspicious Paths"
os_list = ["windows"]
version = "1.0.5"

query = '''
sequence by process.entity_id with maxspan=5s
[process where event.action == "start" and
  process.name : "javaw.exe" and process.args_count == 3 and process.args : "-jar" and
  process.args :
             ("C:\\Users\\*\\Downloads\\*.jar",
              "c:\\Users\\*\\Desktop\\*.jar",
              "C:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
              "C:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
              "C:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
              "C:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*")
  ]
[network where event.action in ("connection_accepted", "connection_attempted") and
 not 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.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", "129.153.192.0/19", "128.194.0.0/16") and
 not (process.executable : "C:\\Program Files\\Amazon Corretto\\jdk*\\bin\\javaw.exe" and destination.ip == "164.154.131.141") and
 not (process.executable : "C:\\Program Files\\Zulu\\zulu-??\\bin\\javaw.exe" and destination.ip == "146.75.93.145")]
'''

min_endpoint_version = "7.16.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"


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

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
  process.name : "javaw.exe" and process.args_count == 3 and process.args : "-jar" and
  process.args :
             ("C:\\Users\\*\\Downloads\\*.jar",
              "c:\\Users\\*\\Desktop\\*.jar",
              "C:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
              "C:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
              "C:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
              "C:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*")
  ]

Stage 2: network

[network where event.action in ("connection_accepted", "connection_attempted") and
 not 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.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", "129.153.192.0/19", "128.194.0.0/16") and
 not (process.executable : "C:\\Program Files\\Amazon Corretto\\jdk*\\bin\\javaw.exe" and destination.ip == "164.154.131.141") and
 not (process.executable : "C:\\Program Files\\Zulu\\zulu-??\\bin\\javaw.exe" and destination.ip == "146.75.93.145")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionin
  • connection_accepted corpus 14 (elastic 14)
  • connection_attempted corpus 24 (elastic 24)
field:"EventType" kind:in
process.argswildcard
  • -jar corpus 8 (elastic 8)
  • C:\Users\*\AppData\Local\Temp\7z*\
  • C:\Users\*\AppData\Local\Temp\BNZ.*
  • C:\Users\*\AppData\Local\Temp\Rar$*\*
  • C:\Users\*\AppData\Local\Temp\Temp?_*\*
  • C:\Users\*\Downloads\*.jar
  • c:\Users\*\Desktop\*.jar
field:"process.args" kind:wildcard
process.args_counteq
  • 3 transforms: number corpus 22 (elastic 22)
field:"process.args_count" kind:eq value:"3"
process.namewildcard
  • javaw.exe corpus 9 (elastic 9)
field:"process_basename" kind:wildcard value:"javaw.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipeq146.75.93.145excludes:destination.ip field:"destination.ip" value:"146.75.93.145"
process.executableeqC:\Program Files\Zulu\zulu-??\bin\javaw.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\Zulu\zulu-??\bin\javaw.exe"
destination.ipeq164.154.131.141excludes:destination.ip field:"destination.ip" value:"164.154.131.141"
process.executablewildcardC:\Program Files\Amazon Corretto\jdk*\bin\javaw.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\Amazon Corretto\jdk*\bin\javaw.exe"
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.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, 129.153.192.0/19, 128.194.0.0/16excludes:destination.ip

Kernel Driver Registered via NtLoadDriver

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

Adversaries may load a driver to a compromised machine to execute code in kernel mode. A majority of legitimate kernel driver installations involve a new service creation via the Windows Service Control Manager (SCM) which generate audit logs. Adversaries can leverage the undocumented Windows API NtLoadDriver to load a driver directly, avoiding service creation traces.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Adversaries may load a driver to a compromised machine to execute code in kernel mode. A majority of legitimate kernel
driver installations involve a new service creation via the Windows Service Control Manager (SCM) which generate audit
logs. Adversaries can leverage the undocumented Windows API NtLoadDriver to load a driver directly, avoiding service
creation traces.
"""
id = "5b5fa228-596a-4df2-a0ff-4d98b97e67b3"
license = "Elastic License v2"
name = "Kernel Driver Registered via NtLoadDriver"
os_list = ["windows"]
reference = [
    "http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FExecutable%20Images%2FNtLoadDriver.html",
]
version = "1.0.27"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  (process.Ext.relative_file_creation_time <= 3600 or process.Ext.relative_file_name_modify_time <= 500)]
 [registry where
  registry.path : "HKLM\\SYSTEM\\ControlSet001\\*\\Type" and registry.data.strings : "1"]
'''

min_endpoint_version = "8.10.0"
reputation = true
[[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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

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



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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  (process.Ext.relative_file_creation_time <= 3600 or process.Ext.relative_file_name_modify_time <= 500)]

Stage 2: registry

[registry where
  registry.path : "HKLM\\SYSTEM\\ControlSet001\\*\\Type" and registry.data.strings : "1"]

Indicators

These rows show field, operator, and value matches.

M365 Exchange Inbox Phishing Evasion Rule Created

#
Status
production
Severity
high
Time window
9m
Group by
source.ip, user.id
Author
Elastic, Jamie Lee, Marco Pedrinazzi
Source
github.com/elastic/detection-rules

Identifies when a user creates a new inbox rule in Microsoft 365 that deletes or moves emails containing suspicious keywords. Adversaries who have compromised accounts often create inbox rules to hide alerts, security notifications, or other sensitive messages by automatically deleting them or moving them to obscure folders. Common destinations include Deleted Items, Junk Email, RSS Feeds, and RSS Subscriptions. This is a New Terms rule that triggers only when the user principal name and associated source IP address have not been observed performing this activity in the past 14 days.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2025/05/22"
integration = ["o365"]
maturity = "production"
updated_date = "2026/07/08"

[rule]
author = ["Elastic", "Jamie Lee", "Marco Pedrinazzi"]
description = """
Identifies when a user creates a new inbox rule in Microsoft 365 that deletes or moves emails containing suspicious
keywords. Adversaries who have compromised accounts often create inbox rules to hide alerts, security notifications, or
other sensitive messages by automatically deleting them or moving them to obscure folders. Common destinations include
Deleted Items, Junk Email, RSS Feeds, and RSS Subscriptions. This is a New Terms rule that triggers only when the user
principal name and associated source IP address have not been observed performing this activity in the past 14 days.
"""
from = "now-9m"
index = ["filebeat-*", "logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Inbox Phishing Evasion Rule Created"
note = """## Triage and Analysis

### Investigating M365 Exchange Inbox Phishing Evasion Rule Created

This detection identifies the creation of potentially malicious inbox rules in Microsoft 365. These rules automatically delete or move emails with specific keywords such as "invoice", "payment", "security", or "phish". Adversaries often use these rules post-compromise to conceal warning emails, alerts from security tools, or responses from help desk teams, thereby evading detection and maintaining access.

This is a new terms rule that alerts only when the combination of `user.id` and `source.ip` has not performed this activity in the last 14 days.

### Possible investigation steps

- Review the `user.id` and `user.email` fields to identify the user account that created the inbox rule.
- Confirm the rule creation action in `event.action` is `New-InboxRule` and that the `event.outcome` is `success`.
- Investigate the `o365.audit.Parameters.SubjectContainsWords` field for sensitive or suspicious keywords such as:
  - `invoice`, `payment`, `reset`, `phish`, `login`, `fraud`, `alert`, etc.
- Check if the rule performs any of the following:
  - `MoveToFolder`: suspicious folders like `RSS Feeds`, `Junk Email`, or `Deleted Items`.
  - `DeleteMessage`: if present, suggests the rule is meant to hide communications.
- Review the `source.ip` and `source.geo.*` fields to validate whether the IP address and location match expected user behavior.
- Examine whether the rule was created via a suspicious interface like Exchange Admin or through external automation.
- Check for recent sign-in anomalies, credential changes, or unusual mailbox activity for the user (e.g., email forwarding, MFA prompts).

### False positive analysis

- Some rules may be created by users for legitimate purposes (e.g., moving newsletters).
- Outlook plugins or automated email management tools could create rules that resemble this behavior.
- Newly onboarded employees might configure rules for personal filtering without malicious intent.

### Response and remediation

- If the rule is determined to be malicious:
  - Remove the inbox rule immediately.
  - Review the user’s mailbox for signs of data theft or additional manipulation (e.g., auto-forwarding, altered reply-to addresses).
  - Investigate surrounding activity such as MFA changes, token refreshes, or admin role assignments.
  - Revoke tokens and initiate a password reset for the compromised user.
- If broader compromise is suspected:
  - Review audit logs for other inbox rule creations across the tenant.
  - Check whether other users from the same source IP performed similar activity.
  - Educate the user on safe email handling and rule creation best practices.
- Strengthen detection:
  - Enable Microsoft Defender for Office 365 Safe Rules.
  - Use mailbox auditing and DLP policies to monitor hidden inbox activity.

"""
references = [
    "https://learn.microsoft.com/en-us/defender-office-365/detect-and-remediate-outlook-rules-forms-attack",
    "https://learn.microsoft.com/en-us/defender-xdr/alert-grading-playbook-inbox-manipulation-rules",
    "https://blog.barracuda.com/2023/09/20/threat-spotlight-attackers-inbox-rules-evade-detection",
]
risk_score = 73
rule_id = "40fe11c2-376e-11f0-9a82-f661ea17fbcd"
severity = "high"
tags = [
    "Domain: Cloud",
    "Domain: SaaS",
    "Domain: Email",
    "Data Source: Microsoft 365",
    "Data Source: Microsoft 365 Audit Logs",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: "o365.audit" and
    event.action: ("New-InboxRule" or "Set-InboxRule") and event.outcome: "success" and
    (
     o365.audit.Parameters.BodyContainsWords: "\u0000" or 
     o365.audit.Parameters.WithinSizeRangeMinimum <= 1023 or 
     o365.audit.Parameters.SubjectContainsWords: (
        *phish* or
        *hack* or
        *alert* or
        *malware* or
        *security* or
        *invoice* or
        *payment* or
        *wire* or
        *transfer* or
        *fraud* or
        *reset* or
        *unusual* or
        *protection* or
        *login* or
        *suspicious*
      )
    ) and (
    o365.audit.Parameters.DeleteMessage: True or
    o365.audit.Parameters.MoveToFolder: (
        *Deleted* or
        *Junk* or
        *RSS* or 
        *Calendar*
    )
)
'''


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

[[rule.threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"

[[rule.threat.technique.subtechnique]]
id = "T1564.008"
name = "Email Hiding Rules"
reference = "https://attack.mitre.org/techniques/T1564/008/"

[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 = "T1137"
name = "Office Application Startup"
reference = "https://attack.mitre.org/techniques/T1137/"

[[rule.threat.technique.subtechnique]]
id = "T1137.005"
name = "Outlook Rules"
reference = "https://attack.mitre.org/techniques/T1137/005/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.new_terms]
field = "new_terms_fields"
value = ["user.id", "source.ip"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-14d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: "o365.audit" and
    event.action: ("New-InboxRule" or "Set-InboxRule") and event.outcome: "success" and
    (
     o365.audit.Parameters.BodyContainsWords: "\u0000" or 
     o365.audit.Parameters.WithinSizeRangeMinimum <= 1023 or 
     o365.audit.Parameters.SubjectContainsWords: (
        *phish* or
        *hack* or
        *alert* or
        *malware* or
        *security* or
        *invoice* or
        *payment* or
        *wire* or
        *transfer* or
        *fraud* or
        *reset* or
        *unusual* or
        *protection* or
        *login* or
        *suspicious*
      )
    ) and (
    o365.audit.Parameters.DeleteMessage: True or
    o365.audit.Parameters.MoveToFolder: (
        *Deleted* or
        *Junk* or
        *RSS* or 
        *Calendar*
    )
)

Indicators

These rows show field, operator, and value matches.

Persistence via a Process from a Removable or Mounted ISO Device

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

Identifies a process running from a mounted ISO or USB device writing to commonly abused persistence locations (registry run keys and startup folder). Adversaries may use this technique to maintain persistence on an endpoint.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies a process running from a mounted ISO or USB device writing to commonly abused persistence locations (registry
run keys and startup folder). Adversaries may use this technique to maintain persistence on an endpoint.
"""
id = "0cdf1d24-b1c3-4952-a400-5ba3c1491087"
license = "Elastic License v2"
name = "Persistence via a Process from a Removable or Mounted ISO Device"
os_list = ["windows"]
reference = ["https://docs.microsoft.com/en-us/previous-versions/technet-magazine/ee851671(v=msdn.10)"]
version = "1.0.22"

query = '''
sequence by process.entity_id with maxspan=5m
 [process where event.action == "start" and
  (
   (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB *") and not process.executable : "C:\\*") or

   descendant of [process where event.action == "start" and
   process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB *") and not process.executable : "C:\\*"]
   ) and
   not process.executable :
            ("?:\\Program Files\\Microsoft Office\\root\\Integration\\Addons\\OneDriveSetup.exe",
             "?:\\Program Files (x86)\\Microsoft Office\\root\\Integration\\Addons\\OneDriveSetup.exe",
             "?:\\Program Files (x86)\\Microsoft OneDrive\\*\\FileSyncConfig.exe",
             "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
             "C:\\$WINDOWS.~BT\\Sources\\SetupHost.exe") and
   not (process.code_signature.subject_name :
                              ("Global Security Center", "Fabrice PARISOT", "Veeam Software Group GmbH", "Esko Software bv",
                               "Google LLC", "Sage Software Inc.", "Schneider Electric") and
        process.code_signature.trusted == true) and
   not process.hash.sha256 : "6decdc0e295f2246d684480c10266c067cbd60c03af702505b7b3d045e81df18"
 ]
 [any where event.category : ("registry", "file") and event.action != "deletion" and
   (
    (registry.data.strings != null and
     registry.path :
        ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
         "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
         "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
         "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load", 
         "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
         "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript", 
         "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun", 
         "HKEY_USERS\\S-1-5-*_Classes\\CLSID\\*\\InprocServer32\\",
         "HKEY_USERS\\S-1-5-*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*")) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and
     not file.name : "dektop.ini")
   )]
'''

min_endpoint_version = "8.4.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 = "T1091"
name = "Replication Through Removable Media"
reference = "https://attack.mitre.org/techniques/T1091/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
  (
   (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB *") and not process.executable : "C:\\*") or

   descendant of [process where event.action == "start" and
   process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB *") and not process.executable : "C:\\*"]
   ) and
   not process.executable :
            ("?:\\Program Files\\Microsoft Office\\root\\Integration\\Addons\\OneDriveSetup.exe",
             "?:\\Program Files (x86)\\Microsoft Office\\root\\Integration\\Addons\\OneDriveSetup.exe",
             "?:\\Program Files (x86)\\Microsoft OneDrive\\*\\FileSyncConfig.exe",
             "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
             "C:\\$WINDOWS.~BT\\Sources\\SetupHost.exe") and
   not (process.code_signature.subject_name :
                              ("Global Security Center", "Fabrice PARISOT", "Veeam Software Group GmbH", "Esko Software bv",
                               "Google LLC", "Sage Software Inc.", "Schneider Electric") and
        process.code_signature.trusted == true) and
   not process.hash.sha256 : "6decdc0e295f2246d684480c10266c067cbd60c03af702505b7b3d045e81df18"
 ]

Stage 2: any

[any where event.category : ("registry", "file") and event.action != "deletion" and
   (
    (registry.data.strings != null and
     registry.path :
        ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
         "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*", 
         "H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*", 
         "H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Load", 
         "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell", 
         "HKEY_USERS\\*\\Environment\\UserInitMprLogonScript", 
         "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Shell", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logoff\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Logon\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Shutdown\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\\Scripts\\Startup\\Script", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Ctf\\LangBarAddin\\*\\FilePath", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\*\\Exec", 
         "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Command Processor\\Autorun", 
         "HKEY_USERS\\S-1-5-*_Classes\\CLSID\\*\\InprocServer32\\",
         "HKEY_USERS\\S-1-5-*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*")) or
    (file.name != null and file.path : "?:\\*\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*" and
     not file.name : "dektop.ini")
   )]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
event.categorywildcard
  • file corpus 29 (elastic 29)
  • registry corpus 8 (elastic 8)
field:"event.category" kind:wildcard
file.nameis_not_null
  • (no value, null check)
field:"file.name" kind:is_not_null
file.pathwildcard
  • ?:\*\Microsoft\Windows\Start Menu\Programs\Startup\* corpus 9 (elastic 9)
field:"TargetFilename" kind:wildcard value:"?:\*\Microsoft\Windows\Start Menu\Programs\Startup\*"
process.Ext.device.product_idwildcard
  • USB * corpus 6 (elastic 6)
  • Virtual DVD-ROM corpus 7 (elastic 7)
  • Virtual Disk corpus 7 (elastic 7)
field:"process.Ext.device.product_id" kind:wildcard
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.pathwildcard
  • H*\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\Microsoft\Windows\CurrentVersion\Run\* corpus 12 (elastic 12)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 11 (elastic 11)
  • H*\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run\* corpus 11 (elastic 11)
  • HKEY_USERS\*\Environment\UserInitMprLogonScript corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Command Processor\Autorun corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Ctf\LangBarAddin\*\FilePath corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Internet Explorer\Extensions\*\Exec corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\Load corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 12 (elastic 12)
  • HKEY_USERS\*\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Shell corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logoff\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Logon\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\Script corpus 11 (elastic 11)
  • HKEY_USERS\*\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\Script corpus 11 (elastic 11)
  • HKEY_USERS\S-1-5-*\Software\Microsoft\Windows\CurrentVersion\RunOnce\*
  • HKEY_USERS\S-1-5-*_Classes\CLSID\*\InprocServer32\
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell corpus 8 (elastic 8)
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit corpus 8 (elastic 8)
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqGlobal Security Center, Fabrice PARISOT, Veeam Software Group GmbH, Esko Software bv, Google LLC, Sage Software Inc., Schneider Electricexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files\Microsoft Office\root\Integration\Addons\OneDriveSetup.exe, ?:\Program Files (x86)\Microsoft Office\root\Integration\Addons\OneDriveSetup.exe, ?:\Program Files (x86)\Microsoft OneDrive\*\FileSyncConfig.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, C:\$WINDOWS.~BT\Sources\SetupHost.exeexcludes:process.executable
process.hash.sha256eq6decdc0e295f2246d684480c10266c067cbd60c03af702505b7b3d045e81df18excludes:process.hash.sha256 field:"process.hash.sha256" value:"6decdc0e295f2246d684480c10266c067cbd60c03af702505b7b3d045e81df18"

Potential Defense Evasion via Filter Manager Control Program

#
Source
github.com/elastic/protections-artifacts

Identifies attempt to unload a security driver via the Filter Manager Control Program.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = "Identifies attempt to unload a security driver via the Filter Manager Control Program."
id = "5b39f347-077c-4a1e-8d3c-6f7789ca09e8"
license = "Elastic License v2"
name = "Potential Defense Evasion via Filter Manager Control Program"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/FltMC/"]
version = "1.0.28"

query = '''
process where event.action == "start" and
 process.pe.original_file_name == "fltMC.exe" and
 process.args : "unload" and process.command_line : ("*security*", "*sysmon*", "*esensor*", "*Elastic*")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[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
 process.pe.original_file_name == "fltMC.exe" and
 process.args : "unload" and process.command_line : ("*security*", "*sysmon*", "*esensor*", "*Elastic*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • unload corpus 3 (elastic 3)
field:"process.args" kind:wildcard value:"unload"
process.command_linewildcard
  • *Elastic*
  • *esensor*
  • *security* corpus 2 (sigma 1, elastic 1)
  • *sysmon* corpus 4 (sigma 3, elastic 1)
field:"CommandLine" kind:wildcard
process.pe.original_file_nameeq
  • fltMC.exe
field:"OriginalFileName" kind:eq value:"fltMC.exe"

Potential Foxmail Exploitation

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

Identifies the Foxmail client spawning a child process with arguments pointing to user-profile AppData paths or remote shares. This may indicate exploitation of a Foxmail vulnerability for initial access and execution via a malicious email.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/08/29"
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/01"

[rule]
author = ["Elastic"]
description = """
Identifies the Foxmail client spawning a child process with arguments pointing to user-profile AppData paths or remote
shares. This may indicate exploitation of a Foxmail vulnerability for initial access and execution via a malicious email.
"""
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 = "Potential Foxmail Exploitation"
references = ["https://mp.weixin.qq.com/s/F8hNyESBdKhwXkQPgtGpew"]
risk_score = 73
rule_id = "2c6a6acf-0dcb-404d-89fb-6b0327294cfa"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Initial Access",
    "Tactic: Execution",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Windows Security Event Logs",
    "Data Source: Elastic Endgame",
    "Data Source: SentinelOne",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
 process.parent.name : "Foxmail.exe" and process.args : ("?:\\Users\\*\\AppData\\*", "\\\\*")
'''

note = """## Triage and analysis

### Investigating Potential Foxmail Exploitation

#### Possible investigation steps

- What exact Foxmail child execution did the alert capture?
  - Why: Foxmail exploit attempts execute code in the user's client context; the child process and path argument distinguish payload execution from routine file handling.
  - Focus: `process.parent.name`, `process.parent.executable`, child `process.executable`, `process.command_line`, and `process.args`.
  - Implication: escalate when Foxmail.exe launches a script host, LOLBin, interpreter, archive utility, installer, or payload from a user-writable or remote-share path; lower suspicion only when the child is a recognized signed Foxmail component with the expected path, argument pattern, and no contradictory process evidence.

- Does the Foxmail parent match the installed mail client and user launch context?
  - Focus: `process.parent.executable`, `process.parent.command_line`, `process.parent.code_signature.subject_name`, and `process.parent.code_signature.trusted`.
  - Implication: escalate when Foxmail runs from a user-writable or portable path, has an unexpected signer or trust state, or appears under an abnormal launch chain; lower suspicion when parent identity and user context match a recognized installed Foxmail workflow. Parent identity never clears the child behavior by itself.

- What does the child command line say it was trying to execute or open?
  - Why: the user-writable or remote path string in `process.args` is the rule-specific payload anchor; interpret it before relying on broader pivots.
  - Focus: `process.executable`, `process.command_line`, `process.args`, and `process.code_signature.subject_name`. $investigate_2
  - Implication: escalate when the child runs executable or scriptable content from a user-writable path, mounted archive, or remote share, especially through a LOLBin or interpreter; lower suspicion when signed child, arguments, and path pattern match a locally confirmed Foxmail file-handling action.

- Did the Foxmail child launch descendants that change impact or confirm execution?
  - Focus: process starts on the same `host.id` where `process.parent.entity_id` matches the child `process.entity_id`, or `process.parent.pid` matches `process.pid` in the alert window; review descendant `process.executable` and `process.command_line`. $investigate_3
  - Hint: prefer entity match; use PID only inside the alert window.
  - Implication: escalate when descendants include payload staging, scripting, installers, persistence tooling, or commands unrelated to Foxmail; lower suspicion when there are no descendants and the child command from the prior step already matches a recognized helper workflow.

- What delivery clue is embedded in the user-writable or remote path argument?
  - Focus: file name, extension, UNC host/share, and directory pattern visible in `process.args`, scoped to `host.name` and `user.id`.
  - Implication: escalate or broaden when the path suggests executable content, a deceptive attachment-like name, or a remote share that can execute content without local provenance; lower suspicion only as corroboration when the path shape fits a recognized Foxmail file-handling workflow supported by child identity and descendant evidence.

- Does related activity history show the same child/path pattern beyond this process?
  - Focus: related records for the same `user.id`; compare child `process.executable`, parent-child pair, and distinctive `process.args` fragments. $investigate_0
  - Hint: use same-asset related records to separate one user's repeat workflow from multiple users on one host. $investigate_1
  - Implication: broaden when the same child binary, remote share, or path fragment appears on unrelated users or hosts; keep response local when related records are absent and local process evidence already proves one recognized workflow.

- Based on the Foxmail parent, child command, argument path, descendants, and related activity, what disposition is supported?
  - Escalate for suspicious child intent, unexplained descendants, or the same pattern on multiple users or hosts; close only when process evidence and supported recovery prove one exact recognized Foxmail workflow on this host; preserve and escalate mixed, missing, or contradictory evidence, using outside confirmation only to corroborate details telemetry cannot prove.

### False positive analysis

- Signed Foxmail child processes used for update or file handling and authorized internal tests are plausible benign candidates, but the label is not clearance. Confirm parent path/signer, child path/signer, `process.args`, `host.id`, and `user.id` all align with one workflow or exact test file/share, and verify no suspicious descendants; use prior alerts only to tune a durable exception, not to close the single alert by recurrence alone.
- If test records are unavailable, use the process timeline, path shape, and user/host scope as fallback corroboration; do not close on owner confirmation alone when process evidence remains unexplained.
- Before creating an exception, require stable anchors such as `process.parent.executable`, `process.executable`, `process.code_signature.subject_name`, the user-writable or remote path pattern in `process.args`, `host.id`, and `user.id`. Avoid exceptions on "Foxmail.exe" alone, temp-path strings alone, or `process.name` alone because exploit chains and benign components can share those surface features.

### Response and remediation

- If confirmed benign, reverse any temporary containment and document the recognized Foxmail component, file-handling, or test workflow, including the expected parent-child pair, signer, path pattern, `host.id`, and `user.id`. Create a narrow exception only when those anchors are stable enough to avoid suppressing lookalike exploit chains.
- If suspicious but unconfirmed, preserve the alert record, parent and child command lines, `process.entity_id`, `process.pid`, `process.args`, referenced user-writable or remote paths, descendant process identifiers, and case records that identify the delivery path before containment. Apply reversible containment such as temporary quarantine of the referenced artifact, temporary outbound restrictions for the affected host when remote retrieval is indicated, or heightened monitoring on the affected `host.id` and `user.id`; escalate to host isolation only if follow-on execution, staging, or wider compromise appears and the host role can tolerate it.
- If confirmed malicious, isolate the host and terminate the Foxmail child or descendant payloads only after recording the relevant process identifiers, command lines, path strings, and delivery-path evidence; if direct endpoint response is unavailable, escalate with those preserved artifacts to the team that can act. Quarantine the referenced attachment or payload, block confirmed malicious indicators, and review other recipients, hosts, and users for the same attachment, remote path, or child-process pattern before deleting evidence or resetting accounts.
- Eradicate only the payloads, persistence mechanisms, or configuration changes identified in the same chain after scoping affected recipients and hosts. Remediate the message source, attachment workflow, or remote share that led to the Foxmail launch.
- Post-incident hardening: update Foxmail to a current vendor-fixed release, retain endpoint process telemetry and any mail or artifact telemetry used in this case, and document adjacent exploit-chain findings for the detection engineering team.
"""

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.name",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.pid",
    "process.executable",
    "process.command_line",
    "process.args",
    "process.parent.entity_id",
    "process.parent.executable",
    "process.parent.command_line",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
]

[transform]

[[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 = "Events for the Foxmail child process"
description = ""
providers = [
  [
    { 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.entity_id", queryType = "phrase", value = "{{process.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.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Child processes launched by the Foxmail child"
description = ""
providers = [
  [
    { 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.entity_id", queryType = "phrase", value = "{{process.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.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[rule.threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"

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

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

[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
 process.parent.name : "Foxmail.exe" and process.args : ("?:\\Users\\*\\AppData\\*", "\\\\*")

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
  • ?:\Users\*\AppData\* corpus 6 (elastic 6)
  • \\*
field:"process.args" kind:wildcard
process.parent.namewildcard
  • Foxmail.exe corpus 2 (elastic 2)
field:"parent_process_basename" kind:wildcard value:"Foxmail.exe"

Potential LogonUser API Hooking

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to hook LogonUser API via memory modification. This may indicate an attempt to steal credentials passed for authentication verification via this API.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Identifies attempts to hook LogonUser API via memory modification. This may indicate an attempt to steal credentials
passed for authentication verification via this API.
"""
id = "19523b07-b1ce-4b4e-882c-18e9492e9591"
license = "Elastic License v2"
name = "Potential LogonUser API Hooking"
os_list = ["windows"]
version = "1.0.10"

query = '''
api where process.Ext.api.name in ("WriteProcessMemory", "VirtualProtect") and
 process.Ext.api.metadata.target_address_name like "advapi32.dll!LogonUser*" and process.executable != null and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_final_user_module.path in ("c:\\windows\\syswow64\\werfault.exe", "c:\\windows\\system32\\werfault.exe") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true or $entry.status like "errorCode_endpoint*") and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != "fdfc853b183d682c912e6487a64dbaea98f8d09207a55d0a512e550c988d6273" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\system32\\ntdll.dll!LdrLoadDll*") and
 not process.thread.Ext.call_stack_final_user_module.path : 
                              ("?:\\program files\\avg\\antivirus\\aswhook.dll", 
                               "?:\\program files\\avg\\antivirus\\x86\\aswhook.dll", 
                               "?:\\program files\\avast software\\avast\\aswhook.dll",
                               "?:\\program files\\avast software\\avast\\x86\\aswhook.dll",
                               "?:\\windows\\assembly\\nativeimages_*\\microsoft.powershell.commands.management.ni.dll") and 
 not process.executable : ("C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\1.0\\AdobeARM.exe", 
                           "C:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\IPCBox\\AdobeIPCBroker.exe", 
                           "C:\\Program Files\\Avast Software\\Browser\\Application\\AvastBrowserProtect.exe")
'''

min_endpoint_version = "8.10.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 = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[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: api

api where process.Ext.api.name in ("WriteProcessMemory", "VirtualProtect") and
 process.Ext.api.metadata.target_address_name like "advapi32.dll!LogonUser*" and process.executable != null and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_final_user_module.path in ("c:\\windows\\syswow64\\werfault.exe", "c:\\windows\\system32\\werfault.exe") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true or $entry.status like "errorCode_endpoint*") and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != "fdfc853b183d682c912e6487a64dbaea98f8d09207a55d0a512e550c988d6273" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\system32\\ntdll.dll!LdrLoadDll*") and
 not process.thread.Ext.call_stack_final_user_module.path : 
                              ("?:\\program files\\avg\\antivirus\\aswhook.dll", 
                               "?:\\program files\\avg\\antivirus\\x86\\aswhook.dll", 
                               "?:\\program files\\avast software\\avast\\aswhook.dll",
                               "?:\\program files\\avast software\\avast\\x86\\aswhook.dll",
                               "?:\\windows\\assembly\\nativeimages_*\\microsoft.powershell.commands.management.ni.dll") and 
 not process.executable : ("C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\1.0\\AdobeARM.exe", 
                           "C:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\IPCBox\\AdobeIPCBroker.exe", 
                           "C:\\Program Files\\Avast Software\\Browser\\Application\\AvastBrowserProtect.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.executableeqC:\Program Files (x86)\Common Files\Adobe\ARM\1.0\AdobeARM.exe, C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\IPCBox\AdobeIPCBroker.exe, C:\Program Files\Avast Software\Browser\Application\AvastBrowserProtect.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\Common Files\Adobe\ARM\1.0\AdobeARM.exe" field:"process.executable" value:"C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\IPCBox\AdobeIPCBroker.exe" field:"process.executable" value:"C:\Program Files\Avast Software\Browser\Application\AvastBrowserProtect.exe"
process.thread.Ext.call_stack_final_user_module.nameinKernel, Undetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.pathinc:\windows\system32\werfault.exe, c:\windows\syswow64\werfault.exeexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\werfault.exe" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\syswow64\werfault.exe"
process.thread.Ext.call_stack_final_user_module.pathwildcard?:\program files\avg\antivirus\aswhook.dll, ?:\program files\avg\antivirus\x86\aswhook.dll, ?:\program files\avast software\avast\aswhook.dll, ?:\program files\avast software\avast\x86\aswhook.dll, ?:\windows\assembly\nativeimages_*\microsoft.powershell.commands.management.ni.dllexcludes:process.thread.Ext.call_stack_final_user_module.path

Printer User (lp) Shell Execution

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

This detection rule addresses multiple vulnerabilities in the CUPS printing system, including CVE-2024-47176, CVE-2024-47076, CVE-2024-47175, and CVE-2024-47177. Specifically, this rule detects shell executions from the foomatic-rip parent process through the default printer user (lp). These flaws impact components like cups-browsed, libcupsfilters, libppd, and foomatic-rip, allowing remote unauthenticated attackers to manipulate IPP URLs or inject malicious data through crafted UDP packets or network spoofing. This can result in arbitrary command execution when a print job is initiated.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This detection rule addresses multiple vulnerabilities in the CUPS printing system, including CVE-2024-47176,
CVE-2024-47076, CVE-2024-47175, and CVE-2024-47177. Specifically, this rule detects shell executions from the foomatic-rip
parent process through the default printer user (lp). These flaws impact components like cups-browsed, libcupsfilters,
libppd, and foomatic-rip, allowing remote unauthenticated attackers to manipulate IPP URLs or inject malicious data
through crafted UDP packets or network spoofing. This can result in arbitrary command execution when a print job is
initiated.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Printer User (lp) Shell Execution"
note = """## Triage and analysis

### Investigating Printer User (lp) Shell Execution

This rule identifies potential exploitation attempts of several vulnerabilities in the CUPS printing system (CVE-2024-47176, CVE-2024-47076, CVE-2024-47175, CVE-2024-47177). These vulnerabilities allow attackers to send crafted IPP requests or manipulate UDP packets to execute arbitrary commands or modify printer configurations. Attackers can exploit these flaws to inject malicious data, leading to Remote Code Execution (RCE) on affected systems.

#### Possible Investigation Steps

- Investigate the incoming IPP requests or UDP packets targeting port 631.
- Examine the printer configurations on the system to determine if any unauthorized printers or URLs have been added.
- Investigate the process tree to check if any unexpected processes were triggered as a result of IPP activity. Review the executable files for legitimacy.
- Check for additional alerts related to the compromised system or user within the last 48 hours.
- Investigate network traffic logs for suspicious outbound connections to unrecognized domains or IP addresses.
- Check if any of the contacted domains or addresses are newly registered or have a suspicious reputation.
- Retrieve any scripts or executables dropped by the attack for further analysis in a private sandbox environment:
- Analyze potential malicious activity, including:
  - Attempts to communicate with external servers.
  - File access or creation of unauthorized executables.
  - Cron jobs, services, or other persistence mechanisms.

### Related Rules
- Cupsd or Foomatic-rip Shell Execution - 476267ff-e44f-476e-99c1-04c78cb3769d
- Network Connection by Cups or Foomatic-rip Child - e80ee207-9505-49ab-8ca8-bc57d80e2cab
- File Creation by Cups or Foomatic-rip Child - b9b14be7-b7f4-4367-9934-81f07d2f63c4
- Suspicious Execution from Foomatic-rip or Cupsd Parent - 986361cd-3dac-47fe-afa1-5c5dd89f2fb4

### False Positive Analysis

- This activity is rarely legitimate. However, verify the context to rule out non-malicious printer configuration changes or legitimate IPP requests.

### Response and Remediation

- Initiate the incident response process based on the triage outcome.
- Isolate the compromised host to prevent further exploitation.
- If the investigation confirms malicious activity, search the environment for additional compromised hosts.
- Implement network segmentation or restrictions to contain the attack.
- Stop suspicious processes or services tied to CUPS exploitation.
- Block identified Indicators of Compromise (IoCs), including IP addresses, domains, or hashes of involved files.
- Review compromised systems for backdoors, such as reverse shells or persistence mechanisms like cron jobs.
- Investigate potential credential exposure on compromised systems and reset passwords for any affected accounts.
- Restore the original printer configurations or uninstall unauthorized printer entries.
- Perform a thorough antimalware scan to identify any lingering threats or artifacts from the attack.
- Investigate how the attacker gained initial access and address any weaknesses to prevent future exploitation.
- Use insights from the incident to improve detection and response times in future incidents (MTTD and MTTR).
"""
references = [
    "https://www.elastic.co/security-labs/cups-overflow",
    "https://www.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I/",
    "https://gist.github.com/stong/c8847ef27910ae344a7b5408d9840ee1",
    "https://github.com/RickdeJager/cupshax/blob/main/cupshax.py",
]
risk_score = 73
rule_id = "f86cd31c-5c7e-4481-99d7-6875a3e31309"
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 = "high"
tags = [
  "Domain: Endpoint",
  "OS: Linux",
  "Use Case: Threat Detection",
  "Use Case: Vulnerability",
  "Tactic: Execution",
  "Data Source: Crowdstrike",
  "Data Source: Elastic Defend",
  "Data Source: Elastic Endgame",
  "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", "ProcessRollup2", "ProcessRollup2") and user.name == "lp" and
  process.parent.name in ("cupsd", "foomatic-rip", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
  process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and not (
    process.command_line like (
      "*/tmp/foomatic-*", "*-sDEVICE=ps2write*", "*printf*", "/bin/sh -e -c cat", "/bin/bash -c cat",
      "/bin/bash -e -c cat"
    ) or
    process.args like ("gs*", "/usr/bin/lsb_release", "/usr/lib/cups/filter/gstopdf")
  )
'''

[[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]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
  event.action in ("exec", "exec_event", "ProcessRollup2", "ProcessRollup2") and user.name == "lp" and
  process.parent.name in ("cupsd", "foomatic-rip", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
  process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and not (
    process.command_line like (
      "*/tmp/foomatic-*", "*-sDEVICE=ps2write*", "*printf*", "/bin/sh -e -c cat", "/bin/bash -c cat",
      "/bin/bash -e -c cat"
    ) or
    process.args like ("gs*", "/usr/bin/lsb_release", "/usr/lib/cups/filter/gstopdf")
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcardgs*, /usr/bin/lsb_release, /usr/lib/cups/filter/gstopdfexcludes:process.args field:"process.args" value:"gs*" field:"process.args" value:"/usr/bin/lsb_release" field:"process.args" value:"/usr/lib/cups/filter/gstopdf"
process.command_linewildcard*/tmp/foomatic-*, *-sDEVICE=ps2write*, *printf*, /bin/sh -e -c cat, /bin/bash -c cat, /bin/bash -e -c catexcludes:process.command_line

Scriptlet Execution via CMSTP

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

Identifies when scrobj.dll is loaded into the Microsoft Connection Manager Profile Installer (cmstp.exe) process. This may indicate an attempt to bypass application whitelisting by executing a malicious scriptlet in a trusted process.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when scrobj.dll is loaded into the Microsoft Connection Manager Profile Installer (cmstp.exe) process. This
may indicate an attempt to bypass application whitelisting by executing a malicious scriptlet in a trusted process.
"""
id = "8adfa9ad-0ed2-4b1b-bdad-f2c52e1d2a00"
license = "Elastic License v2"
name = "Scriptlet Execution via CMSTP"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Cmstp/"]
version = "1.0.31"

query = '''
sequence by process.entity_id with maxspan=1m
 [process where event.action == "start" and process.pe.original_file_name == "CMSTP.EXE"]
 [library where dll.name : "scrobj.dll"]
'''

min_endpoint_version = "7.15.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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.003"
name = "CMSTP"
reference = "https://attack.mitre.org/techniques/T1218/003/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and process.pe.original_file_name == "CMSTP.EXE"]

Stage 2: library

[library where dll.name : "scrobj.dll"]

Indicators

These rows show field, operator, and value matches.

Sensitive Identity File Open by Suspicious Process via Auditd

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

Detects Auditd opened-file reads on sensitive root and cluster paths (Kubernetes token mounts, kubelet and admin kubeconfig, PKI material, shadow, root SSH keys, root cloud CLI and Docker config) when the process looks like common copy or scripting utilities or the binary runs from temp or run staging. User home paths are excluded so file watches stay explicit and aligned with auditd.

Known False Positives

  • Backup, configuration management, and image scanners may open the same paths from scripted utilities; baseline trusted agents and narrow exclusions by process executable hash or parent chain.
  • Administrators reading kubeconfig or cloud profiles during migration can match; correlate with change tickets and bastion sessions.
  • Credential reads under non-root home trees are intentionally excluded; clone the rule with explicit per-user file.path values and optional process.executable prefixes if you must cover interactive accounts with matching audit -w lines for those paths.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/04/24"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2026/04/24"

[rule]
author = ["Elastic"]
description = """
Detects Auditd opened-file reads on sensitive root and cluster paths (Kubernetes token mounts, kubelet and admin
kubeconfig, PKI material, shadow, root SSH keys, root cloud CLI and Docker config) when the process looks like common
copy or scripting utilities or the binary runs from temp or run staging. User home paths are excluded so file watches
stay explicit and aligned with auditd.
"""
false_positives = [
    """
    Backup, configuration management, and image scanners may open the same paths from scripted utilities; baseline
    trusted agents and narrow exclusions by process executable hash or parent chain.
    """,
    """
    Administrators reading kubeconfig or cloud profiles during migration can match; correlate with change tickets and
    bastion sessions.
    """,
    """
    Credential reads under non-root home trees are intentionally excluded; clone the rule with explicit per-user
    file.path values and optional process.executable prefixes if you must cover interactive accounts with matching
    audit -w lines for those paths.
    """,
]
from = "now-9m"
index = ["logs-auditd_manager.auditd-*"]
language = "kuery"
license = "Elastic License v2"
name = "Sensitive Identity File Open by Suspicious Process via Auditd"
note = """## Triage and analysis

### Investigating Sensitive Identity File Open by Suspicious Process via Auditd

Review which file.path matched, the process name and executable, parent command line, and the Linux user or audit
identity. Pivot on the same host for adjacent opens, network egress, or privilege changes. Compare against known
maintenance windows and automation identities.

### Possible investigation steps

- Confirm whether the workload is a Kubernetes node, jump host, or developer machine and whether the actor should read
  the matched path at all.
- For Kubernetes token paths, map the process to a container or host PID namespace and inspect pod security context and
  projected volumes.
- For cloud credential JSON or shared credentials files, check cloud audit logs for API or token activity shortly after
  the open timestamp.
- Capture file hash and process binary hash where possible for incident evidence.

### False positive analysis

- Legitimate kubelet or control plane components may touch admin.conf or PKI material on control plane nodes; scope the
  rule to worker roles if noisy.
- CI users running tests from /tmp with cat against a copied kubeconfig can match; tune process or user allowlists.

### Response and remediation

- If malicious, isolate the host, rotate exposed keys and tokens, invalidate cloud sessions, and review RBAC and file
  permissions on shared credential stores.
"""
references = [
    "https://attack.mitre.org/techniques/T1552/001/",
    "https://attack.mitre.org/techniques/T1552/007/",
]
risk_score = 73
rule_id = "e4c5d6e7-f8a9-4012-b3c4-d5e6f7a80912"
setup = """## Setup

This rule expects the Elastic Agent Auditd Manager integration on Linux, with audit rules that emit file open events
for the paths you care about. Use Fleet to install and configure Auditd Manager, then paste custom rules into the
integration so opens are audited before they reach Elasticsearch.

### Step 1: Add Auditd Manager in Fleet

1. In Kibana, open Management, then Integrations.
2. Search for Auditd Manager and open the integration card.
3. Click Add Auditd Manager, assign a name, and add the integration to the Elastic Agent policy that runs on your
   Linux hosts (nodes, jump boxes, or developer workstations as applicable).
4. Save and deploy the policy so agents enroll or update.

### Step 2: Paste audit rules into Auditd Manager

1. Edit the same Auditd Manager integration policy.
2. Open the Audit rules (or Auditd rule files) section used for free-form audit.rules content.
3. Paste the block below into the audit rules text box, then save the integration policy again so agents reload rules.

The permission mask uses r (read) together with w (write) and a (attribute change) so auditd emits events on read
opens such as cat or head, which align with opened-file in the detection query. Write and attribute bits still catch
modifications. If your site policy prefers read-only watches, you may narrow to -p r at the cost of missing write-side
telemetry on the same paths.

```
## Kubernetes and node identity material
-w /var/run/secrets/kubernetes.io/serviceaccount/token -p rwa -k elastic_sensitive_identity
-w /var/run/secrets/eks.amazonaws.com/serviceaccount/token -p rwa -k elastic_sensitive_identity
-w /var/run/secrets/azure/tokens/azure-identity-token -p rwa -k elastic_sensitive_identity
-w /var/run/secrets/tokens/azure-identity-token -p rwa -k elastic_sensitive_identity
-w /var/lib/kubelet/kubeconfig -p rwa -k elastic_sensitive_identity
-w /etc/kubernetes/admin.conf -p rwa -k elastic_sensitive_identity
-w /etc/kubernetes/pki/ca.key -p rwa -k elastic_sensitive_identity
-w /etc/kubernetes/pki/apiserver-kubelet-client.key -p rwa -k elastic_sensitive_identity
-w /var/lib/kubelet/pki/kubelet-client-current.pem -p rwa -k elastic_sensitive_identity
-w /etc/rancher/k3s/k3s.yaml -p rwa -k elastic_sensitive_identity

## Host credential stores (root only)
-w /etc/shadow -p rwa -k elastic_sensitive_identity
-w /root/.ssh/id_rsa -p rwa -k elastic_sensitive_identity
-w /root/.ssh/id_ed25519 -p rwa -k elastic_sensitive_identity
-w /root/.ssh/id_ecdsa -p rwa -k elastic_sensitive_identity
-w /root/.aws/credentials -p rwa -k elastic_sensitive_identity
-w /root/.aws/config -p rwa -k elastic_sensitive_identity
-w /root/.azure/accessTokens.json -p rwa -k elastic_sensitive_identity
-w /root/.azure/azureProfile.json -p rwa -k elastic_sensitive_identity
-w /root/.azure/msal_token_cache.json -p rwa -k elastic_sensitive_identity
-w /root/.config/gcloud/application_default_credentials.json -p rwa -k elastic_sensitive_identity
-w /root/.config/gcloud/credentials.db -p rwa -k elastic_sensitive_identity
-w /root/.config/gcloud/access_tokens.db -p rwa -k elastic_sensitive_identity
-w /root/.kube/config -p rwa -k elastic_sensitive_identity
-w /root/.docker/config.json -p rwa -k elastic_sensitive_identity
```

### Step 3: Reload and verify

1. Confirm auditd is active on the host and that auditctl -l (or equivalent) lists the new rules without syntax errors.
2. Generate a harmless test open in a lab (for example cat of a non-production token file you control) and confirm
   documents land in logs-auditd_manager.auditd-* with event.category file and event.action opened-file (or the closest
   normalized action your stack maps for open syscalls).
3. If event.action differs in your environment, adjust the rule query to include the mapped value while keeping the
   same path and process logic.

Further background: https://docs.elastic.co/integrations/auditd_manager
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "Domain: Identity",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Auditd Manager",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
host.os.type:"linux" and 
data_stream.dataset:"auditd_manager.auditd" and 
event.category:"file" and 
event.action:"opened-file" and 
(
  process.name:(
    cp or mv or ln or cat or head or tail or 
    base64 or xxd or od or 
    curl or wget or 
    tar or zip or gzip or scp or rsync or 
    python* or perl* or ruby* or node or bun or php* or lua* or 
    tee or dd or 
    nc or ncat or netcat or socat or 
    openssl or ssh or sftp or 
    busybox or jq or yq or 
    strings or xargs or sed or awk or grep or find or 
    .*
  ) or 
  process.executable:(/tmp/* or /var/tmp/* or /dev/shm/* or /run/*) or 
  (process.name:(sh or bash or zsh or dash or fish or ksh) and process.args:("-c" or "-i"))
) and 
file.path:(
  "/var/run/secrets/kubernetes.io/serviceaccount/token" or
  "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" or 
  "/var/run/secrets/eks.amazonaws.com/serviceaccount/token" or
  "/var/run/secrets/azure/tokens/azure-identity-token" or
  "/var/run/secrets/tokens/azure-identity-token" or
  "/var/lib/kubelet/kubeconfig" or
  "/etc/kubernetes/admin.conf" or
  "/etc/kubernetes/pki/ca.key" or 
  "/etc/kubernetes/pki/apiserver-kubelet-client.key" or 
  "/var/lib/kubelet/pki/kubelet-client-current.pem" or 
  "/etc/rancher/k3s/k3s.yaml" or 
  "/etc/shadow" or
  "/root/.ssh/id_rsa" or
  "/root/.ssh/id_ed25519" or
  "/root/.ssh/id_ecdsa" or
  "/root/.aws/credentials" or
  "/root/.aws/config" or
  "/root/.aws/cli/cache" or
  "/root/.aws/sso/cache" or
  "/root/.azure/accessTokens.json" or
  "/root/.azure/azureProfile.json" or
  "/root/.azure/msal_token_cache.json" or
  "/root/.azure/msal_http_cache.bin" or
  "/root/.config/gcloud/application_default_credentials.json" or
  "/root/.config/gcloud/credentials.db" or
  "/root/.config/gcloud/access_tokens.db" or 
  "/root/.config/gcloud/legacy_credentials" or 
  "/root/.kube/config" or
  "/root/.docker/config.json"
)
'''

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1552.007"
name = "Container API"
reference = "https://attack.mitre.org/techniques/T1552/007/"

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

Stages and Predicates

Stage 1: query

host.os.type:"linux" and 
data_stream.dataset:"auditd_manager.auditd" and 
event.category:"file" and 
event.action:"opened-file" and 
(
  process.name:(
    cp or mv or ln or cat or head or tail or 
    base64 or xxd or od or 
    curl or wget or 
    tar or zip or gzip or scp or rsync or 
    python* or perl* or ruby* or node or bun or php* or lua* or 
    tee or dd or 
    nc or ncat or netcat or socat or 
    openssl or ssh or sftp or 
    busybox or jq or yq or 
    strings or xargs or sed or awk or grep or find or 
    .*
  ) or 
  process.executable:(/tmp/* or /var/tmp/* or /dev/shm/* or /run/*) or 
  (process.name:(sh or bash or zsh or dash or fish or ksh) and process.args:("-c" or "-i"))
) and 
file.path:(
  "/var/run/secrets/kubernetes.io/serviceaccount/token" or
  "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" or 
  "/var/run/secrets/eks.amazonaws.com/serviceaccount/token" or
  "/var/run/secrets/azure/tokens/azure-identity-token" or
  "/var/run/secrets/tokens/azure-identity-token" or
  "/var/lib/kubelet/kubeconfig" or
  "/etc/kubernetes/admin.conf" or
  "/etc/kubernetes/pki/ca.key" or 
  "/etc/kubernetes/pki/apiserver-kubelet-client.key" or 
  "/var/lib/kubelet/pki/kubelet-client-current.pem" or 
  "/etc/rancher/k3s/k3s.yaml" or 
  "/etc/shadow" or
  "/root/.ssh/id_rsa" or
  "/root/.ssh/id_ed25519" or
  "/root/.ssh/id_ecdsa" or
  "/root/.aws/credentials" or
  "/root/.aws/config" or
  "/root/.aws/cli/cache" or
  "/root/.aws/sso/cache" or
  "/root/.azure/accessTokens.json" or
  "/root/.azure/azureProfile.json" or
  "/root/.azure/msal_token_cache.json" or
  "/root/.azure/msal_http_cache.bin" or
  "/root/.config/gcloud/application_default_credentials.json" or
  "/root/.config/gcloud/credentials.db" or
  "/root/.config/gcloud/access_tokens.db" or 
  "/root/.config/gcloud/legacy_credentials" or 
  "/root/.kube/config" or
  "/root/.docker/config.json"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • auditd_manager.auditd
field:"data_stream.dataset" kind:eq value:"auditd_manager.auditd"
event.actioneq
  • opened-file
field:"EventType" kind:eq value:"opened-file"
event.categoryeq
  • file
field:"event.category" kind:eq value:"file"
file.pathin
  • /etc/kubernetes/admin.conf
  • /etc/kubernetes/pki/apiserver-kubelet-client.key
  • /etc/kubernetes/pki/ca.key
  • /etc/rancher/k3s/k3s.yaml
  • /etc/shadow
  • /root/.aws/cli/cache
  • /root/.aws/config
  • /root/.aws/credentials
  • /root/.aws/sso/cache
  • /root/.azure/accessTokens.json
  • /root/.azure/azureProfile.json
  • /root/.azure/msal_http_cache.bin
  • /root/.azure/msal_token_cache.json
  • /root/.config/gcloud/access_tokens.db
  • /root/.config/gcloud/application_default_credentials.json
  • /root/.config/gcloud/credentials.db
  • /root/.config/gcloud/legacy_credentials
  • /root/.docker/config.json
  • /root/.kube/config
  • /root/.ssh/id_ecdsa
  • /root/.ssh/id_ed25519
  • /root/.ssh/id_rsa
  • /var/lib/kubelet/kubeconfig
  • /var/lib/kubelet/pki/kubelet-client-current.pem
  • /var/run/secrets/azure/tokens/azure-identity-token
  • /var/run/secrets/eks.amazonaws.com/serviceaccount/token
  • /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
  • /var/run/secrets/kubernetes.io/serviceaccount/token
  • /var/run/secrets/tokens/azure-identity-token
field:"TargetFilename" kind:in
process.argsin
  • -c
  • -i
field:"process.args" kind:in
process.executablewildcard
  • /dev/shm/*
  • /run/*
  • /tmp/*
  • /var/tmp/*
field:"Image" kind:wildcard
process.nameeq
  • awk
  • base64
  • bun
  • busybox
  • cat
  • cp
  • curl
  • dd
  • find
  • grep
  • gzip
  • head
  • jq
  • ln
  • mv
  • nc
  • ncat
  • netcat
  • node
  • od
  • openssl
  • rsync
  • scp
  • sed
  • sftp
  • socat
  • ssh
  • strings
  • tail
  • tar
  • tee
  • wget
  • xargs
  • xxd
  • yq
  • zip
field:"process_basename" kind:eq
process.namein
  • bash
  • dash
  • fish
  • ksh
  • sh
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
  • lua*
  • perl*
  • php*
  • python*
  • ruby*
field:"process_basename" kind:wildcard

SSH Keys Accessed by Osascript

#
Source
github.com/elastic/protections-artifacts

Identifies the Osascript process accessing SSH keys. Adversaries may steal SSHkeys in order to gain elevated privileges or move laterally to another system.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies the Osascript process accessing SSH keys. Adversaries may steal SSHkeys in order to gain elevated privileges
or move laterally to another system.
"""
id = "2156b881-5f00-4d2f-a43f-9f48184545d6"
license = "Elastic License v2"
name = "SSH Keys Accessed by Osascript"
os_list = ["macos"]
version = "1.0.5"

query = '''
file where event.action == "open" and 
 file.path like~ "/Users/*/.ssh/*" and process.name == "osascript"
'''

min_endpoint_version = "8.11.1"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.executable"
state = 0

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.004"
name = "Private Keys"
reference = "https://attack.mitre.org/techniques/T1552/004/"



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

[internal]
min_endpoint_version = "8.11.1"

Stages and Predicates

Stage 1: file

file where event.action == "open" and 
 file.path like~ "/Users/*/.ssh/*" and process.name == "osascript"

Indicators

These rows show field, operator, and value matches.

Suspicious Cmd Execution via WMI

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious command execution (cmd) via Windows Management Instrumentation (WMI) on a remote host. This could be indicative of adversary lateral movement.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies suspicious command execution (cmd) via Windows Management Instrumentation (WMI) on a remote host. This could
be indicative of adversary lateral movement.
"""
id = "242ccb88-5e28-4a74-ac6a-ff0e4c814ad8"
license = "Elastic License v2"
name = "Suspicious Cmd Execution via WMI"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/elastic-protects-against-data-wiper-malware-targeting-ukraine-hermeticwiper",
    "https://www.elastic.co/security-labs/operation-bleeding-bear",
    "https://www.elastic.co/security-labs/unmasking-financial-services-intrusion-ref0657",
]
version = "1.0.35"

query = '''
process where event.action == "start" and
(
 (process.name : "cmd.exe" and process.args : "/c" and process.args:"/Q" and process.parent.name : "WmiPrvSE.exe" and
  process.args : "2>&1" and process.args: "1>" and
  process.args : ("C:\\windows\\temp\\*.txt",
                  "\\Windows\\Temp\\*",
                  "-encodehex",
                  "\\\\127.0.0.1\\C$\\Windows\\Temp\\*") and
  not process.command_line : ("*servicenow\\psscript_output*", "*Impact360\\Software*")) or

 descendant of [process where event.action == "start" and process.name : "cmd.exe" and process.args : "/c" and process.args:"/Q" and
                process.parent.name : "WmiPrvSE.exe" and
                process.args : "2>&1" and process.args: "1>" and
                process.args : ("C:\\windows\\temp\\*.txt",
                                "\\Windows\\Temp\\*",
                                "-encodehex",
                                "\\\\127.0.0.1\\C$\\Windows\\Temp\\*") and
                not process.command_line : ("*servicenow\\psscript_output*", "*Impact360\\Software*")]
 ) and
 not process.executable : ("?:\\Windows\\system32\\conhost.exe", "?:\\Windows\\System32\\findstr.exe", "?:\\Windows\\System32\\chcp.com") and
 not (process.parent.name : "cmd.exe" and process.parent.command_line : "*\\127.0.0.1\\c$\\temp\\cotportal\\COT_Mid_Cluster*") and
 not process.executable : "?:\\Program Files\\MySQL\\MySQL Server *\\bin\\mysqld.exe" and
 not (process.name : ("mysqld.exe", "mysql.exe") and process.parent.args : "\\\\127.0.0.1\\c$\\temp\\*\\psscript_output_*.txt") and
 not process.command_line : ("sc  query RemoteRegistry ", "sc  start RemoteRegistry ") and
 not (process.code_signature.subject_name == "MariaDB Corporation Ab" and process.code_signature.trusted == true) and
 not (process.name : ("powershell.exe", "cmd.exe") and
      process.command_line : ("powershell  -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ*",
                              "C:\\Windows\\system32\\cmd.exe /C powershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ*"))
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
(
 (process.name : "cmd.exe" and process.args : "/c" and process.args:"/Q" and process.parent.name : "WmiPrvSE.exe" and
  process.args : "2>&1" and process.args: "1>" and
  process.args : ("C:\\windows\\temp\\*.txt",
                  "\\Windows\\Temp\\*",
                  "-encodehex",
                  "\\\\127.0.0.1\\C$\\Windows\\Temp\\*") and
  not process.command_line : ("*servicenow\\psscript_output*", "*Impact360\\Software*")) or

 descendant of [process where event.action == "start" and process.name : "cmd.exe" and process.args : "/c" and process.args:"/Q" and
                process.parent.name : "WmiPrvSE.exe" and
                process.args : "2>&1" and process.args: "1>" and
                process.args : ("C:\\windows\\temp\\*.txt",
                                "\\Windows\\Temp\\*",
                                "-encodehex",
                                "\\\\127.0.0.1\\C$\\Windows\\Temp\\*") and
                not process.command_line : ("*servicenow\\psscript_output*", "*Impact360\\Software*")]
 ) and
 not process.executable : ("?:\\Windows\\system32\\conhost.exe", "?:\\Windows\\System32\\findstr.exe", "?:\\Windows\\System32\\chcp.com") and
 not (process.parent.name : "cmd.exe" and process.parent.command_line : "*\\127.0.0.1\\c$\\temp\\cotportal\\COT_Mid_Cluster*") and
 not process.executable : "?:\\Program Files\\MySQL\\MySQL Server *\\bin\\mysqld.exe" and
 not (process.name : ("mysqld.exe", "mysql.exe") and process.parent.args : "\\\\127.0.0.1\\c$\\temp\\*\\psscript_output_*.txt") and
 not process.command_line : ("sc  query RemoteRegistry ", "sc  start RemoteRegistry ") and
 not (process.code_signature.subject_name == "MariaDB Corporation Ab" and process.code_signature.trusted == true) and
 not (process.name : ("powershell.exe", "cmd.exe") and
      process.command_line : ("powershell  -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ*",
                              "C:\\Windows\\system32\\cmd.exe /C powershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ*"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • -encodehex corpus 2 (elastic 2)
  • /Q corpus 7 (elastic 7)
  • /c corpus 7 (elastic 7)
  • 1> corpus 2 (elastic 2)
  • 2>&1 corpus 2 (elastic 2)
  • C:\windows\temp\*.txt corpus 2 (elastic 2)
  • \Windows\Temp\* corpus 2 (elastic 2)
  • \\127.0.0.1\C$\Windows\Temp\* corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
field:"process_basename" kind:wildcard value:"cmd.exe"
process.parent.namewildcard
  • WmiPrvSE.exe corpus 24 (elastic 19, splunk 5)
field:"parent_process_basename" kind:wildcard value:"WmiPrvSE.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqMariaDB Corporation Abexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"MariaDB Corporation Ab"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.command_linestarts_withpowershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ, C:\Windows\system32\cmd.exe /C powershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQexcludes:process.command_line field:"process.command_line" value:"powershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ" field:"process.command_line" value:"C:\Windows\system32\cmd.exe /C powershell -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACIAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQ"
process.nameeqpowershell.exe, cmd.exeexcludes:process.name field:"process.name" value:"powershell.exe" field:"process.name" value:"cmd.exe"
process.nameeqmysqld.exe, mysql.exeexcludes:process.name field:"process.name" value:"mysqld.exe" field:"process.name" value:"mysql.exe"
process.parent.argswildcard\\127.0.0.1\c$\temp\*\psscript_output_*.txtexcludes:process.parent.args field:"process.parent.args" value:"\\127.0.0.1\c$\temp\*\psscript_output_*.txt"
process.parent.command_linematch\127.0.0.1\c$\temp\cotportal\COT_Mid_Clusterexcludes:process.parent.command_line field:"process.parent.command_line" value:"\127.0.0.1\c$\temp\cotportal\COT_Mid_Cluster"
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.command_lineeqsc query RemoteRegistry , sc start RemoteRegistry excludes:process.command_line field:"process.command_line" value:"sc query RemoteRegistry " field:"process.command_line" value:"sc start RemoteRegistry "
process.executableeq?:\Windows\system32\conhost.exe, ?:\Windows\System32\findstr.exe, ?:\Windows\System32\chcp.comexcludes:process.executable field:"process.executable" value:"?:\Windows\system32\conhost.exe" field:"process.executable" value:"?:\Windows\System32\findstr.exe" field:"process.executable" value:"?:\Windows\System32\chcp.com"
process.executablewildcard?:\Program Files\MySQL\MySQL Server *\bin\mysqld.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\MySQL\MySQL Server *\bin\mysqld.exe"

Suspicious Hidden Executable and Immediate Network Connection

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

Detects when an IP address is supplied as an argument to a hidden executable. Threat actors will drop hidden payloads that are themselves droppers and when supplied with an ip address download additional payload stages or tools.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when an IP address is supplied as an argument to a hidden executable. Threat actors will drop hidden payloads
that are themselves droppers and when supplied with an ip address download additional payload stages or tools.
"""
id = "11cfb64b-1268-402e-9064-5a2d7af70cce"
license = "Elastic License v2"
name = "Suspicious Hidden Executable and Immediate Network Connection"
os_list = ["macos"]
version = "1.0.5"

query = '''
sequence by process.entity_id with maxspan=30s
[process where event.type == "start" and event.action == "exec" and process.name like~ ".*" and process.args regex~ "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"]
[network where event.type == "start"]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"


[[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 = "8.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name like~ ".*" and process.args regex~ "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"]

Stage 2: network

[network where event.type == "start"]

Indicators

These rows show field, operator, and value matches.

Suspicious Instance Metadata Service (IMDS) API Request

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

This rule identifies various tools/scripts performing network activities attempting to access the cloud service provider's instance metadata service (IMDS) API endpoint, which can be used to retrieve sensitive instance-specific information such as instance ID, public IP address, and even temporary security credentials if roles are assumed by that instance.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 3: Network connection

Rule Body

[metadata]
creation_date = "2026/05/22"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/22"

[rule]
author = ["Elastic"]
description = """
This rule identifies various tools/scripts performing network activities attempting to access the cloud service provider's
instance metadata service (IMDS) API endpoint, which can be used to retrieve sensitive instance-specific information such
as instance ID, public IP address, and even temporary security credentials if roles are assumed by that instance.
"""
from = "now-9m"
index = ["logs-endpoint.events.network-*"]
language = "kuery"
license = "Elastic License v2"
name = "Suspicious Instance Metadata Service (IMDS) API Request"
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 Instance Metadata Service (IMDS) API Request

This alert flags command interpreters, scripting engines, or unusual binaries on a host trying to contact the local instance metadata service, a high-value source of instance details and temporary cloud credentials. A common attacker pattern is gaining code execution on a Linux or Windows VM, then using curl, PowerShell, or a script dropped in a temporary directory to query 169.254.169.254 and harvest the attached role credentials for follow-on cloud access.

### Possible investigation steps

- Review the full execution chain and any referenced script or binary contents to determine whether the metadata request came from approved bootstrap or agent activity versus an interactive shell, web application process, scheduled job, or recently dropped file.
- Identify the initiating account, session context, and trigger for the execution to separate expected automation from hands-on-keyboard behavior, especially if it followed a remote login, privilege escalation, or exploitation event.
- Correlate the host and timeframe with cloud control-plane telemetry to confirm whether instance role credentials or managed identity tokens were later used against storage, secrets, IAM, subscription, or other sensitive APIs.
- Examine nearby endpoint activity for follow-on collection and staging behavior such as writing token output to disk, exporting environment data, invoking cloud CLIs or SDKs, compressing files, or making outbound connections to unfamiliar destinations.
- Validate with the asset owner whether the workload legitimately requires IMDS access, and if the activity is unexplained, contain the host and rotate any exposed instance profile or managed identity credentials.

### False positive analysis

- A legitimate bootstrap, login, or scheduled administration script may use curl, PowerShell, or Python to query 169.254.169.254 for instance ID, public IP, or temporary role credentials during normal configuration, so verify the command line, parent process, and execution timing match expected startup or maintenance activity from an approved path.
- An approved in-house application or service may call IMDS through a shell or runtime such as java, node, or python to obtain instance-specific settings or cloud authentication at runtime, so confirm the binary or script is expected on that host and that the requests align with normal service startup behavior rather than a new interactive session or a temporary-directory executable.

### Response and remediation

- Isolate the affected instance or host from the network or move it to a containment security group, terminate active remote sessions, and preserve volatile evidence such as the running process tree, shell history, temporary scripts, and recent command output tied to the 169.254.169.254 request.
- Revoke or rotate any cloud role credentials, API keys, tokens, and application secrets that may have been exposed through IMDS, and detach or replace the instance profile or managed identity if it granted access beyond the workload’s normal needs.
- Remove the attacker’s foothold by deleting the script or binary that queried IMDS and eradicating associated persistence such as cron jobs, systemd services, rc.local changes, scheduled tasks, Run keys, WMI event subscriptions, launch agents, or modified shell startup files.
- Restore the system from a known-good image or snapshot when integrity is in doubt, validate that no unauthorized users, SSH keys, services, or startup items remain, and reset credentials for any local, domain, or service accounts used on the host.
- Escalate to incident response and cloud security immediately if IMDS returned temporary role credentials, if that role was used from unfamiliar IP addresses or regions, or if similar metadata queries are observed on multiple hosts, and expand scoping to all resources reachable by the compromised role.
- Harden the environment by enforcing IMDSv2 or the cloud provider’s strongest metadata protections, disabling metadata access where unnecessary, blocking local access to 169.254.169.254 for unapproved processes, reducing instance-role privileges, and preventing script execution from temporary or user-writable directories.
"""
references = [
    "https://hackingthe.cloud/aws/general-knowledge/intro_metadata_service/",
    "https://www.wiz.io/blog/imds-anomaly-hunting-zero-day",
]
risk_score = 47
rule_id = "ad02da2f-443d-454c-a12e-d9e6c65831ff"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "Domain: Cloud",
    "OS: Linux",
    "OS: Windows",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Discovery",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:"network" and host.os.type:("windows" or "macos" or "linux") and
 (destination.ip:"169.254.169.254" or destination.address :"169.254.169.254") and destination.port:"80" and (
  process.name:(
    "bash" or "dash" or "sh" or "tcsh" or "tclsh" or "wish" or "csh" or "zsh" or "ksh" or "fish" or
    "mksh" or "busybox" or "ld.so" or "ld-linux-x86-64.so.2" or "bun" or "bun.exe" or "node" or "node.exe" or
    "nodejs" or "deno" or "deno.exe" or "java" or "java.exe" or "env" or "timeout" or "setsid" or "flock" or
    "curl" or "curl.exe" or "wget" or "wget.exe" or "powershell.exe" or "cmd.exe" or "pwsh.exe" or
    "wscript.exe" or  "cscript.exe" or "regsvr32.exe" or "mshta.exe" or "rundll32.exe" or "vbc.exe" or
    "msbuild.exe" or "wmic.exe" or "cmstp.exe" or "RegAsm.exe" or "installutil.exe" or "RegSvcs.exe" or
    "msxsl.exe" or "xwizard.exe" or "csc.exe" or "pwsh" or python* or perl* or ruby* or lua* or php* or
    "terminal" or "osascript" or "nohup" or .* or "javaw" or "javaw.exe"
  ) or
  process.executable:(
    ./* or /boot/* or /dev/shm/* or /run/* or /var/run/* or /tmp/* or /var/tmp/* or /var/www/* or
    /home/*/* or /root/* or /private/var/tmp/* or /var/folders/* or /Users/Shared/* or /var/root/*
  )
) and
not (
  (
    host.os.type:"macos" and
    process.name:"node"
  ) or
  (
    process.name:"Cursor Helper (Plugin)" and
    process.code_signature.trusted:true and
    process.code_signature.signing_id:"com.github.Electron.helper"
  ) or
  (
    process.name:"Code Helper (Plugin)" and
    process.code_signature.trusted:true and
    process.code_signature.signing_id:("com.microsoft.VSCode.helper" or "com.github.Electron.helper")
  ) or
  process.executable:/vscode/vscode-server/bin/linux-x64/*/node
)
'''

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

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

[[rule.threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"

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

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

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

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

[[rule.threat.technique]]
id = "T1580"
name = "Cloud Infrastructure Discovery"
reference = "https://attack.mitre.org/techniques/T1580/"

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

[rule.new_terms]
field = "new_terms_fields"
value = ["host.id", "process.executable"]

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

Stages and Predicates

Stage 1: new_terms

event.category:"network" and host.os.type:("windows" or "macos" or "linux") and
 (destination.ip:"169.254.169.254" or destination.address :"169.254.169.254") and destination.port:"80" and (
  process.name:(
    "bash" or "dash" or "sh" or "tcsh" or "tclsh" or "wish" or "csh" or "zsh" or "ksh" or "fish" or
    "mksh" or "busybox" or "ld.so" or "ld-linux-x86-64.so.2" or "bun" or "bun.exe" or "node" or "node.exe" or
    "nodejs" or "deno" or "deno.exe" or "java" or "java.exe" or "env" or "timeout" or "setsid" or "flock" or
    "curl" or "curl.exe" or "wget" or "wget.exe" or "powershell.exe" or "cmd.exe" or "pwsh.exe" or
    "wscript.exe" or  "cscript.exe" or "regsvr32.exe" or "mshta.exe" or "rundll32.exe" or "vbc.exe" or
    "msbuild.exe" or "wmic.exe" or "cmstp.exe" or "RegAsm.exe" or "installutil.exe" or "RegSvcs.exe" or
    "msxsl.exe" or "xwizard.exe" or "csc.exe" or "pwsh" or python* or perl* or ruby* or lua* or php* or
    "terminal" or "osascript" or "nohup" or .* or "javaw" or "javaw.exe"
  ) or
  process.executable:(
    ./* or /boot/* or /dev/shm/* or /run/* or /var/run/* or /tmp/* or /var/tmp/* or /var/www/* or
    /home/*/* or /root/* or /private/var/tmp/* or /var/folders/* or /Users/Shared/* or /var/root/*
  )
) and
not (
  (
    host.os.type:"macos" and
    process.name:"node"
  ) or
  (
    process.name:"Cursor Helper (Plugin)" and
    process.code_signature.trusted:true and
    process.code_signature.signing_id:"com.github.Electron.helper"
  ) or
  (
    process.name:"Code Helper (Plugin)" and
    process.code_signature.trusted:true and
    process.code_signature.signing_id:("com.microsoft.VSCode.helper" or "com.github.Electron.helper")
  ) or
  process.executable:/vscode/vscode-server/bin/linux-x64/*/node
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.addresseq
  • 169.254.169.254
field:"destination.address" kind:eq value:"169.254.169.254"
destination.ipeq
  • 169.254.169.254
field:"dest_ip" kind:eq value:"169.254.169.254"
destination.porteq
  • 80 corpus 7 (sigma 6, elastic 1)
field:"DestinationPort" kind:eq value:"80"
event.categoryeq
  • network corpus 12 (elastic 12)
field:"event.category" kind:eq value:"network"
process.executablewildcard
  • ./* corpus 10 (elastic 10)
  • /Users/Shared/* corpus 6 (elastic 5, sigma 1)
  • /boot/* corpus 11 (elastic 11)
  • /dev/shm/* corpus 25 (elastic 23, sigma 2)
  • /home/*/* corpus 9 (elastic 9)
  • /private/var/tmp/* corpus 2 (elastic 2)
  • /root/* corpus 3 (elastic 3)
  • /run/* corpus 9 (elastic 9)
  • /tmp/* corpus 28 (elastic 26, sigma 2)
  • /var/folders/* corpus 3 (elastic 3)
  • /var/root/* corpus 4 (elastic 4)
  • /var/run/* corpus 12 (elastic 12)
  • /var/tmp/* corpus 27 (elastic 26, sigma 1)
  • /var/www/* corpus 4 (elastic 4)
field:"Image" kind:wildcard
process.nameeq
  • RegAsm.exe corpus 25 (elastic 24, splunk 1)
  • RegSvcs.exe corpus 22 (elastic 21, splunk 1)
  • bash corpus 10 (elastic 10)
  • bun corpus 4 (elastic 4)
  • bun.exe corpus 3 (elastic 3)
  • busybox corpus 6 (elastic 6)
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • cmstp.exe corpus 25 (elastic 25)
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • csh corpus 6 (elastic 6)
  • curl corpus 15 (elastic 11, splunk 4)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • dash corpus 8 (elastic 8)
  • deno corpus 2 (elastic 2)
  • deno.exe corpus 3 (elastic 3)
  • env corpus 2 (elastic 2)
  • fish corpus 6 (elastic 6)
  • flock corpus 2 (elastic 2)
  • installutil.exe corpus 36 (elastic 32, splunk 4)
  • java corpus 3 (elastic 3)
  • java.exe corpus 2 (elastic 1, splunk 1)
  • javaw
  • javaw.exe corpus 9 (elastic 9)
  • ksh corpus 7 (elastic 7)
  • ld-linux-x86-64.so.2 corpus 2 (elastic 2)
  • ld.so corpus 2 (elastic 2)
  • mksh corpus 2 (elastic 2)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msxsl.exe corpus 22 (elastic 22)
  • node corpus 8 (elastic 8)
  • node.exe corpus 6 (elastic 6)
  • nodejs corpus 2 (elastic 2)
  • nohup
  • osascript corpus 6 (elastic 5, splunk 1)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • pwsh
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
  • regsvr32.exe corpus 74 (elastic 69, splunk 5)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • setsid corpus 2 (elastic 2)
  • sh corpus 10 (elastic 10)
  • tclsh corpus 2 (elastic 2)
  • tcsh corpus 7 (elastic 7)
  • terminal
  • timeout corpus 2 (elastic 2)
  • vbc.exe corpus 8 (elastic 8)
  • wget corpus 10 (elastic 9, splunk 1)
  • wget.exe corpus 7 (elastic 7)
  • wish corpus 2 (elastic 2)
  • wmic.exe corpus 66 (elastic 39, splunk 27)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
  • xwizard.exe corpus 16 (elastic 16)
  • zsh corpus 10 (elastic 10)
field:"process_basename" kind:eq
process.namewildcard
  • .* corpus 21 (elastic 21)
  • lua* corpus 20 (elastic 20)
  • perl* corpus 25 (elastic 25)
  • php* corpus 17 (elastic 17)
  • python* corpus 55 (elastic 55)
  • ruby* corpus 26 (elastic 26)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

System BootKey Registry Access

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

Identifies attempts to read the registry values used to calculate the System BootKey, which adversaries can use to recover passwords and other secrets from the registry.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to read the registry values used to calculate the System BootKey, which adversaries can use to
recover passwords and other secrets from the registry.
"""
id = "ae7812a1-1329-47b4-9d76-8c7359cda4e4"
license = "Elastic License v2"
name = "System BootKey Registry Access"
os_list = ["windows"]
reference = [
    "http://moyix.blogspot.com/2008/02/syskey-and-sam.html",
    "https://github.com/gentilkiwi/mimikatz/wiki/module-~-lsadump",
]
version = "1.0.28"

query = '''
sequence by process.entity_id with maxspan=1m
  [registry where event.action == "query" and
   /* Bootkey/Syskey - GBG, JD, Skew1 */
   registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Skew1*",
                    "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JD*",
                    "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JDLSA\\GBG*") and
   not (process.executable : ("?:\\Windows\\System32\\lsass.exe", "?:\\Windows\\System32\\svchost.exe") and
        user.id in ("S-1-5-18", "S-1-5-19"))
   ]
   [registry where event.action == "query" and
    registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Skew1*",
                     "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JD*",
                     "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JDLSA\\GBG*")]
'''

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

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

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

[[threat.technique.subtechnique]]
id = "T1003.005"
name = "Cached Domain Credentials"
reference = "https://attack.mitre.org/techniques/T1003/005/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: registry

[registry where event.action == "query" and
   registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Skew1*",
                    "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JD*",
                    "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JDLSA\\GBG*") and
   not (process.executable : ("?:\\Windows\\System32\\lsass.exe", "?:\\Windows\\System32\\svchost.exe") and
        user.id in ("S-1-5-18", "S-1-5-19"))
   ]

Stage 2: registry

[registry where event.action == "query" and
    registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Skew1*",
                     "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JD*",
                     "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\JDLSA\\GBG*")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • query corpus 6 (elastic 6)
field:"EventType" kind:eq value:"query"
registry.pathwildcard
  • HKLM\SYSTEM\*ControlSet*\Control\Lsa\JD*
  • HKLM\SYSTEM\*ControlSet*\Control\Lsa\JDLSA\GBG*
  • HKLM\SYSTEM\*ControlSet*\Control\Lsa\Skew1*
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

Torsocks Execution

#
Source
github.com/elastic/protections-artifacts

This rule detects the execution of the "torsocks" binary, which is commonly used to route network traffic through the Tor network. Attackers may use "torsocks" to anonymize their network connections, making it harder to trace their activities. This tool is uncommonly used in a business context, and its presence may indicate an attempt to evade detection or exfiltrate data through the Tor network.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the execution of the "torsocks" binary, which is commonly used to route network traffic through the
Tor network. Attackers may use "torsocks" to anonymize their network connections, making it harder to trace their
activities. This tool is uncommonly used in a business context, and its presence may indicate an attempt to evade
detection or exfiltrate data through the Tor network.
"""
id = "3beb08ba-79ab-4d16-b33a-25479551967e"
license = "Elastic License v2"
name = "Torsocks Execution"
os_list = ["linux"]
reference = ["https://www.trendmicro.com/en_us/research/25/f/tor-enabled-docker-exploit.html"]
version = "1.0.3"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "torsocks"
'''

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

[[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.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"



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

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

[threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"


[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

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "torsocks"

Indicators

These rows show field, operator, and value matches.

Unsigned or Untrusted Process Execution via Installer

#
Source
github.com/elastic/protections-artifacts

Detects the execution of an unsigned or untrusted process via a shell by the macOS installer binary. This activity is abnormal and may indicate an attempt to stage and execute a malicious payload.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects the execution of an unsigned or untrusted process via a shell by the macOS installer binary. This activity is
abnormal and may indicate an attempt to stage and execute a malicious payload.
"""
id = "752a2f7f-8d0c-4a7e-9665-ec948d14e947"
license = "Elastic License v2"
name = "Unsigned or Untrusted Process Execution via Installer"
os_list = ["macos"]
version = "1.0.5"

query = '''
process where event.type == "start" and 
 (process.code_signature.trusted == false or process.code_signature.exists == false) and 
 process.args_count == 1 and 
 process.parent.name in ("bash", "sh", "zsh") and
 process.Ext.effective_parent.executable like~ ("/usr/sbin/installer", "/System/Library/CoreServices/Installer.app/Contents/MacOS/Installer")
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[threat.technique.subtechnique]]
id = "T1546.016"
name = "Installer Packages"
reference = "https://attack.mitre.org/techniques/T1546/016/"



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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and 
 (process.code_signature.trusted == false or process.code_signature.exists == false) and 
 process.args_count == 1 and 
 process.parent.name in ("bash", "sh", "zsh") and
 process.Ext.effective_parent.executable like~ ("/usr/sbin/installer", "/System/Library/CoreServices/Installer.app/Contents/MacOS/Installer")

Indicators

These rows show field, operator, and value matches.

Unusual Command Execution via Systemd Scheduled Task

#
Source
github.com/elastic/protections-artifacts

This rule detects the execution of suspicious commands and executables by systemd scheduled tasks. Threat actors may abuse these scheduled tasks to execute malicious commands or scripts to maintain persistence or escalate privileges.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the execution of suspicious commands and executables by systemd scheduled tasks. Threat actors may
abuse these scheduled tasks to execute malicious commands or scripts to maintain persistence or escalate privileges.
"""
id = "3ac60981-20ef-4dac-b7e4-aad2ac56a93e"
license = "Elastic License v2"
name = "Unusual Command Execution via Systemd Scheduled Task"
os_list = ["linux"]
reference = [
    "https://pberba.github.io/security/2022/01/30/linux-threat-hunting-for-persistence-systemd-timers-cron/",
    "https://www.elastic.co/security-labs/primer-on-persistence-mechanisms",
]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and process.parent.name == "systemd" and 
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "pwsh", "mksh") and
process.args in ("-c", "--command", "-lc", "-cl") and (
  process.command_line like~ (

    /* Encoding, Decoding & Piping */
    "*|sh", "*| sh *", "*| sh ", "*|bash*", "*| bash*", "*|zsh*",  "*| zsh*", "*|dash*",  "*| dash*",
    "*|python*", "*| python*", "*|php*", "*| php*", "*|perl*", "*| perl*", "*|ruby*", "*| ruby*",
    "*|node*", "*| node*", "*|lua*",  "*| lua*", "*|busybox*", "*| busybox*", "*|*base64 -d*", "*|*base64 --decode*",
    "*|*openssl base64 -d*", "*xxd *", "*| openssl*enc * -d *", "*b64decode -r*",

    /* Reverse Shell CLIs */
    "*/dev/tcp*", "*/dev/udp/*", "*import*pty*spawn*", "*import*subprocess*call*", "*TCPSocket.new*", "*TCPSocket.open*",
    "*io.popen*", "*os.execute*", "*fsockopen*", "*socat*exec:*", "*socat*tcp-connect*",

    /* File Manipulation */
    "*/dev/shm/*",
    "*> /tmp/*", "*>> /tmp/*", "*>/tmp/*", "*>>/tmp/*",  
    "*> /var/tmp/*", "*>> /var/tmp/*", "*>/var/tmp/*", "*>>/var/tmp/*",
    "*> /run/user/*", "*>> /run/user/*", "*>/run/user/*", "*>>/run/user/*",
    "*> /var/run/user/*", "*>> /var/run/user/*", "*>/var/run/user/*", "*>>/var/run/user/*",

    /* Persistence */
    "*>*/etc/cron*", "*>*/home/*/.ssh/*", "*>*/root/.ssh*", "*>*~/.ssh/*", "*>*/etc/shadow*", "*>*/etc/passwd*",
    "*>*/etc/master.passwd*", "*chpasswd*", "*NOPASSWD:ALL*>*sudoers.d*", "*>*/etc/systemd/system/*[Unit]*ExecStart*",
    "*| crontab -*",

    /* Miscellaneous */
    "* setsid *", "*timeout *sh -c *", "*disown*",  "*chattr *", "busybox *", "*chmod +x *", "*chmod 777*", 
    "*<?php*?>*", "*kworker*", "*stty*raw*-echo*", "*mkfifo /tmp/*"
  ) or
  (
    process.command_line like ("*curl *", "*wget *") and (
      process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
      process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
      process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
      process.command_line like~ "*wget* --output-document*" or
      process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
      process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") or
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*"
    )
  )
) and 
not (
  process.command_line like (
    "*localhost*", "*127.0.0.1*", "*>*/run/*.pid", "*>*/tmp/*.log*", "*/etc/init.d/mailman*", "/bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1",
     """/bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr""", "/bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*",
    """/bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload""", "*api.github.com/meta*", "*/opt/commvault/*",
    "/bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s", "/bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1",
    "*test*", "*grep*", "*logger*", "/bin/sh -c curl --user*.log", "/bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &", "/bin/sh -c*backup.sh*logToFile.sh",
    "/bin/sh -c /home/*/sub/backup-archivelogs.sh*", "*/usr/bin/curl -s https://check.torproject.org/torbulkexitlist*", "*/run/cloud-init/share/*.sock*",
    "sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*", "*cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*",
    "/bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1",
    "/bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1",
    "bash -c chmod +x /opt/forticlientems/bin/ubuntu24_upgrade_check.sh && /opt/forticlientems/bin/ubuntu24_upgrade_check.sh", "/bin/sh -c /bin/chmod 777 /upload/cms-embossing/*",
    """/bin/sh -c /usr/bin/timeout 60 /bin/sh -c 'while ! /usr/bin/timeout 1 /usr/bin/host www.*.com >/dev/null 2>&1; do /bin/sleep 0.1; done' && /bin/echo "DNS works!"""",
    "*.gr/index.php?option=com_acymailing&ctrl=cron*", "*_sync_last_success_timestamp_seconds*10.10.20.204:9091/metrics*", "*get.upwind.io/sensor.sh*",
    "*/opt/traps/download/contents/*/km_extractor*", "/bin/sh -c /usr/bin/wget -O - -q -t 1 http://*.ultimatebeautywisdom.com/?wlmcron=1",
    "/bin/bash -c wget -O /dev/null https://*/api/cronjob_late_fee_fine >/dev/null 2>&1",
    "/bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/school_package_subscription_cron >/dev/null 2>&1",
    "/bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/db_backup >/dev/null 2>&1"
  ) or
  process.command_line in (
    "/bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null",
    "/bin/sh -c curl -L https://chef.io/chef/install.sh | bash", "sh -c ldd /usr/bin/mkfifo 2>&1",
    "/bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade",
    "/bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade",
    "/bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh",
    """/usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env""",
    "/bin/bash -c curl -fsSLO https://get.upwind.io/sensor.sh && echo \"$(curl -fsSL https://get.upwind.io/sensor.sh.sha256)  sensor.sh\" | sha256sum -c - && bash sensor.sh upgrade",
    "/bin/bash -lc timeout 45 /usr/bin/claude --model claude-haiku-4-5 -p \"reply: pong\" > /tmp/claude-quota-refresh.last 2>&1 || true",
    "/bin/sh -c echo \"$(date) $(whoami)\" >>/tmp/log"
  ) or
  process.args like (
    "[ ! -e *", "ansible *", "php -q /var/www/*php > /tmp/datastore*", "wget --proxy=off*cat*batch_trigger.log",
    "sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*",
    "/usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*", "export PM2_HOME=*",    
    "/usr/bin/curl*/var/log/checkdiskusage.log", "ps*/opt/fortinet/fortisiem/linux-agent/tmp/*",
    "iostat*/tmp/iostat.cache", "/usr/local/psa/admin/sbin/modules/aast-dnssec/event*",
    "export PATH=/opt/imunify360/venv/bin*alt-php-els/install-els-alt-php-deb-repo.sh*",
    "echo BAS_SERVICE_MARKER > /tmp/bas_service_exec_marker.txt"
  ) or 
  process.working_directory like "/opt/nessus_agent/*"
)
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.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.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"



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

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



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

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



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"


[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

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.parent.name == "systemd" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "pwsh", "mksh") and
process.args in ("-c", "--command", "-lc", "-cl") and (
  process.command_line like~ (
    "*|sh", "*| sh *", "*| sh ", "*|bash*", "*| bash*", "*|zsh*",  "*| zsh*", "*|dash*",  "*| dash*",
    "*|python*", "*| python*", "*|php*", "*| php*", "*|perl*", "*| perl*", "*|ruby*", "*| ruby*",
    "*|node*", "*| node*", "*|lua*",  "*| lua*", "*|busybox*", "*| busybox*", "*|*base64 -d*", "*|*base64 --decode*",
    "*|*openssl base64 -d*", "*xxd *", "*| openssl*enc * -d *", "*b64decode -r*",
    "*/dev/tcp*", "*/dev/udp/*", "*import*pty*spawn*", "*import*subprocess*call*", "*TCPSocket.new*", "*TCPSocket.open*",
    "*io.popen*", "*os.execute*", "*fsockopen*", "*socat*exec:*", "*socat*tcp-connect*",
    "*/dev/shm/*",
    "*> /tmp/*", "*>> /tmp/*", "*>/tmp/*", "*>>/tmp/*",
    "*> /var/tmp/*", "*>> /var/tmp/*", "*>/var/tmp/*", "*>>/var/tmp/*",
    "*> /run/user/*", "*>> /run/user/*", "*>/run/user/*", "*>>/run/user/*",
    "*> /var/run/user/*", "*>> /var/run/user/*", "*>/var/run/user/*", "*>>/var/run/user/*",
    "*>*/etc/cron*", "*>*/home/*/.ssh/*", "*>*/root/.ssh*", "*>*~/.ssh/*", "*>*/etc/shadow*", "*>*/etc/passwd*",
    "*>*/etc/master.passwd*", "*chpasswd*", "*NOPASSWD:ALL*>*sudoers.d*", "*>*/etc/systemd/system/*[Unit]*ExecStart*",
    "*| crontab -*",
    "* setsid *", "*timeout *sh -c *", "*disown*",  "*chattr *", "busybox *", "*chmod +x *", "*chmod 777*",
    "*<?php*?>*", "*kworker*", "*stty*raw*-echo*", "*mkfifo /tmp/*"
  ) or
  (
    process.command_line like ("*curl *", "*wget *") and (
      process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
      process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
      process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
      process.command_line like~ "*wget* --output-document*" or
      process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
      process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") or
      process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*"
    )
  )
) and
not (
  process.command_line like (
    "*localhost*", "*127.0.0.1*", "*>*/run/*.pid", "*>*/tmp/*.log*", "*/etc/init.d/mailman*", "/bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1",
     """/bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr""", "/bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*",
    """/bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload""", "*api.github.com/meta*", "*/opt/commvault/*",
    "/bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s", "/bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1",
    "*test*", "*grep*", "*logger*", "/bin/sh -c curl --user*.log", "/bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &", "/bin/sh -c*backup.sh*logToFile.sh",
    "/bin/sh -c /home/*/sub/backup-archivelogs.sh*", "*/usr/bin/curl -s https://check.torproject.org/torbulkexitlist*", "*/run/cloud-init/share/*.sock*",
    "sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*", "*cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*",
    "/bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1",
    "/bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1",
    "bash -c chmod +x /opt/forticlientems/bin/ubuntu24_upgrade_check.sh && /opt/forticlientems/bin/ubuntu24_upgrade_check.sh", "/bin/sh -c /bin/chmod 777 /upload/cms-embossing/*",
    """/bin/sh -c /usr/bin/timeout 60 /bin/sh -c 'while ! /usr/bin/timeout 1 /usr/bin/host www.*.com >/dev/null 2>&1; do /bin/sleep 0.1; done' && /bin/echo "DNS works!"""",
    "*.gr/index.php?option=com_acymailing&ctrl=cron*", "*_sync_last_success_timestamp_seconds*10.10.20.204:9091/metrics*", "*get.upwind.io/sensor.sh*",
    "*/opt/traps/download/contents/*/km_extractor*", "/bin/sh -c /usr/bin/wget -O - -q -t 1 http://*.ultimatebeautywisdom.com/?wlmcron=1",
    "/bin/bash -c wget -O /dev/null https://*/api/cronjob_late_fee_fine >/dev/null 2>&1",
    "/bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/school_package_subscription_cron >/dev/null 2>&1",
    "/bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/db_backup >/dev/null 2>&1"
  ) or
  process.command_line in (
    "/bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null",
    "/bin/sh -c curl -L https://chef.io/chef/install.sh | bash", "sh -c ldd /usr/bin/mkfifo 2>&1",
    "/bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade",
    "/bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade",
    "/bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh",
    """/usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env""",
    "/bin/bash -c curl -fsSLO https://get.upwind.io/sensor.sh && echo \"$(curl -fsSL https://get.upwind.io/sensor.sh.sha256)  sensor.sh\" | sha256sum -c - && bash sensor.sh upgrade",
    "/bin/bash -lc timeout 45 /usr/bin/claude --model claude-haiku-4-5 -p \"reply: pong\" > /tmp/claude-quota-refresh.last 2>&1 || true",
    "/bin/sh -c echo \"$(date) $(whoami)\" >>/tmp/log"
  ) or
  process.args like (
    "[ ! -e *", "ansible *", "php -q /var/www/*php > /tmp/datastore*", "wget --proxy=off*cat*batch_trigger.log",
    "sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*",
    "/usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*", "export PM2_HOME=*",
    "/usr/bin/curl*/var/log/checkdiskusage.log", "ps*/opt/fortinet/fortisiem/linux-agent/tmp/*",
    "iostat*/tmp/iostat.cache", "/usr/local/psa/admin/sbin/modules/aast-dnssec/event*",
    "export PATH=/opt/imunify360/venv/bin*alt-php-els/install-els-alt-php-deb-repo.sh*",
    "echo BAS_SERVICE_MARKER > /tmp/bas_service_exec_marker.txt"
  ) or
  process.working_directory like "/opt/nessus_agent/*"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argsin
  • --command
  • -c
  • -cl
  • -lc
field:"process.args" kind:in
process.command_lineregex_match
  • .*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}(:[0-9]{1,5})?/.*
  • .*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?
  • .*wget.* \-[a-zA-Z]*O.*
field:"CommandLine" kind:regex_match
process.command_linewildcard
  • * setsid *
  • */dev/shm/*
  • */dev/tcp*
  • */dev/udp/*
  • *<?php*?>*
  • *> /run/user/*
  • *> /tmp/*
  • *> /var/run/user/*
  • *> /var/tmp/*
  • *>*/etc/cron*
  • *>*/etc/master.passwd*
  • *>*/etc/passwd*
  • *>*/etc/shadow*
  • *>*/etc/systemd/system/*[Unit]*ExecStart*
  • *>*/home/*/.ssh/*
  • *>*/root/.ssh*
  • *>*~/.ssh/*
  • *>/run/user/*
  • *>/tmp/*
  • *>/var/run/user/*
  • *>/var/tmp/*
  • *>> /run/user/*
  • *>> /tmp/*
  • *>> /var/run/user/*
  • *>> /var/tmp/*
  • *>>/run/user/*
  • *>>/tmp/*
  • *>>/var/run/user/*
  • *>>/var/tmp/*
  • *NOPASSWD:ALL*>*sudoers.d*
  • *TCPSocket.new*
  • *TCPSocket.open*
  • *b64decode -r*
  • *chattr *
  • *chmod +x *
  • *chmod 777*
  • *chpasswd*
  • *curl *
  • *curl *> /*
  • *curl *>/*
  • +60 more values (see full rule source)
field:"CommandLine" kind:wildcard
process.namein
  • bash
  • busybox
  • csh
  • dash
  • fish
  • ksh
  • mksh
  • pwsh
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in
process.parent.nameeq
  • systemd
field:"parent_process_basename" kind:eq value:"systemd"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard[ ! -e *, ansible *, php -q /var/www/*php > /tmp/datastore*, wget --proxy=off*cat*batch_trigger.log, sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*, /usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*, export PM2_HOME=*, /usr/bin/curl*/var/log/checkdiskusage.log, ps*/opt/fortinet/fortisiem/linux-agent/tmp/*, iostat*/tmp/iostat.cache, /usr/local/psa/admin/sbin/modules/aast-dnssec/event*, export PATH=/opt/imunify360/venv/bin*alt-php-els/install-els-alt-php-deb-repo.sh*, echo BAS_SERVICE_MARKER > /tmp/bas_service_exec_marker.txtexcludes:process.args
process.command_linein/bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade, /bin/bash -c curl -fsSLO https://get.upwind.io/sensor.sh && echo "$(curl -fsSL https://get.upwind.io/sensor.sh.sha256) sensor.sh" | sha256sum -c - && bash sensor.sh upgrade, /bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade, /bin/bash -lc timeout 45 /usr/bin/claude --model claude-haiku-4-5 -p "reply: pong" > /tmp/claude-quota-refresh.last 2>&1 || true, /bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh, /bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null, /bin/sh -c curl -L https://chef.io/chef/install.sh | bash, /bin/sh -c echo "$(date) $(whoami)" >>/tmp/log, /usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env, sh -c ldd /usr/bin/mkfifo 2>&1excludes:process.command_line
process.command_linewildcard*localhost*, *127.0.0.1*, *>*/run/*.pid, *>*/tmp/*.log*, */etc/init.d/mailman*, /bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1, /bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr, /bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*, /bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload, *api.github.com/meta*, */opt/commvault/*, /bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s, /bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1, *test*, *grep*, *logger*, /bin/sh -c curl --user*.log, /bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &, /bin/sh -c*backup.sh*logToFile.sh, /bin/sh -c /home/*/sub/backup-archivelogs.sh*, */usr/bin/curl -s https://check.torproject.org/torbulkexitlist*, */run/cloud-init/share/*.sock*, sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*, *cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*, /bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1, /bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1, bash -c chmod +x /opt/forticlientems/bin/ubuntu24_upgrade_check.sh && /opt/forticlientems/bin/ubuntu24_upgrade_check.sh, /bin/sh -c /bin/chmod 777 /upload/cms-embossing/*, /bin/sh -c /usr/bin/timeout 60 /bin/sh -c 'while ! /usr/bin/timeout 1 /usr/bin/host www.*.com >/dev/null 2>&1; do /bin/sleep 0.1; done' && /bin/echo "DNS works!", *.gr/index.php?option=com_acymailing&ctrl=cron*, *_sync_last_success_timestamp_seconds*10.10.20.204:9091/metrics*, *get.upwind.io/sensor.sh*, */opt/traps/download/contents/*/km_extractor*, /bin/sh -c /usr/bin/wget -O - -q -t 1 http://*.ultimatebeautywisdom.com/?wlmcron=1, /bin/bash -c wget -O /dev/null https://*/api/cronjob_late_fee_fine >/dev/null 2>&1, /bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/school_package_subscription_cron >/dev/null 2>&1, /bin/bash -c wget -O /dev/null https://*/system_admin/c_cron/db_backup >/dev/null 2>&1excludes:process.command_line
process.working_directorystarts_with/opt/nessus_agent/excludes:process.working_directory field:"process.working_directory" value:"/opt/nessus_agent/"

Unusual DNS Activity

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

A machine learning job detected a rare and unusual DNS query that indicate network activity with unusual DNS domains. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from an uncommon domain. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for command-and-control communication.

Known False Positives

  • A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this alert. Network activity that occurs rarely, in small quantities, can trigger this alert. Possible examples are browsing technical support or vendor networks sparsely. A user who visits a new or unique web destination may trigger this alert.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "network_traffic"]
maturity = "production"
min_stack_version = "9.5.0"
min_stack_comments = "Migrate packetbeat job to security network module"
updated_date = "2026/07/27"

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected a rare and unusual DNS query that indicate network activity with unusual DNS domains.
This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user
clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload
from an uncommon domain. When malware is already running, it may send requests to an uncommon DNS domain the malware
uses for command-and-control communication.
"""
false_positives = [
    """
    A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this
    alert. Network activity that occurs rarely, in small quantities, can trigger this alert. Possible examples are
    browsing technical support or vendor networks sparsely. A user who visits a new or unique web destination may
    trigger this alert.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "rare_dns_question_ea"
name = "Unusual DNS Activity"
setup = """## Setup

This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Network Packet Capture

### Anomaly Detection Setup

Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).

### 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 to your 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/current/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).

### Network Packet Capture Integration Setup
The Network Packet Capture integration sniffs network packets on a host and dissects known protocols. Monitoring the network traffic is critical to gaining observability and securing your environment — ensuring high levels of performance and security. The Network Packet Capture integration captures the network traffic between your application servers, decodes common application layer protocols and records the interesting fields for each transaction.

#### The following steps should be executed in order to add the Elastic Agent System integration "network_traffic" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Network Packet Capture” and select the integration to see more details about it.
- Click “Add Network Packet Capture”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “network_traffic” to an existing or a new agent policy, and deploy the agent on your system from which network log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/network_traffic).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "746edc4c-c54c-49c6-97a1-651223819448"
severity = "low"
tags = [
    "Data Source: Elastic Defend",
    "Data Source: Network Packet Capture",
    "Use Case: Threat Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Command and Control",
    "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 Unusual DNS Activity
DNS is crucial for translating domain names into IP addresses, enabling network communication. Adversaries exploit DNS by using rare domains for malicious activities like phishing or command-and-control. The 'Unusual DNS Activity' detection rule leverages machine learning to identify atypical DNS queries, signaling potential threats such as unauthorized access or data exfiltration.

### Possible investigation steps

- Review the DNS query logs to identify the specific rare domain that triggered the alert and determine its reputation using threat intelligence sources.
- Analyze the source IP address associated with the unusual DNS query to identify the device or user responsible for the activity.
- Check for any recent changes or anomalies in the network activity of the identified device or user, such as unusual login times or access to sensitive data.
- Investigate any related alerts or logs that might indicate a broader pattern of suspicious activity, such as multiple rare domain queries or connections to known malicious IP addresses.
- Examine endpoint security logs on the affected device for signs of malware or unauthorized software that could be responsible for the unusual DNS activity.
- Assess whether the unusual DNS activity aligns with known tactics, techniques, and procedures (TTPs) associated with command-and-control or data exfiltration, referencing the MITRE ATT&CK framework for guidance.

### False positive analysis

- Legitimate software updates may trigger unusual DNS queries as they contact uncommon domains for downloading updates. Users can create exceptions for known update servers to reduce false positives.
- Internal applications using dynamic DNS services might generate rare DNS queries. Identifying and whitelisting these services can help in minimizing false alerts.
- Third-party security tools or monitoring solutions may use unique DNS queries for their operations. Verify and exclude these tools from the detection rule to prevent unnecessary alerts.
- Cloud services often use diverse and uncommon domains for legitimate operations. Regularly review and update the list of trusted cloud service domains to avoid false positives.
- New or infrequently accessed legitimate websites may appear as unusual. Users should monitor and whitelist these domains if they are confirmed to be safe and necessary for business operations.

### Response and remediation

- Isolate the affected system from the network to prevent further communication with the suspicious DNS domain and potential data exfiltration.
- Conduct a thorough scan of the isolated system using updated antivirus and anti-malware tools to identify and remove any malicious software.
- Review and block the identified unusual DNS domain at the network perimeter to prevent other systems from communicating with it.
- Analyze logs and network traffic to identify any other systems that may have communicated with the same unusual DNS domain and apply similar containment measures.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised.
- Restore the affected system from a known good backup if malware removal is not possible or if system integrity is in question.
- Update and enhance DNS monitoring rules to detect similar unusual DNS activity in the future, ensuring rapid identification and response to potential threats."""
[[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.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"

[[rule.threat.technique]]
id = "T1568"
name = "Dynamic Resolution"
reference = "https://attack.mitre.org/techniques/T1568/"

[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 = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"

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

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

[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"

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

Unusual Windows Username

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

A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new usernames are not often created apart from specific types of system activities, such as creating new accounts for new employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move laterally from one host to another.

Known False Positives

  • Uncommon user activity can be due to an administrator or help desk technician logging onto a workstation or server in order to perform manual troubleshooting or reconfiguration.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized
changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new
usernames are not often created apart from specific types of system activities, such as creating new accounts for new
employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to
suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when
personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for
malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move
laterally from one host to another.
"""
false_positives = [
    """
    Uncommon user activity can be due to an administrator or help desk technician logging onto a workstation or server
    in order to perform manual troubleshooting or reconfiguration.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_windows_anomalous_user_name_ea"]
name = "Unusual Windows Username"
note = """## Triage and analysis

### Investigating Unusual Windows Username
Detection alerts from this rule indicate activity for a Windows user name that is rare and unusual. Here are some possible avenues of investigation:
- Consider the user as identified by the username field. Is this program part of an expected workflow for the user who ran this program on this host? Could this be related to occasional troubleshooting or support activity?
- Examine the history of user activity. If this user only manifested recently, it might be a service account for a new software package. If it has a consistent cadence (for example if it runs monthly or quarterly), it might be part of a monthly or quarterly business process.
- Examine the process arguments, title and working directory. These may provide indications as to the source of the program or the nature of the tasks that the user is performing.
- Consider the same for the parent process. If the parent process is a legitimate system utility or service, this could be related to software updates or system management. If the parent process is something user-facing like an Office application, this process could be more suspicious."""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "1781d055-5c66-4adf-9c59-fc0fa58336a5"
setup = """## Setup

This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Windows

### Anomaly Detection Setup

Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).

### 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 to your 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/current/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).

### Windows Integration Setup
The Windows integration allows you to monitor the Windows OS, services, applications, and more.

#### The following steps should be executed in order to add the Elastic Agent System integration "windows" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Windows” and select the integration to see more details about it.
- Click “Add Windows”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “windows” to an existing or a new agent policy, and deploy the agent on your system from which windows log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/windows).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Use Case: Threat Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Initial Access",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.002"
name = "Domain Accounts"
reference = "https://attack.mitre.org/techniques/T1078/002/"

[[rule.threat.technique.subtechnique]]
id = "T1078.003"
name = "Local Accounts"
reference = "https://attack.mitre.org/techniques/T1078/003/"



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

Zoom Meeting with no Passcode

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

This rule identifies Zoom meetings that are created without a passcode. Meetings without a passcode are susceptible to Zoombombing. Zoombombing is carried out by taking advantage of Zoom sessions that are not protected with a passcode. Zoombombing refers to the unwanted, disruptive intrusion, generally by Internet trolls and hackers, into a video conference call. In a typical Zoombombing incident, a teleconferencing session is hijacked by the insertion of material that is lewd, obscene, racist, or antisemitic in nature, typically resulting of the shutdown of the session.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/09/14"
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rule identifies Zoom meetings that are created without a passcode. Meetings without a passcode are susceptible to
Zoombombing. Zoombombing is carried out by taking advantage of Zoom sessions that are not protected with a passcode.
Zoombombing refers to the unwanted, disruptive intrusion, generally by Internet trolls and hackers, into a video
conference call. In a typical Zoombombing incident, a teleconferencing session is hijacked by the insertion of material
that is lewd, obscene, racist, or antisemitic in nature, typically resulting of the shutdown of the session.
"""
index = ["filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Zoom Meeting with no Passcode"
references = [
    "https://blog.zoom.us/a-message-to-our-users/",
    "https://www.fbi.gov/contact-us/field-offices/boston/news/press-releases/fbi-warns-of-teleconferencing-and-online-classroom-hijacking-during-covid-19-pandemic",
]
risk_score = 47
rule_id = "58ac2aa5-6718-427c-a845-5f3ac5af00ba"
setup = """## Setup

The Zoom Filebeat module or similarly structured data is required to be compatible with this rule."""
severity = "medium"
tags = ["Data Source: Zoom", "Use Case: Configuration Audit", "Tactic: Initial Access", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.type:creation and event.module:zoom and data_stream.dataset:zoom.webhook and
  event.action:meeting.created and not zoom.meeting.password:*
'''
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 Zoom Meeting with no Passcode

Zoom meetings without passcodes are vulnerable to unauthorized access, known as Zoombombing, where intruders disrupt sessions with inappropriate content. Adversaries exploit this by joining unsecured meetings to cause chaos or gather sensitive information. The detection rule identifies such meetings by monitoring Zoom event logs for sessions created without a passcode, helping to mitigate potential security breaches.

### Possible investigation steps

- Review the Zoom event logs to identify the specific meeting details, including the meeting ID and the organizer's information, using the fields event.type, event.module, event.dataset, and event.action.
- Contact the meeting organizer to verify if the meeting was intentionally created without a passcode and understand the context or purpose of the meeting.
- Check for any unusual or unauthorized participants who joined the meeting by examining the participant logs associated with the meeting ID.
- Assess if any sensitive information was discussed or shared during the meeting that could have been exposed to unauthorized participants.
- Evaluate the need to implement additional security measures, such as enabling passcodes for all future meetings or using waiting rooms to control participant access.

### False positive analysis

- Internal team meetings may be scheduled without a passcode for convenience, especially if all participants are within a secure network. To handle this, create exceptions for meetings initiated by trusted internal users or within specific IP ranges.
- Recurring meetings with a consistent group of participants might not use passcodes to simplify access. Consider excluding these meetings by identifying and whitelisting their unique meeting IDs.
- Training sessions or webinars intended for a broad audience might be set up without passcodes to ease access. Implement a policy to review and approve such meetings in advance, ensuring they are legitimate and necessary.
- Meetings created by automated systems or bots for integration purposes may not require passcodes. Identify these systems and exclude their meeting creation events from triggering alerts.
- In some cases, meetings may be intentionally left without passcodes for public access, such as community events. Establish a process to verify and document these events, allowing them to be excluded from the rule.

### Response and remediation

- Immediately terminate any ongoing Zoom meetings identified without a passcode to prevent further unauthorized access or disruption.
- Notify the meeting host and relevant stakeholders about the security incident, advising them to reschedule the meeting with appropriate security measures, such as enabling a passcode or waiting room.
- Review and update Zoom account settings to enforce mandatory passcodes for all future meetings, ensuring compliance with security policies.
- Conduct a security audit of recent Zoom meetings to identify any other sessions that may have been created without a passcode and take corrective actions as necessary.
- Escalate the incident to the IT security team for further investigation and to assess any potential data breaches or information leaks resulting from the unauthorized access.
- Implement enhanced monitoring and alerting for Zoom meeting creation events to quickly detect and respond to any future instances of meetings being set up without passcodes.
- Coordinate with the communications team to prepare a response plan for any potential public relations issues arising from the incident, ensuring clear and consistent messaging."""


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

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

[[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/"

Stages and Predicates

Stage 1: query

event.type:creation and event.module:zoom and data_stream.dataset:zoom.webhook and
  event.action:meeting.created and not zoom.meeting.password:*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
zoom.meeting.passwordis_not_null(no value, null check)excludes:zoom.meeting.password

Back to all Elastic rules