Detection rules › Elastic

Elastic rules: 2z

AWS GuardDuty Detector Deletion

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

Detects the deletion of an Amazon GuardDuty detector. GuardDuty provides continuous monitoring for malicious or unauthorized activity across AWS accounts. Deleting the detector disables this visibility, stopping all threat detection and removing existing findings. Adversaries may delete GuardDuty detectors to impair security monitoring and evade detection during or after an intrusion. This rule identifies successful "DeleteDetector" API calls and can indicate a deliberate defense evasion attempt.

Known False Positives

  • The GuardDuty detector may be deleted by a system or network administrator. Verify whether the user identity, user agent, and/or hostname should be making changes in your environment. Detector deletions by unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2020/05/28"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
description = """
Detects the deletion of an Amazon GuardDuty detector. GuardDuty provides continuous monitoring for malicious or
unauthorized activity across AWS accounts. Deleting the detector disables this visibility, stopping all threat detection
and removing existing findings. Adversaries may delete GuardDuty detectors to impair security monitoring and evade
detection during or after an intrusion. This rule identifies successful "DeleteDetector" API calls and can indicate a
deliberate defense evasion attempt.
"""
false_positives = [
    """
    The GuardDuty detector may be deleted by a system or network administrator. Verify whether the user identity, user
    agent, and/or hostname should be making changes in your environment. Detector deletions by unfamiliar users or hosts
    should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS GuardDuty Detector Deletion"
note = """## Triage and analysis

### Investigating AWS GuardDuty Detector Deletion

Amazon GuardDuty is a continuous threat detection service that analyzes CloudTrail, DNS, and VPC Flow Logs to identify malicious activity and compromised resources. Deleting a GuardDuty detector stops this monitoring entirely and permanently removes all historical findings for the affected AWS account. This rule detects successful `DeleteDetector` API calls, which may represent an attacker attempting to impair defenses and evade detection. Such actions should be rare and always performed under controlled administrative change processes.

#### Possible investigation steps

- **Identify the actor**
  - Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.type` to determine who initiated the deletion.
  - Verify whether this principal normally performs GuardDuty configuration or administrative tasks.

- **Review request context**
  - Check `aws.cloudtrail.request_parameters` and `cloud.region` to confirm the targeted GuardDuty detector and scope of impact.
  - Determine whether multiple detectors or member accounts were affected (especially in delegated admin organizations).

- **Analyze source and access patterns**
  - Review `source.ip`, `user_agent.original` and `source.geo` fields for anomalous or previously unseen access locations or automation clients.
  - Check whether the deletion occurred outside standard maintenance windows or during a concurrent suspicious activity window.

- **Correlate with preceding or related activity**
  - Search for earlier GuardDuty configuration changes:
    - `StopMonitoringMembers`, `DisassociateMembers`, or `DeleteMembers`
    - IAM role or policy modifications reducing GuardDuty privileges
  - Look for other defense evasion indicators such as CloudTrail suspension, Security Hub configuration changes, or disabling of AWS Config rules.

- **Review historical GuardDuty findings**
  - Examine prior GuardDuty alerts and findings (if still retrievable) to determine whether the deletion followed significant detection activity.
  - Use centralized logs or security data lakes to recover findings removed from the console.

### False positive analysis

- **Authorized administrative actions**
  - Verify whether the deletion corresponds to legitimate account decommissioning, region cleanup, or migration activity.
- **Automation or IaC**
  - GuardDuty may be disabled temporarily during infrastructure provisioning or teardown in automated environments. 
    Confirm via CI/CD logs or Infrastructure-as-Code templates.
- **Organizational configuration changes**
  - Large organizations might consolidate GuardDuty under a delegated administrator account, causing detectors to be deleted in member accounts. 
    Validate these actions against security architecture changes.

### Response and remediation

- **Containment and restoration**
  - If unauthorized, immediately re-enable GuardDuty in the affected account and region using the `CreateDetector` API or AWS console.
  - Verify that findings aggregation and member account associations are restored to expected configurations.

- **Investigation**
  - Review CloudTrail for related privilege escalation or resource tampering events around the deletion time.
  - Assess whether any attacker activity occurred during the monitoring gap between deletion and restoration.

- **Recovery and hardening**
  - Restrict `guardduty:DeleteDetector` permissions to a limited administrative role.
  - Implement AWS Config rules or Security Hub controls to alert on changes to GuardDuty detectors or configuration states.
  - Enforce least privilege IAM policies, ensuring operational automation cannot disable GuardDuty outside maintenance workflows.
  - Document approved GuardDuty maintenance activities and correlate them with change tickets for traceability.

### Additional information
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)** 
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)** 
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
"""
references = [
    "https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DeleteDetector.html",
]
risk_score = 73
rule_id = "523116c0-d89d-4d7c-82c2-39e6845a78ef"
severity = "high"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS GuardDuty",
    "Tactic: Defense Evasion",
    "Rule Type: Custom Query (KQL)",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: aws.cloudtrail 
  and event.provider: guardduty.amazonaws.com 
  and event.action: DeleteDetector 
  and event.outcome: success
  and not user_agent.original: (*Terraform* or *Pulumi*)
'''


[[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.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.request_parameters",
]

Stages and Predicates

Stage 1: query

data_stream.dataset: aws.cloudtrail 
  and event.provider: guardduty.amazonaws.com 
  and event.action: DeleteDetector 
  and event.outcome: success
  and not user_agent.original: (*Terraform* or *Pulumi*)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

AWS IAM Login Profile Created or Modified for an IAM User

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

Identifies creation or modification of a console login profile for an AWS IAM user via CreateLoginProfile or UpdateLoginProfile. A login profile enables password-based console sign-in for an IAM user. Adversaries who obtain programmatic credentials may create a login profile to add persistent interactive console access, or update an existing profile to reset another user's password and take over the account, even after the original access keys are rotated. Because console access for IAM users is increasingly provisioned through federation or IAM Identity Center, direct use of these APIs by an unexpected principal warrants review. This rule targets IAM users (the userName parameter is present); creation of a login profile for the account root user is covered by a separate rule.

Known False Positives

  • Administrators and identity teams may legitimately create or reset console login profiles during user onboarding, password resets, or break-glass procedures. Verify the principal in "aws.cloudtrail.user_identity.arn", the target user in "aws.cloudtrail.request_parameters", and whether the change aligns with an approved request. Known administration roles and provisioning automation can be excluded after validation.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/18"
integration = ["aws"]
maturity = "production"
updated_date = "2026/06/18"

[rule]
author = ["Elastic"]
description = """
Identifies creation or modification of a console login profile for an AWS IAM user via CreateLoginProfile or
UpdateLoginProfile. A login profile enables password-based console sign-in for an IAM user. Adversaries who obtain
programmatic credentials may create a login profile to add persistent interactive console access, or update an existing
profile to reset another user's password and take over the account, even after the original access keys are rotated.
Because console access for IAM users is increasingly provisioned through federation or IAM Identity Center, direct use
of these APIs by an unexpected principal warrants review. This rule targets IAM users (the userName parameter is
present); creation of a login profile for the account root user is covered by a separate rule.
"""
false_positives = [
    """
    Administrators and identity teams may legitimately create or reset console login profiles during user onboarding,
    password resets, or break-glass procedures. Verify the principal in "aws.cloudtrail.user_identity.arn", the target
    user in "aws.cloudtrail.request_parameters", and whether the change aligns with an approved request. Known
    administration roles and provisioning automation can be excluded after validation.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Login Profile Created or Modified for an IAM User"
note = """## Triage and analysis

### Investigating AWS IAM Login Profile Created or Modified for an IAM User

A login profile enables password-based AWS console access for an IAM user. "CreateLoginProfile" adds a console password to a user that did not have one, and "UpdateLoginProfile" changes the password of an existing profile. An adversary operating with stolen programmatic credentials can use "CreateLoginProfile" to establish persistent interactive access, or "UpdateLoginProfile" to reset a privileged user's password and hijack the account, retaining access even if the compromised access keys are later disabled.

Because IAM-user console access is commonly provisioned through federation or IAM Identity Center rather than these APIs directly, unexpected use is a meaningful signal. Note that a user changing their own password uses ChangePassword, not UpdateLoginProfile, so UpdateLoginProfile typically reflects an administrative (or adversarial) reset of another user.

### Possible investigation steps

- Identify the actor in "aws.cloudtrail.user_identity.arn", "aws.cloudtrail.user_identity.type", and "aws.cloudtrail.user_identity.session_context.session_issuer.arn", and review "source.ip", "source.as.organization.name", and "user_agent.original" to determine whether the action came from an expected network path or automation platform.
- Identify the target user in "aws.cloudtrail.request_parameters" and determine whether that user normally has console access and how privileged it is.
- Check "aws.cloudtrail.request_parameters" for "passwordResetRequired"; a value of false (or omitted) may indicate the actor set a password they intend to reuse.
- Correlate with surrounding activity by the same principal, such as CreateAccessKey, AttachUserPolicy, PutUserPolicy, virtual MFA registration, or a subsequent ConsoleLogin for the target user, which may indicate persistence or account takeover.

### False positive analysis

- Onboarding, password resets, and break-glass procedures legitimately use these APIs. Confirm the change is expected and exclude known administration roles or provisioning automation on "aws.cloudtrail.user_identity.arn" after validation.

### Response and remediation

- If the change is unauthorized, delete the login profile or reset the affected user's password, and revoke active console sessions for that user.
- Rotate or restrict credentials for the acting principal if compromise is suspected, and review any IAM permission changes or access keys created by the same session.
- Restrict "iam:CreateLoginProfile" and "iam:UpdateLoginProfile" to a small set of trusted administrators, and prefer federation or IAM Identity Center for console access.
"""
references = [
    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html",
    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateLoginProfile.html",
]
risk_score = 47
rule_id = "f4dc90eb-e77e-4f0e-b18b-eb50da9e827e"
setup = """This rule requires AWS CloudTrail logs ingested via the Elastic AWS integration. See https://docs.elastic.co/integrations/aws/cloudtrail for setup details."""
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Identity",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS IAM",
    "Use Case: Identity and Access Audit",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "iam.amazonaws.com"
    and event.action: ("CreateLoginProfile" or "UpdateLoginProfile")
    and event.outcome: "success"
    and not aws.cloudtrail.user_identity.type: "AWSService"
    and not user_agent.original: (*terraform* or *pulumi* or *ansible*)
    and not aws.cloudtrail.user_identity.arn: (*terraform* or *pulumi* or *ansible*)
    and not source.as.organization.name: (Amazon* or AMAZON* or Google*)
    and not source.address: ("cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
'''


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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "iam.amazonaws.com"
    and event.action: ("CreateLoginProfile" or "UpdateLoginProfile")
    and event.outcome: "success"
    and not aws.cloudtrail.user_identity.type: "AWSService"
    and not user_agent.original: (*terraform* or *pulumi* or *ansible*)
    and not aws.cloudtrail.user_identity.arn: (*terraform* or *pulumi* or *ansible*)
    and not source.as.organization.name: (Amazon* or AMAZON* or Google*)
    and not source.address: ("cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • CreateLoginProfile
  • UpdateLoginProfile
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • iam.amazonaws.com corpus 24 (elastic 24)
field:"Provider_Name" kind:eq value:"iam.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
aws.cloudtrail.user_identity.arnmatchansibleexcludes:aws.cloudtrail.user_identity.arn field:"aws.cloudtrail.user_identity.arn" value:"ansible"
aws.cloudtrail.user_identity.arnmatchpulumiexcludes:aws.cloudtrail.user_identity.arn field:"aws.cloudtrail.user_identity.arn" value:"pulumi"
aws.cloudtrail.user_identity.arnmatchterraformexcludes:aws.cloudtrail.user_identity.arn field:"aws.cloudtrail.user_identity.arn" value:"terraform"
source.as.organization.namestarts_withAMAZONexcludes:source.as.organization.name field:"source.as.organization.name" value:"AMAZON"
source.as.organization.namestarts_withAmazonexcludes:source.as.organization.name field:"source.as.organization.name" value:"Amazon"
source.as.organization.namestarts_withGoogleexcludes:source.as.organization.name field:"source.as.organization.name" value:"Google"
user_agent.originalmatchansibleexcludes:user_agent.original field:"user_agent.original" value:"ansible"
user_agent.originalmatchpulumiexcludes:user_agent.original field:"user_agent.original" value:"pulumi"
user_agent.originalmatchterraformexcludes:user_agent.original field:"user_agent.original" value:"terraform"
aws.cloudtrail.user_identity.typeeqAWSServiceexcludes:aws.cloudtrail.user_identity.type field:"aws.cloudtrail.user_identity.type" value:"AWSService"
source.addressincloudformation.amazonaws.com, servicecatalog.amazonaws.comexcludes:source.address field:"source.address" value:"cloudformation.amazonaws.com" field:"source.address" value:"servicecatalog.amazonaws.com"

Azure Event Hub Deleted

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

Identifies an Event Hub deletion in Azure. An Event Hub is an event processing service that ingests and processes large volumes of events and data. An adversary may delete an Event Hub in an attempt to evade detection.

Known False Positives

  • Event Hub deletions may be done by a system or network administrator. Verify whether the username, hostname, and/or resource name should be making changes in your environment. Event Hub deletions by unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies an Event Hub deletion in Azure. An Event Hub is an event processing service that ingests and processes large
volumes of events and data. An adversary may delete an Event Hub in an attempt to evade detection.
"""
false_positives = [
    """
    Event Hub deletions may be done by a system or network administrator. Verify whether the username, hostname, and/or
    resource name should be making changes in your environment. Event Hub deletions by unfamiliar users or hosts should
    be investigated. If known behavior is causing false positives, it can be exempted from the rule.
    """,
]
from = "now-9m"
index = ["logs-azure.activitylogs-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure Event Hub Deleted"
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 Event Hub Deleted

Azure Event Hub is a scalable data streaming platform and event ingestion service, crucial for processing large volumes of data in real-time. Adversaries may target Event Hubs to delete them, aiming to disrupt data flow and evade detection by erasing evidence of their activities. The detection rule monitors Azure activity logs for successful deletion operations, flagging potential defense evasion attempts by identifying unauthorized or suspicious deletions.

### Possible investigation steps

- Review the Azure activity logs to confirm the deletion event by checking the operation name "MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/DELETE" and ensure the event outcome is marked as Success.
- Identify the user or service principal responsible for the deletion by examining the associated user identity or service principal ID in the activity logs.
- Investigate the context of the deletion by reviewing recent activities performed by the identified user or service principal to determine if there are any other suspicious actions.
- Check for any recent changes in permissions or roles assigned to the user or service principal to assess if the deletion was authorized or if there was a potential privilege escalation.
- Correlate the deletion event with other security alerts or incidents in the environment to identify if this action is part of a larger attack pattern or campaign.
- Communicate with relevant stakeholders or teams to verify if the deletion was part of a planned operation or maintenance activity.

### False positive analysis

- Routine maintenance or updates by authorized personnel can trigger deletion logs. Verify if the deletion aligns with scheduled maintenance activities and exclude these operations from alerts.
- Automated scripts or tools used for managing Azure resources might delete Event Hubs as part of their normal operation. Identify these scripts and whitelist their activity to prevent false positives.
- Test environments often involve frequent creation and deletion of resources, including Event Hubs. Exclude known test environments from monitoring to reduce noise.
- Changes in organizational policies or restructuring might lead to legitimate deletions. Ensure that such policy-driven deletions are documented and excluded from alerts.
- Misconfigured automation or deployment processes can inadvertently delete Event Hubs. Regularly review and update configurations to ensure they align with intended operations and exclude these from alerts if verified as non-threatening.

### Response and remediation

- Immediately isolate the affected Azure Event Hub namespace to prevent further unauthorized deletions or modifications. This can be done by restricting access through Azure Role-Based Access Control (RBAC) and network security groups.
- Review and revoke any suspicious or unauthorized access permissions associated with the deleted Event Hub. Ensure that only authorized personnel have the necessary permissions to manage Event Hubs.
- Restore the deleted Event Hub from backups if available, or reconfigure it to resume normal operations. Verify the integrity and completeness of the restored data.
- Conduct a thorough audit of recent Azure activity logs to identify any other unauthorized actions or anomalies that may indicate further compromise.
- Escalate the incident to the security operations team for a detailed investigation into the root cause and to assess the potential impact on other Azure resources.
- Implement additional monitoring and alerting for Azure Event Hub operations to detect and respond to similar unauthorized activities promptly.
- Review and update security policies and access controls for Azure resources to prevent recurrence, ensuring adherence to the principle of least privilege.

## 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/event-hubs/event-hubs-about",
    "https://azure.microsoft.com/en-in/services/event-hubs/",
    "https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-features",
]
risk_score = 47
rule_id = "e0f36de1-0342-453d-95a9-a068b257b053"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Azure", "Use Case: Log Auditing", "Tactic: Defense Evasion", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/DELETE" and event.outcome:(Success or success)
'''


[[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.008"
name = "Disable or Modify Cloud Logs"
reference = "https://attack.mitre.org/techniques/T1562/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 = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/DELETE" and event.outcome:(Success or success)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
azure.activitylogs.operation_nameeq
  • MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/DELETE
field:"azure.activitylogs.operation_name" kind:eq value:"MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/DELETE"
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

Browser Native Messaging Registry Modification

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to install a new chromium browser native messaging application via registry change. Adversaries may install a rogue browser native messaging host to maintain persistence.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to install a new chromium browser native messaging application via registry change. Adversaries may
install a rogue browser native messaging host to maintain persistence.
"""
id = "f906c1f1-926e-4602-8287-1edc9667d2ad"
license = "Elastic License v2"
name = "Browser Native Messaging Registry Modification"
os_list = ["windows"]
reference = [
    "https://developer.chrome.com/docs/apps/nativeMessaging/",
    "https://www.trendmicro.com/en_us/research/23/b/earth-kitsune-delivers-new-whiskerspy-backdoor.html",
]
version = "1.0.21"

query = '''
registry where
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
   not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
   not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-19") and
   not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*", 
                             "?:\\Users\\*\\AppData\\Local\\*\\Free Download Manager\\fdm.exe") and
   registry.path : "HK*\\Software\\*\\NativeMessagingHosts\\*" and registry.data.strings : "*.json*" and
   not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and 
   not process.name : "winmixClickOnceHelper*.exe"
'''

min_endpoint_version = "8.1.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 = "T1176"
name = "Software Extensions"
reference = "https://attack.mitre.org/techniques/T1176/"
[[threat.technique.subtechnique]]
id = "T1176.001"
name = "Browser Extensions"
reference = "https://attack.mitre.org/techniques/T1176/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.1.0"

Stages and Predicates

Stage 1: registry

registry where
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
   not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
   not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-19") and
   not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*", 
                             "?:\\Users\\*\\AppData\\Local\\*\\Free Download Manager\\fdm.exe") and
   registry.path : "HK*\\Software\\*\\NativeMessagingHosts\\*" and registry.data.strings : "*.json*" and
   not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*") and 
   not process.name : "winmixClickOnceHelper*.exe"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Initramfs Extraction via CPIO

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

This rule detects the extraction of an initramfs image using the "cpio" command on Linux systems. The "cpio" command is used to create or extract cpio archives. Attackers may extract the initramfs image to modify the contents or add malicious files, which can be leveraged to maintain persistence on the system.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the extraction of an initramfs image using the "cpio" command on Linux systems. The "cpio" command is
used to create or extract cpio archives. Attackers may extract the initramfs image to modify the contents or add
malicious files, which can be leveraged to maintain persistence on the system.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "auditbeat-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Initramfs Extraction via CPIO"
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 Initramfs Extraction via CPIO

Initramfs is a temporary filesystem used during the Linux boot process, containing essential drivers and scripts. Attackers may exploit the `cpio` command to extract and modify initramfs, embedding malicious files to ensure persistence. The detection rule identifies suspicious `cpio` usage by monitoring process execution patterns, excluding legitimate parent processes, to flag potential threats.

### Possible investigation steps

- Review the process execution details to confirm the presence of the cpio command with arguments "-H" or "--format" and "newc" to ensure the alert is not a false positive.
- Investigate the parent process of the cpio command to determine if it is an unexpected or unauthorized process, as legitimate processes like mkinitramfs or dracut should be excluded.
- Check the execution path of the parent process to verify if it matches any known legitimate paths such as "/usr/share/initramfs-tools/*" or "/nix/store/*".
- Analyze the timeline of events around the cpio execution to identify any preceding or subsequent suspicious activities that might indicate a broader attack or persistence mechanism.
- Examine the system for any unauthorized modifications or additions to the initramfs image that could indicate tampering or the presence of malicious files.
- Correlate the alert with other security data sources like Elastic Endgame, Elastic Defend, or Crowdstrike to gather additional context and assess the scope of the potential threat.

### False positive analysis

- Legitimate system updates or maintenance activities may trigger the rule when tools like mkinitramfs or dracut are used. To handle this, ensure these processes are excluded by verifying that the parent process is mkinitramfs or dracut.
- Custom scripts or automation tools that manage initramfs might use cpio in a non-malicious context. Review these scripts and add their parent process names or paths to the exclusion list if they are verified as safe.
- Systems using non-standard initramfs management tools located in directories like /usr/share/initramfs-tools or /nix/store may cause false positives. Confirm these tools' legitimacy and update the exclusion paths accordingly.
- Development or testing environments where initramfs is frequently modified for legitimate reasons can generate alerts. Consider creating environment-specific exceptions to reduce noise while maintaining security in production systems.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or spread of potential malware.
- Terminate any suspicious processes related to the `cpio` command that do not have legitimate parent processes, such as `mkinitramfs` or `dracut`.
- Conduct a thorough review of the extracted initramfs contents to identify and remove any unauthorized or malicious files.
- Restore the initramfs from a known good backup to ensure system integrity and remove any potential persistence mechanisms.
- Monitor the system for any further suspicious activity, particularly related to the `cpio` command, to ensure the threat has been fully mitigated.
- Escalate the incident to the security operations team for further analysis and to determine if additional systems may be affected.
- Update security policies and procedures to include specific checks for unauthorized `cpio` usage and enhance detection capabilities for similar threats."""
risk_score = 21
rule_id = "17b3fcd1-90fb-4f5d-858c-dc1d998fa368"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Auditd Manager",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed") and
process.name == "cpio" and process.args in ("-H", "--format") and process.args == "newc" and
not (
  process.parent.name in ("mkinitramfs", "dracut") or
  ?process.parent.executable like~ ("/usr/share/initramfs-tools/*", "/nix/store/*") or
  ?process.parent.args in (
    "/bin/dracut", "/usr/share/initramfs-tools/hooks/amd64_microcode", "/usr/bin/dracut", "/usr/sbin/mkinitramfs",
    "/usr/sbin/dracut", "/usr/bin/update-microcode-initrd"
  ) or
  process.args like ("/var/tmp/mkinitramfs_*", "/tmp/tmp.*/mkinitramfs_*") or
  ?process.working_directory like (
    "/var/tmp/mkinitramfs-*", "/tmp/microcode-initrd_*", "/var/tmp/mkinitramfs-*", "/var/tmp/dracut.*",
    "/var/tmp/mkinitramfs_*", "/var/tmp/supermin*/init.d"
  )
)
'''

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

[[rule.threat.technique]]
id = "T1542"
name = "Pre-OS Boot"
reference = "https://attack.mitre.org/techniques/T1542/"

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed") and
process.name == "cpio" and process.args in ("-H", "--format") and process.args == "newc" and
not (
  process.parent.name in ("mkinitramfs", "dracut") or
  ?process.parent.executable like~ ("/usr/share/initramfs-tools/*", "/nix/store/*") or
  ?process.parent.args in (
    "/bin/dracut", "/usr/share/initramfs-tools/hooks/amd64_microcode", "/usr/bin/dracut", "/usr/sbin/mkinitramfs",
    "/usr/sbin/dracut", "/usr/bin/update-microcode-initrd"
  ) or
  process.args like ("/var/tmp/mkinitramfs_*", "/tmp/tmp.*/mkinitramfs_*") or
  ?process.working_directory like (
    "/var/tmp/mkinitramfs-*", "/tmp/microcode-initrd_*", "/var/tmp/mkinitramfs-*", "/var/tmp/dracut.*",
    "/var/tmp/mkinitramfs_*", "/var/tmp/supermin*/init.d"
  )
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard/var/tmp/mkinitramfs_*, /tmp/tmp.*/mkinitramfs_*excludes:process.args field:"process.args" value:"/var/tmp/mkinitramfs_*" field:"process.args" value:"/tmp/tmp.*/mkinitramfs_*"
process.parent.argsin/bin/dracut, /usr/bin/dracut, /usr/bin/update-microcode-initrd, /usr/sbin/dracut, /usr/sbin/mkinitramfs, /usr/share/initramfs-tools/hooks/amd64_microcodeexcludes:process.parent.args
process.parent.executablestarts_with/usr/share/initramfs-tools/, /nix/store/excludes:process.parent.executable field:"process.parent.executable" value:"/usr/share/initramfs-tools/" field:"process.parent.executable" value:"/nix/store/"
process.parent.nameindracut, mkinitramfsexcludes:process.parent.name field:"process.parent.name" value:"dracut" field:"process.parent.name" value:"mkinitramfs"
process.working_directorywildcard/var/tmp/mkinitramfs-*, /tmp/microcode-initrd_*, /var/tmp/mkinitramfs-*, /var/tmp/dracut.*, /var/tmp/mkinitramfs_*, /var/tmp/supermin*/init.dexcludes:process.working_directory

Kubernetes Pod Created With HostNetwork

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

This rules detects an attempt to create or modify a pod attached to the host network. HostNetwork allows a pod to use the node network namespace. Doing so gives the pod access to any service running on localhost of the host. An attacker could use this access to snoop on network activity of other pods on the same node or bypass restrictive network policies applied to its given namespace.

Known False Positives

  • An administrator or developer may want to use a pod that runs as root and shares the hosts IPC, Network, and PID namespaces for debugging purposes. If something is going wrong in the cluster and there is no easy way to SSH onto the host nodes directly, a privileged pod of this nature can be useful for viewing things like iptable rules and network namespaces from the host's perspective. Add exceptions for trusted container images using the query field "kubernetes.audit.requestObject.spec.container.image"

MITRE ATT&CK Coverage

TacticTechniques
Execution
Privilege Escalation

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2022/07/05"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rules detects an attempt to create or modify a pod attached to the host network. HostNetwork allows a pod to use
the node network namespace. Doing so gives the pod access to any service running on localhost of the host. An attacker
could use this access to snoop on network activity of other pods on the same node or bypass restrictive network policies
applied to its given namespace.
"""
false_positives = [
    """
    An administrator or developer may want to use a pod that runs as root and shares the hosts IPC, Network, and PID
    namespaces for debugging purposes. If something is going wrong in the cluster and there is no easy way to SSH onto
    the host nodes directly, a privileged pod of this nature can be useful for viewing things like iptable rules and
    network namespaces from the host's perspective. Add exceptions for trusted container images using the query field
    "kubernetes.audit.requestObject.spec.container.image"
    """,
]
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Pod Created With HostNetwork"
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 Kubernetes Pod Created With HostNetwork

Kubernetes allows pods to connect to the host's network namespace using HostNetwork, granting them direct access to the node's network interfaces. This capability can be exploited by attackers to monitor or intercept network traffic, potentially bypassing network policies. The detection rule identifies suspicious pod creation or modification events with HostNetwork enabled, excluding known benign images, to flag potential privilege escalation attempts.

### Possible investigation steps

- Review the Kubernetes audit logs to identify the source of the pod creation or modification event, focusing on the user or service account associated with the action.
- Examine the pod's configuration details, especially the containers' images, to determine if any unauthorized or suspicious images are being used, excluding known benign images like "docker.elastic.co/beats/elastic-agent:8.4.0".
- Investigate the network activity of the node where the pod is running to identify any unusual traffic patterns or potential data exfiltration attempts.
- Check the Kubernetes RBAC (Role-Based Access Control) settings to ensure that the user or service account has appropriate permissions and is not overly privileged.
- Assess the necessity of using HostNetwork for the pod in question and determine if it can be reconfigured to operate without this setting to reduce potential security risks.

### False positive analysis

- Pods used for monitoring or logging may require HostNetwork access to gather network data across nodes. Users can exclude these by adding their specific container images to the exception list in the detection rule.
- Certain system-level services or infrastructure components might need HostNetwork for legitimate reasons, such as network plugins or ingress controllers. Identify these services and update the rule to exclude their specific images or namespaces.
- Development or testing environments might frequently create pods with HostNetwork for debugging purposes. Consider creating a separate rule or environment-specific exceptions to avoid alert fatigue in these scenarios.
- Pods that are part of a known and trusted deployment process, which require HostNetwork for valid operational reasons, should be documented and excluded from the rule to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected pod by cordoning the node to prevent new pods from being scheduled and draining existing pods to other nodes, except the suspicious one.
- Terminate the suspicious pod to stop any potential malicious activity and prevent further network access.
- Review and revoke any unnecessary permissions or roles associated with the service account used by the pod to limit privilege escalation opportunities.
- Conduct a thorough audit of network policies to ensure they are correctly configured to prevent unauthorized access to the host network.
- Escalate the incident to the security operations team for further investigation and to determine if any data was accessed or exfiltrated.
- Implement additional monitoring and alerting for any future pod creations with HostNetwork enabled to quickly detect similar threats.
- Review and update Kubernetes RBAC policies to enforce the principle of least privilege, ensuring only trusted entities can create pods with HostNetwork enabled.

## Setup

The Kubernetes Fleet integration with Audit Logs enabled or similarly structured data is required to be compatible with this rule."""
references = [
    "https://research.nccgroup.com/2021/11/10/detection-engineering-for-kubernetes-clusters/#part3-kubernetes-detections",
    "https://kubernetes.io/docs/concepts/security/pod-security-policy/#host-namespaces",
    "https://bishopfox.com/blog/kubernetes-pod-privilege-escalation",
]
risk_score = 47
rule_id = "12cbf709-69e8-4055-94f9-24314385c27e"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:kubernetes.audit_logs and kubernetes.audit.annotations.authorization_k8s_io/decision:allow and
kubernetes.audit.objectRef.resource:pods and kubernetes.audit.verb:(create or patch or update) and
kubernetes.audit.requestObject.spec.hostNetwork:true and
not (
  kubernetes.audit.requestObject.spec.containers.image:(
    *eks/observability/aws-for-fluent-bit* or *eks/observability/cloudwatch-agent* or *elastic-agent* or *quay/tigera* or *tigera/operator* or
    docker.io/bitnami/node-exporter* or docker.io/rancher/mirrored-calico-operator* or quay.io/calico/node* or quay.io/cephcsi/cephcsi* or
    quay.io/frrouting/frr* or quay.io/metallb/speaker* or quay.io/prometheus/node-exporter* or rancher/system-agent* or
    registry.crowdstrike.com/falcon-sensor* or registry.k8s.io/sig-storage/csi-node-driver-registrar*
  ) or
  kubernetes.audit.objectRef.namespace:(
    calico or calico-system or cilium or elastic or ingress-nginx or kube-system or noname-security-posture or openebs or sysdig-agent
  )
)
'''

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

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

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:kubernetes.audit_logs and kubernetes.audit.annotations.authorization_k8s_io/decision:allow and
kubernetes.audit.objectRef.resource:pods and kubernetes.audit.verb:(create or patch or update) and
kubernetes.audit.requestObject.spec.hostNetwork:true and
not (
  kubernetes.audit.requestObject.spec.containers.image:(
    *eks/observability/aws-for-fluent-bit* or *eks/observability/cloudwatch-agent* or *elastic-agent* or *quay/tigera* or *tigera/operator* or
    docker.io/bitnami/node-exporter* or docker.io/rancher/mirrored-calico-operator* or quay.io/calico/node* or quay.io/cephcsi/cephcsi* or
    quay.io/frrouting/frr* or quay.io/metallb/speaker* or quay.io/prometheus/node-exporter* or rancher/system-agent* or
    registry.crowdstrike.com/falcon-sensor* or registry.k8s.io/sig-storage/csi-node-driver-registrar*
  ) or
  kubernetes.audit.objectRef.namespace:(
    calico or calico-system or cilium or elastic or ingress-nginx or kube-system or noname-security-posture or openebs or sysdig-agent
  )
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
kubernetes.audit.objectRef.namespaceincalico, calico-system, cilium, elastic, ingress-nginx, kube-system, noname-security-posture, openebs, sysdig-agentexcludes:kubernetes.audit.objectRef.namespace
kubernetes.audit.requestObject.spec.containers.imagematcheks/observability/aws-for-fluent-bitexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"eks/observability/aws-for-fluent-bit"
kubernetes.audit.requestObject.spec.containers.imagematcheks/observability/cloudwatch-agentexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"eks/observability/cloudwatch-agent"
kubernetes.audit.requestObject.spec.containers.imagematchelastic-agentexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"elastic-agent"
kubernetes.audit.requestObject.spec.containers.imagematchquay/tigeraexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay/tigera"
kubernetes.audit.requestObject.spec.containers.imagematchtigera/operatorexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"tigera/operator"
kubernetes.audit.requestObject.spec.containers.imagestarts_withdocker.io/bitnami/node-exporterexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"docker.io/bitnami/node-exporter"
kubernetes.audit.requestObject.spec.containers.imagestarts_withdocker.io/rancher/mirrored-calico-operatorexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"docker.io/rancher/mirrored-calico-operator"
kubernetes.audit.requestObject.spec.containers.imagestarts_withquay.io/calico/nodeexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay.io/calico/node"
kubernetes.audit.requestObject.spec.containers.imagestarts_withquay.io/cephcsi/cephcsiexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay.io/cephcsi/cephcsi"
kubernetes.audit.requestObject.spec.containers.imagestarts_withquay.io/frrouting/frrexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay.io/frrouting/frr"
kubernetes.audit.requestObject.spec.containers.imagestarts_withquay.io/metallb/speakerexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay.io/metallb/speaker"
kubernetes.audit.requestObject.spec.containers.imagestarts_withquay.io/prometheus/node-exporterexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"quay.io/prometheus/node-exporter"
kubernetes.audit.requestObject.spec.containers.imagestarts_withrancher/system-agentexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"rancher/system-agent"
kubernetes.audit.requestObject.spec.containers.imagestarts_withregistry.crowdstrike.com/falcon-sensorexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"registry.crowdstrike.com/falcon-sensor"
kubernetes.audit.requestObject.spec.containers.imagestarts_withregistry.k8s.io/sig-storage/csi-node-driver-registrarexcludes:kubernetes.audit.requestObject.spec.containers.image field:"kubernetes.audit.requestObject.spec.containers.image" value:"registry.k8s.io/sig-storage/csi-node-driver-registrar"

Kubernetes Pod Exec Potential Reverse Shell

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

Flags exec into a pod when the URL-decoded command payload resembles reverse-shell or bind-shell one-liners invocation patterns. Legitimate debug sessions sometimes use similar building blocks, but together these patterns align with post-exploitation interactive access and command-and-control.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/04/23"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/08/18"

[rule]
author = ["Elastic"]
description = """
Flags exec into a pod when the URL-decoded command payload resembles reverse-shell or bind-shell
one-liners invocation patterns. Legitimate debug sessions sometimes use similar building blocks, but together 
these patterns align with post-exploitation interactive access and command-and-control.
"""
from = "now-6m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Kubernetes Pod Exec Potential Reverse Shell"
note = """## Triage and analysis

### Investigating Kubernetes Pod Exec Potential Reverse Shell

The rule inspects Kubernetes audit exec requestURI values, URL-decodes them, parses the command query fragment, and 
matches high-signal shell and socket idioms often used to obtain a fallback shell from inside a container.

### Possible investigation steps

- Identify the actor (kubernetes.audit.user.username, groups, impersonation), source IP, and user agent
  (human kubectl vs automation).
- Resolve the target namespace, pod, and container from kubernetes.audit.objectRef.* and correlate with
  workload ownership and change tickets.
- Pull the raw and decoded URI from the alert document and replay the inferred command in a sandbox only if policy
  allows—otherwise rely on audit and platform logs.
- Hunt nearby events from the same identity: secret reads, pods/exec to other workloads, RoleBinding
  changes, or anonymous API use.

### False positive analysis

- Security training, CTF-style images, or vendor diagnostics may include bash redirection or /dev/tcp examples;
  baseline approved images and break-glass accounts.
- Some observability or mesh sidecars use socat or sockets in ways that could overlap; validate container image and
  command lineage.

### Response and remediation

- If malicious, terminate the exec session, isolate the workload or node, rotate credentials reachable from the
  pod, and revoke pods/exec for the abused principal unless strictly required.
"""
references = [
    "https://attack.mitre.org/techniques/T1609/",
    "https://attack.mitre.org/techniques/T1059/",
]
risk_score = 73
rule_id = "f1a2b3c4-d5e6-4789-a012-3456789abc01"
severity = "high"
tags = [
    "Data Source: Kubernetes",
    "Data Source: Kubernetes API Server Audit Logs",
    "Domain: Kubernetes",
    "Platform: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM logs-kubernetes.audit_logs-* metadata _id, _index, _version
| WHERE kubernetes.audit.objectRef.subresource == "exec"
  AND kubernetes.audit.requestURI LIKE "*command=*"
| EVAL Esql.decoded_uri = URL_DECODE(kubernetes.audit.requestURI)
| GROK Esql.decoded_uri "%{DATA}/exec\\?%{DATA:raw_commands}&(?:container|stdin|stdout|stderr)=%{GREEDYDATA}"
| EVAL command = REPLACE(raw_commands, "command=", "")
| EVAL command = REPLACE(command, "&", " ")
| EVAL Esql.executed_command = REPLACE(command, "\\+", " ")
| WHERE Esql.executed_command IS NOT NULL AND command RLIKE """.*(/dev/tcp/|/dev/udp/|zsh/net/tcp|zsh/net/udp|nc\s+-e|ncat\s+-e|netcat\s+-e|nc\s.*\s-c\s|mkfifo|socat\s.*exec|socat\s.*pty|bash\s+-i\s+>&|0>&1|>&\s*/dev/tcp|import\s+socket.*connect|import\s+pty.*spawn|socket\.socket.*connect|IO::Socket::INET|fsockopen|TCPSocket\.new|/inet/tcp/).*""" AND 
  // local service health check patterns
  NOT command RLIKE """.*/dev/tcp/(localhost|127\.0\.0\.1)/(8080|8443|9090|3000|5000|8888|80|443).*"""
| KEEP Esql.*, user.name, user_agent.original, event.*, source.ip, kubernetes.audit.*, _id, _version, _index, data_stream.namespace
'''

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

[[rule.threat.technique]]
id = "T1609"
name = "Container Administration Command"
reference = "https://attack.mitre.org/techniques/T1609/"

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

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

Stages and Predicates

Stage 1: from

FROM logs-kubernetes.audit_logs-* metadata _id, _index, _version

Stage 2: where

| WHERE kubernetes.audit.objectRef.subresource == "exec"
  AND kubernetes.audit.requestURI LIKE "*command=*"

Stage 3: eval

| EVAL Esql.decoded_uri = URL_DECODE(kubernetes.audit.requestURI)

Stage 4: grok

| GROK Esql.decoded_uri "%{DATA}/exec\\?%{DATA:raw_commands}&(?:container|stdin|stdout|stderr)=%{GREEDYDATA}"

Stage 5: eval

| EVAL command = REPLACE(raw_commands, "command=", "")

Stage 6: eval

| EVAL command = REPLACE(command, "&", " ")

Stage 7: eval

| EVAL Esql.executed_command = REPLACE(command, "\\+", " ")

Stage 8: where

| WHERE Esql.executed_command IS NOT NULL AND command RLIKE """.*(/dev/tcp/|/dev/udp/|zsh/net/tcp|zsh/net/udp|nc\s+-e|ncat\s+-e|netcat\s+-e|nc\s.*\s-c\s|mkfifo|socat\s.*exec|socat\s.*pty|bash\s+-i\s+>&|0>&1|>&\s*/dev/tcp|import\s+socket.*connect|import\s+pty.*spawn|socket\.socket.*connect|IO::Socket::INET|fsockopen|TCPSocket\.new|/inet/tcp/).*""" AND
  NOT command RLIKE """.*/dev/tcp/(localhost|127\.0\.0\.1)/(8080|8443|9090|3000|5000|8888|80|443).*"""

Stage 9: keep

| KEEP Esql.*, user.name, user_agent.original, event.*, source.ip, kubernetes.audit.*, _id, _version, _index, data_stream.namespace

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Esql.executed_commandis_not_null
  • (no value, null check)
field:"Esql.executed_command" kind:is_not_null
commandregex_match
  • .*(/dev/tcp/|/dev/udp/|zsh/net/tcp|zsh/net/udp|nc\s+-e|ncat\s+-e|netcat\s+-e|nc\s.*\s-c\s|mkfifo|socat\s.*exec|socat\s.*pty|bash\s+-i\s+>&|0>&1|>&\s*/dev/tcp|import\s+socket.*connect|import\s+pty.*spawn|socket.socket.*connect|IO::Socket::INET|fsockopen|TCPSocket.new|/inet/tcp/).*
field:"command" kind:regex_match value:".*(/dev/tcp/|/dev/udp/|zsh/net/tcp|zsh/net/udp|nc\s+-e|ncat\s+-e|netcat\s+-e|nc\s.*\s-c\s|mkfifo|socat\s.*exec|socat\s.*pty|bash\s+-i\s+>&|0>&1|>&\s*/dev/tcp|import\s+socket.*connect|import\s+pty.*spawn|socket.socket.*connect|IO::Socket::INET|fsockopen|TCPSocket.new|/inet/tcp/).*"
kubernetes.audit.objectRef.subresourceeq
  • exec corpus 5 (elastic 5)
field:"kubernetes.audit.objectRef.subresource" kind:eq value:"exec"
kubernetes.audit.requestURIwildcard
  • *command=* corpus 4 (elastic 4)
field:"kubernetes.audit.requestURI" kind:wildcard value:"*command=*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
commandregex_match.*/dev/tcp/(localhost|127.0.0.1)/(8080|8443|9090|3000|5000|8888|80|443).*excludes:command field:"command" value:".*/dev/tcp/(localhost|127.0.0.1)/(8080|8443|9090|3000|5000|8888|80|443).*"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*
user.nameKEEP user.name
user_agent.originalKEEP user_agent.original
event.*KEEP event.*
source.ipKEEP source.ip
kubernetes.audit.*KEEP kubernetes.audit.*
_idKEEP _id
_versionKEEP _version
_indexKEEP _index
data_stream.namespaceKEEP data_stream.namespace

Kubernetes Service Account Modified RBAC Objects

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

Detects write operations performed by Kubernetes service accounts against RBAC resources (Roles, ClusterRoles, RoleBindings, ClusterRoleBindings). Service accounts typically do not manage RBAC directly; this activity may indicate token abuse, misconfigured permissions, or unauthorized privilege escalation.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/02/04"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Detects write operations performed by Kubernetes service accounts against RBAC resources (Roles,
ClusterRoles, RoleBindings, ClusterRoleBindings). Service accounts typically do not manage RBAC
directly; this activity may indicate token abuse, misconfigured permissions, or unauthorized
privilege escalation.
"""
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Service Account Modified RBAC Objects"
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 Kubernetes Service Account Modified RBAC Objects

This rule detects Kubernetes service accounts performing allowed write actions on RBAC resources such as Roles and RoleBindings, which is atypical because service accounts rarely administer permissions. It matters because stolen or over-privileged service account tokens can silently alter authorization to gain or retain elevated access across the cluster. An attacker commonly uses a compromised workload’s token to create or patch a binding that grants cluster-admin privileges to their service account for persistent control.

### Possible investigation steps

- Retrieve the full audit event and diff the before/after RBAC object to identify newly granted subjects, verbs, resources, and cluster-admin or wildcard permissions.
- Trace the acting service account to its owning workload (Deployment/Pod) and node, then review recent image changes, restarts, exec sessions, and container logs around the event time for compromise indicators.
- Determine whether the change is attributable to an expected controller or GitOps/CI automation by correlating with change tickets, pipeline runs, and repository commits for RBAC manifests.
- Validate whether the service account token may be abused by checking for unusual API access patterns, source IPs/user agents, and cross-namespace activity compared to its baseline behavior.
- Contain if suspicious by reverting the RBAC change, rotating the service account token (and any mounted secrets), and tightening the service account’s Role/ClusterRole to least privilege.

### False positive analysis

- A platform automation running in-cluster (e.g., a controller or CI job using a service account) legitimately applies RBAC manifests during routine deployment, upgrades, or namespace onboarding, resulting in create/patch/update of Roles or RoleBindings.
- A Kubernetes operator or housekeeping workflow running under a service account intentionally adjusts RBAC as part of maintenance (e.g., rotating access, reconciling drift, or cleaning up obsolete bindings) and triggers allowed delete or update actions on RBAC resources.

### Response and remediation

- Immediately remove or quarantine the offending service account by deleting its RoleBindings/ClusterRoleBindings and restarting or scaling down the owning workload to stop further RBAC writes.
- Revert the unauthorized RBAC object changes by restoring the last known-good Roles/Bindings from GitOps/manifests (or `kubectl rollout undo` where applicable) and verify no new subjects gained wildcard or cluster-admin-equivalent access.
- Rotate credentials by recreating the service account or triggering token re-issuance, deleting any mounted legacy token secrets, and redeploying workloads to ensure old tokens cannot be reused.
- Hunt and eradicate persistence by searching for additional recently modified RBAC objects and newly created service accounts in the same namespaces, then remove unauthorized accounts/bindings and scan the implicated container images for backdoors.
- Escalate to incident response and cluster administrators immediately if any change grants `cluster-admin`, introduces `*` verbs/resources, or binds a service account to privileged ClusterRoles across namespaces.
- Harden going forward by enforcing least-privilege RBAC, enabling admission controls to restrict RBAC modifications to approved identities/namespaces, and using short-lived projected service account tokens with workload identity constraints.
"""
references = [
    "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "f2e21713-1eac-4908-a782-1b49c7e9d53b"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"kubernetes.audit_logs" and kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.user.username:(
  system\:serviceaccount\:* and not (
    "system:serviceaccount:kube-system:clusterrole-aggregation-controller" or
    "system:serviceaccount:kube-system:generic-garbage-collector"
  )
) and
kubernetes.audit.objectRef.resource:("clusterrolebindings" or "clusterroles" or "rolebindings" or "roles") and
kubernetes.audit.verb:("create" or "delete" or "patch" or "update")
'''

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

Stages and Predicates

Stage 1: query

data_stream.dataset:"kubernetes.audit_logs" and kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.user.username:(
  system\:serviceaccount\:* and not (
    "system:serviceaccount:kube-system:clusterrole-aggregation-controller" or
    "system:serviceaccount:kube-system:generic-garbage-collector"
  )
) and
kubernetes.audit.objectRef.resource:("clusterrolebindings" or "clusterroles" or "rolebindings" or "roles") and
kubernetes.audit.verb:("create" or "delete" or "patch" or "update")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • kubernetes.audit_logs corpus 24 (elastic 24)
field:"data_stream.dataset" kind:eq value:"kubernetes.audit_logs"
kubernetes.audit.annotations.authorization_k8s_io/decisioneq
  • allow corpus 21 (elastic 21)
field:"kubernetes.audit.annotations.authorization_k8s_io/decision" kind:eq value:"allow"
kubernetes.audit.objectRef.resourcein
  • clusterrolebindings corpus 3 (elastic 3)
  • clusterroles
  • rolebindings corpus 3 (elastic 3)
  • roles
field:"kubernetes.audit.objectRef.resource" kind:in
kubernetes.audit.user.usernamewildcard
  • system:serviceaccount:* corpus 2 (elastic 2)
field:"kubernetes.audit.user.username" kind:wildcard value:"system:serviceaccount:*"
kubernetes.audit.verbin
  • create corpus 10 (elastic 10)
  • delete corpus 5 (elastic 5)
  • patch corpus 13 (elastic 13)
  • update corpus 12 (elastic 12)
field:"kubernetes.audit.verb" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
kubernetes.audit.user.usernameinsystem:serviceaccount:kube-system:clusterrole-aggregation-controller, system:serviceaccount:kube-system:generic-garbage-collectorexcludes:kubernetes.audit.user.username field:"kubernetes.audit.user.username" value:"system:serviceaccount:kube-system:clusterrole-aggregation-controller" field:"kubernetes.audit.user.username" value:"system:serviceaccount:kube-system:generic-garbage-collector"

Malware - Detected - Elastic Endgame

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

Elastic Endgame detected Malware. Click the Elastic Endgame icon in the event.module column or the link in the rule.reference column for additional information.

Rule Body

[metadata]
creation_date = "2020/02/18"
maturity = "production"
promotion = true
updated_date = "2025/03/21"

[rule]
author = ["Elastic"]
description = """
Elastic Endgame detected Malware. Click the Elastic Endgame icon in the event.module column or the link in the
rule.reference column for additional information.
"""
from = "now-2m"
index = ["endgame-*"]
interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "Malware - Detected - Elastic Endgame"
risk_score = 99
rule_id = "0a97b20f-4144-49ea-be32-b540ecc445de"
setup = """## Setup

### 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 = "critical"
tags = ["Data Source: Elastic Endgame", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.kind:alert and event.module:endgame and endgame.metadata.type:detection and (event.action:file_classification_event or endgame.event_subtype_full:file_classification_event)
'''
note = """## Triage and analysis

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

### Investigating Malware - Detected - Elastic Endgame

Elastic Endgame is a security solution that provides endpoint protection by monitoring and analyzing system activities to detect malicious behavior. Adversaries may exploit this technology by attempting to bypass its detection capabilities or by executing malware that mimics legitimate processes. The detection rule identifies suspicious file classification events, flagging potential malware activities with a high-risk score, thus enabling swift investigation and response.

### Possible investigation steps

- Review the alert details in the Elastic Endgame console by clicking the Elastic Endgame icon in the event.module column or the link in the rule.reference column to gather more context about the detected malware.
- Examine the specific file classification event by checking the event.action or endgame.event_subtype_full fields to understand the nature of the suspicious file activity.
- Analyze the endpoint's recent activity logs to identify any unusual behavior or patterns that coincide with the time of the alert.
- Investigate the source and destination of the file involved in the alert to determine if it is part of a known legitimate process or if it has been flagged in previous incidents.
- Check for any additional alerts or related events from the same endpoint or user to assess if this is part of a broader attack or isolated incident.
- Consult threat intelligence sources to see if the file or behavior matches known malware signatures or tactics, techniques, and procedures (TTPs).

### False positive analysis

- Legitimate software updates or installations may trigger file classification events. Users can create exceptions for known update processes to prevent these from being flagged as malware.
- System maintenance tasks, such as disk cleanup or defragmentation, might mimic suspicious file activities. Exclude these routine tasks by identifying their specific processes and adding them to the exception list.
- Security tools or antivirus software performing scans can generate alerts. Identify these tools and configure the rule to ignore their activities to reduce false positives.
- Custom scripts or automation tools used within the organization may be misclassified. Review these scripts and whitelist them if they are verified as safe and necessary for business operations.
- Frequent alerts from specific directories known to store temporary or cache files can be excluded by specifying these directories in the rule settings.

### Response and remediation

- Isolate the affected endpoint immediately to prevent further spread of the detected malware across the network.
- Terminate any suspicious processes identified by Elastic Endgame that are associated with the file classification event.
- Quarantine the suspicious files flagged by the detection rule to prevent execution and further analysis.
- Conduct a thorough scan of the isolated endpoint using updated antivirus and anti-malware tools to identify and remove any additional threats.
- Restore the affected system from a known good backup if malware removal is not feasible or if system integrity is compromised.
- Review and update endpoint protection policies to ensure they are configured to detect similar threats in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""

Stages and Predicates

Stage 1: query

event.kind:alert and event.module:endgame and endgame.metadata.type:detection and (event.action:file_classification_event or endgame.event_subtype_full:file_classification_event)

Indicators

These rows show field, operator, and value matches.

Memory Protection from Read to Execute

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to modify the memory protection from read only to read and execute, malware may use this approach to avoid leaving suspicious allocation properties.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to modify the memory protection from read only to read and execute, malware may use this approach to
avoid leaving suspicious allocation properties.
"""
id = "647e485d-4850-43da-9407-7618c9b23843"
license = "Elastic License v2"
name = "Memory Protection from Read to Execute"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.5"

query = '''
api where process.Ext.api.name == "VirtualProtect" and
  process.Ext.api.parameters.protection == "R-X" and process.Ext.api.parameters.protection_old == "R--" and
  process.thread.Ext.call_stack_final_user_module.protection_provenance != "Kernel" and
  process.Ext.api.metadata.target_address_name != "Unknown" and process.Ext.api.parameters.size != 64 and
  process.thread.Ext.call_stack_final_user_module.name != "Unknown" and
  process.thread.Ext.call_stack_summary != null and process.thread.Ext.call_stack_final_user_module.name != null and
  process.thread.Ext.call_stack_final_user_module.protection_provenance != "Unknown" and
  not (process.thread.Ext.call_stack_summary == "ntdll.dll|Unbacked" and process.thread.Ext.call_stack_final_user_module.name == "Unbacked") and 
  not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and process.thread.Ext.call_stack_final_user_module.protection_provenance == "Unbacked") and 
  not (process.thread.Ext.call_stack_final_user_module.name == "Undetermined" and process.Ext.api.behaviors == "truncated_stack") and 
  not (process.Ext.api.parameters.size == 4096 and
       process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deleteme*") and
  not (process.thread.Ext.call_stack_final_user_module.path in ("c:\\program files\\bold\\agent\\bold.exe", "c:\\program files\\bold\\agent\\boldengine.exe") and user.id == "S-1-5-18") and 
  not process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\syswow64\\cyinjct.dll" and
  process.Ext.api.summary in ("VirtualProtect( cryptsp.dll, 0x108, R-X, R-- )", "VirtualProtect( crypt32.dll, 0x108, R-X, R-- )") and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                        ("6722b52ed34bbf1c1cbb2215130b725b66fd9bb2abc7ac7b9281ba9643b17498",
                                         "87628b8c8fba57a55383999de84a4f1a4ae6e37d735bb785bc29abba4d9ba701",
                                         "be636d9eb262f8db59bf793c35ba0b7fe25091f5351ca25f9fe5a90493b151a1",
                                         "bb6c1bae7516b2d61e7cbf94c10ec9287fcaab34550dec268d99cd605c24f0d3",
                                         "edd811ce347d68ebde7565a618cf93494f8b57e94d875c1717046a55c6865e1c", 
                                         "2ab9a610db6fba4d41c6b9e971588fec0fbb47e19f1590bc04696cb2a80fc447", 
                                         "0db3072535e19bb206277c726497f0dae6066b620a39c4502d8c0060032feaa6", 
                                         "8d328590dc4cadfb45e04fc1476e0989e98fffd6b97dc47f91b6a105a53dd221", 
                                         "466970a44c0998f43b350d850615ec01bb9ad0ad1d0991883f69c31d61563f8c",
                                         "1e8b5406e30074784409cf2d8d65dca376d7c51cea2458a99a635b087a8f96a5") and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
  not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
                                     ("c:\\program files (x86)\\common files\\microsoft shared\\office??\\mso*.dll",
                                      "c:\\windows\\assembly\\nativeimages*.ni.dll",
                                      "c:\\windows\\system32\\spool\\drivers\\x64\\3\\ricoh_drv\\*.dll") and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info like ("c:\\windows\\sys?????\\cyinjct.dll*", 
                                            "c:\\windows\\sys?????\\user32.dll!DispatchMessage*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrResolveDelayLoadedAPI*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrShutdownThread*")) and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.callsite_trailing_bytes == "85c00f85fc000000448b4df0488d45f04c8d45e84889442420488d55e04883c9ff41ffd685c00f85d8000000813e504500000f85cc0000008b462885c00f84c1")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


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

[internal]
min_endpoint_version = "8.14.2"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "VirtualProtect" and
  process.Ext.api.parameters.protection == "R-X" and process.Ext.api.parameters.protection_old == "R--" and
  process.thread.Ext.call_stack_final_user_module.protection_provenance != "Kernel" and
  process.Ext.api.metadata.target_address_name != "Unknown" and process.Ext.api.parameters.size != 64 and
  process.thread.Ext.call_stack_final_user_module.name != "Unknown" and
  process.thread.Ext.call_stack_summary != null and process.thread.Ext.call_stack_final_user_module.name != null and
  process.thread.Ext.call_stack_final_user_module.protection_provenance != "Unknown" and
  not (process.thread.Ext.call_stack_summary == "ntdll.dll|Unbacked" and process.thread.Ext.call_stack_final_user_module.name == "Unbacked") and 
  not (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and process.thread.Ext.call_stack_final_user_module.protection_provenance == "Unbacked") and 
  not (process.thread.Ext.call_stack_final_user_module.name == "Undetermined" and process.Ext.api.behaviors == "truncated_stack") and 
  not (process.Ext.api.parameters.size == 4096 and
       process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\winsxs\\temp\\pendingdeletes\\$$deleteme*") and
  not (process.thread.Ext.call_stack_final_user_module.path in ("c:\\program files\\bold\\agent\\bold.exe", "c:\\program files\\bold\\agent\\boldengine.exe") and user.id == "S-1-5-18") and 
  not process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\syswow64\\cyinjct.dll" and
  process.Ext.api.summary in ("VirtualProtect( cryptsp.dll, 0x108, R-X, R-- )", "VirtualProtect( crypt32.dll, 0x108, R-X, R-- )") and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                        ("6722b52ed34bbf1c1cbb2215130b725b66fd9bb2abc7ac7b9281ba9643b17498",
                                         "87628b8c8fba57a55383999de84a4f1a4ae6e37d735bb785bc29abba4d9ba701",
                                         "be636d9eb262f8db59bf793c35ba0b7fe25091f5351ca25f9fe5a90493b151a1",
                                         "bb6c1bae7516b2d61e7cbf94c10ec9287fcaab34550dec268d99cd605c24f0d3",
                                         "edd811ce347d68ebde7565a618cf93494f8b57e94d875c1717046a55c6865e1c", 
                                         "2ab9a610db6fba4d41c6b9e971588fec0fbb47e19f1590bc04696cb2a80fc447", 
                                         "0db3072535e19bb206277c726497f0dae6066b620a39c4502d8c0060032feaa6", 
                                         "8d328590dc4cadfb45e04fc1476e0989e98fffd6b97dc47f91b6a105a53dd221", 
                                         "466970a44c0998f43b350d850615ec01bb9ad0ad1d0991883f69c31d61563f8c",
                                         "1e8b5406e30074784409cf2d8d65dca376d7c51cea2458a99a635b087a8f96a5") and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
  not process.thread.Ext.call_stack_final_user_module.protection_provenance_path like
                                     ("c:\\program files (x86)\\common files\\microsoft shared\\office??\\mso*.dll",
                                      "c:\\windows\\assembly\\nativeimages*.ni.dll",
                                      "c:\\windows\\system32\\spool\\drivers\\x64\\3\\ricoh_drv\\*.dll") and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info like ("c:\\windows\\sys?????\\cyinjct.dll*", 
                                            "c:\\windows\\sys?????\\user32.dll!DispatchMessage*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrResolveDelayLoadedAPI*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrLoadDll*",
                                            "c:\\windows\\sys?????\\ntdll.dll!LdrShutdownThread*")) and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.callsite_trailing_bytes == "85c00f85fc000000448b4df0488d45f04c8d45e84889442420488d55e04883c9ff41ffd685c00f85d8000000813e504500000f85cc0000008b462885c00f84c1")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.metadata.target_address_namene
  • Unknown
field:"process.Ext.api.metadata.target_address_name" kind:ne value:"Unknown"
process.Ext.api.nameeq
  • VirtualProtect corpus 19 (elastic 19)
field:"process.Ext.api.name" kind:eq value:"VirtualProtect"
process.Ext.api.parameters.protectioneq
  • R-X corpus 3 (elastic 3)
field:"process.Ext.api.parameters.protection" kind:eq value:"R-X"
process.Ext.api.parameters.protection_oldeq
  • R--
field:"process.Ext.api.parameters.protection_old" kind:eq value:"R--"
process.Ext.api.parameters.sizene
  • 64 transforms: number
field:"process.Ext.api.parameters.size" kind:ne value:"64"
process.Ext.api.summaryin
  • VirtualProtect( crypt32.dll, 0x108, R-X, R-- )
  • VirtualProtect( cryptsp.dll, 0x108, R-X, R-- )
field:"process.Ext.api.summary" kind:in
process.thread.Ext.call_stack_final_user_module.hash.sha256in
  • 0db3072535e19bb206277c726497f0dae6066b620a39c4502d8c0060032feaa6
  • 1e8b5406e30074784409cf2d8d65dca376d7c51cea2458a99a635b087a8f96a5
  • 2ab9a610db6fba4d41c6b9e971588fec0fbb47e19f1590bc04696cb2a80fc447
  • 466970a44c0998f43b350d850615ec01bb9ad0ad1d0991883f69c31d61563f8c
  • 6722b52ed34bbf1c1cbb2215130b725b66fd9bb2abc7ac7b9281ba9643b17498
  • 87628b8c8fba57a55383999de84a4f1a4ae6e37d735bb785bc29abba4d9ba701
  • 8d328590dc4cadfb45e04fc1476e0989e98fffd6b97dc47f91b6a105a53dd221
  • bb6c1bae7516b2d61e7cbf94c10ec9287fcaab34550dec268d99cd605c24f0d3
  • be636d9eb262f8db59bf793c35ba0b7fe25091f5351ca25f9fe5a90493b151a1
  • edd811ce347d68ebde7565a618cf93494f8b57e94d875c1717046a55c6865e1c
field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:in
process.thread.Ext.call_stack_final_user_module.nameis_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:is_not_null
process.thread.Ext.call_stack_final_user_module.namene
  • Unknown
field:"process.thread.Ext.call_stack_final_user_module.name" kind:ne value:"Unknown"
process.thread.Ext.call_stack_final_user_module.protection_provenancene
  • Kernel corpus 3 (elastic 3)
  • Unknown
field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" kind:ne
process.thread.Ext.call_stack_summaryis_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_summary" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.api.behaviorseqtruncated_stackexcludes:process.Ext.api.behaviors field:"process.Ext.api.behaviors" value:"truncated_stack"
process.thread.Ext.call_stack_final_user_module.nameeqUndeterminedexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined"
process.Ext.api.parameters.sizeeq4096excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"4096"
process.thread.Ext.call_stack_final_user_module.pathstarts_withc:\windows\winsxs\temp\pendingdeletes\$$deletemeexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\winsxs\temp\pendingdeletes\$$deleteme"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
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_stack_final_user_module.nameeqUnbackedexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unbacked"
process.thread.Ext.call_stack_final_user_module.protection_provenanceeqUnbackedexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Unbacked"
process.thread.Ext.call_stack_summaryeqntdll.dll|Unbackedexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|Unbacked"
process.thread.Ext.call_stack_final_user_module.pathinc:\program files\bold\agent\bold.exe, c:\program files\bold\agent\boldengine.exeexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\bold\agent\bold.exe" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\bold\agent\boldengine.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\syswow64\cyinjct.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\syswow64\cyinjct.dll"
process.thread.Ext.call_stack_final_user_module.protection_provenance_pathwildcardc:\program files (x86)\common files\microsoft shared\office??\mso*.dll, c:\windows\assembly\nativeimages*.ni.dll, c:\windows\system32\spool\drivers\x64\3\ricoh_drv\*.dllexcludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\program files (x86)\common files\microsoft shared\office??\mso*.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\assembly\nativeimages*.ni.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\system32\spool\drivers\x64\3\ricoh_drv\*.dll"

Modification of WDigest Security Provider

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

Identifies attempts to modify the WDigest security provider in the registry to force the user's password to be stored in clear text in memory. Windows 8.1+ and Server 2012 R2+ disable WDigest plaintext credential caching by default, but setting UseLogonCredential to 1 re-enables it, causing LSASS to retain cleartext passwords for subsequent interactive logons. Adversaries abuse this to prepare for credential dumping from LSASS memory.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Defense Impairment
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/01/19"
integration = ["endpoint", "windows", "m365_defender"]
maturity = "production"
updated_date = "2026/04/29"

[rule]
author = ["Elastic"]
description = """
Identifies attempts to modify the WDigest security provider in the registry to force the user's password to be stored in
clear text in memory. Windows 8.1+ and Server 2012 R2+ disable WDigest plaintext credential caching by default, but
setting UseLogonCredential to 1 re-enables it, causing LSASS to retain cleartext passwords for subsequent interactive
logons. Adversaries abuse this to prepare for credential dumping from LSASS memory.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.registry-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
]
language = "eql"
license = "Elastic License v2"
name = "Modification of WDigest Security Provider"
references = [
    "https://www.csoonline.com/article/567747/how-to-detect-and-halt-credential-theft-via-windows-wdigest.html",
    "https://www.praetorian.com/blog/mitigating-mimikatz-wdigest-cleartext-credential-theft?edition=2019",
    "https://frsecure.com/compromised-credentials-response-playbook/",
    "https://www.elastic.co/security-labs/detect-credential-access",
]
risk_score = 73
rule_id = "d703a5af-d5b0-43bd-8ddb-7a5d500b7da5"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type in ("creation", "change") and
    registry.value : "UseLogonCredential" and
    registry.path : "*\\SYSTEM\\*ControlSet*\\Control\\SecurityProviders\\WDigest\\UseLogonCredential" and
    registry.data.strings : ("1", "0x00000001") and
    not (process.executable : "?:\\Windows\\System32\\svchost.exe" and user.id : "S-1-5-18")
'''

note = """## Triage and analysis

### Investigating Modification of WDigest Security Provider
#### Possible investigation steps

- Is the write to the active ControlSet, and does host context explain enablement?
  - Focus: `registry.path`, `registry.data.strings`, and `host.id`.
  - Implication: escalate when the active ControlSet is enabled, leaving cleartext credentials in LSASS for later logons; lower suspicion only for a recognized lab or legacy compatibility host with the exact expected pattern.

- Which process made the change, and does its identity fit?
  - Focus: `process.executable`, `process.command_line`, `process.code_signature.subject_name`, and `process.parent.command_line`. $investigate_0
  - Hint: pivot on `host.id` plus `process.entity_id`; if absent, bound to alert time and host.
  - Implication: escalate when the writer is unsigned, user-writable, renamed, script-launched, or has an unrelated parent; lower suspicion only when identity, parent, and registry outcome match one recognized validation activity. Trusted signer alone is not clearance.

- Does user and session context explain the change?
  - Focus: `user.id`, `user.domain`, `process.Ext.session_info.logon_type`, and `process.Ext.token.integrity_level_name`.
  - Implication: escalate when a normal user, unexpected admin, service account, remote session, or elevated token performs the write outside a recognized test path.

- Did the same process leave WDigest enabled or change adjacent security registry state?
  - Focus: registry events from the same `process.entity_id`: `registry.path`, `registry.value`, and `registry.data.strings`. $investigate_1
  - Hint: check for WDigest reversal and LSA or SecurityProviders changes before widening to the host.
  - Implication: escalate when WDigest stays enabled or the writer weakens LSA or security-provider settings; scope narrower when the write is isolated, promptly reversed, and no contradictory registry evidence remains.

- Does process activity after the write show credential-dumping preparation or execution?
  - Focus: child process events from `process.entity_id`: `process.executable` and `process.command_line`. $investigate_2
  - Implication: escalate when children show Mimikatz/sekurlsa, ProcDump or comsvcs.dll LSASS dumping, CrackMapExec, PowerShell remote execution, archives, or cleanup; absent follow-on evidence narrows extraction proof but does not clear enablement.

- Did any accounts authenticate while WDigest was enabled?
  - Focus: logon events after `@timestamp`: `event.code` 4624, `winlog.event_data.TargetUserName`, `winlog.event_data.AuthenticationPackageName`, `winlog.logon.type`, and `source.ip`. $investigate_3
  - Hint: expand until WDigest is disabled or the host is contained; for domain NTLM, search domain-controller 4776 records for the alert host as source workstation.
  - Implication: escalate credential exposure when successful WDigest or privileged logons occur after enablement. Missing authentication telemetry is unresolved, not benign.

- If local evidence is suspicious or unresolved, do related alerts change scope?
  - Focus: alerts for `user.id`, especially credential access, privilege escalation, or lateral movement. $investigate_4
  - Hint: compare host alerts for precursor access, LSASS-oriented follow-on, staging, or cleanup. $investigate_5
  - Implication: broaden when the same user or host shows adjacent post-compromise behavior; keep local when related alerts are quiet and local evidence fits one recognized workflow.

- Escalate when writer identity, session context, registry changes, unreverted WDigest exposure, follow-on activity, or related alerts indicate unauthorized credential-protection weakening; close only when those categories align with one confirmed activity and no contradictions remain; preserve and escalate when evidence is mixed or incomplete.

### False positive analysis

- Authorized security validation or legacy compatibility testing may enable WDigest. Confirm `process.executable`, `process.command_line`, `process.parent.command_line`, `user.id`, `host.id`, `registry.data.strings`, prompt reversion, and no contradictory registry or LSASS-oriented follow-on. If telemetry cannot prove the activity, leave unresolved.
- Build exceptions from the minimum confirmed workflow: `process.executable` or signer, `process.parent.command_line`, `user.id`, `host.id`, `registry.path`, and expected `registry.data.strings`. Avoid exceptions on `registry.path`, `process.name`, signer, or `host.id` alone.

### Response and remediation

- If confirmed benign, reverse any temporary containment, document the aligned workflow evidence, and create an exception only when the confirmed evidence pattern is expected to repeat and can be scoped narrowly.
- If suspicious but unconfirmed, preserve the alert, process tree, command lines, relevant registry events, related-alert results, and current WDigest state before containment. Apply reversible containment first, such as heightened monitoring or EDR network restrictions, and use host isolation only when follow-on dumping, unreverted exposure on a sensitive host, or broader compromise evidence justifies the operational impact.
- If confirmed malicious, preserve the writer `process.entity_id`, process tree, command lines, registry evidence, and current WDigest state; then isolate the host when the evidence supports it, restore WDigest to the disabled state, and eradicate only the scripts, binaries, registry changes, and persistence found during the investigation.
- After containment, review other registry changes by the same process and scope accounts that may have authenticated while WDigest was enabled through available authentication records; when those records are unavailable, treat credential exposure as unresolved and prioritize privileged, service, and lateral-movement-capable accounts for credential hygiene.
- Post-incident hardening: restrict who can modify WDigest and related LSA policy, validate baseline configuration through endpoint or policy management, retain registry and process telemetry for this host class, and document the confirmed workflow or malicious pattern for future analysts.
"""

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:

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "user.id",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "process.executable",
    "process.command_line",
    "process.entity_id",
    "process.parent.executable",
    "process.parent.command_line",
    "process.Ext.session_info.logon_type",
    "process.Ext.token.integrity_level_name",
    "registry.path",
    "registry.value",
    "registry.data.strings",
]

[transform]

[[transform.investigate]]
label = "Process events by WDigest writer"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Registry events by WDigest writer"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "registry", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[transform.investigate]]
label = "Logon events on the WDigest host"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"

[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 = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"

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

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type in ("creation", "change") and
    registry.value : "UseLogonCredential" and
    registry.path : "*\\SYSTEM\\*ControlSet*\\Control\\SecurityProviders\\WDigest\\UseLogonCredential" and
    registry.data.strings : ("1", "0x00000001") and
    not (process.executable : "?:\\Windows\\System32\\svchost.exe" and user.id : "S-1-5-18")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typein
  • change corpus 18 (elastic 18)
  • creation corpus 17 (elastic 17)
field:"event.type" kind:in
registry.data.stringswildcard
  • 0x00000001 corpus 61 (splunk 52, elastic 9)
  • 1 corpus 16 (elastic 14, splunk 2)
field:"Details" kind:wildcard
registry.pathwildcard
  • *\SYSTEM\*ControlSet*\Control\SecurityProviders\WDigest\UseLogonCredential
field:"TargetObject" kind:wildcard value:"*\SYSTEM\*ControlSet*\Control\SecurityProviders\WDigest\UseLogonCredential"
registry.valuewildcard
  • UseLogonCredential corpus 2 (elastic 1, splunk 1)
field:"registry_value_name" kind:wildcard value:"UseLogonCredential"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\svchost.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Network Connection by Cups or Foomatic-rip Child

#
Status
production
Severity
high
Time window
10s
Sequence by
host.id, process.entity_id, process.parent.entity_id
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 network connections initiated by a child processes of foomatic-rip. 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"]
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 network connections initiated by a
child processes of foomatic-rip. 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 = ["logs-endpoint.events.network*", "logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Network Connection by Cups or Foomatic-rip Child"
note = """## Triage and analysis

### Investigating Network Connection by Cups or Foomatic-rip Child

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
- Printer User (lp) Shell Execution - f86cd31c-5c7e-4481-99d7-6875a3e31309
- Suspicious Execution from Foomatic-rip or Cupsd Parent - 986361cd-3dac-47fe-afa1-5c5dd89f2fb4
- File Creation by Cups or Foomatic-rip Child - b9b14be7-b7f4-4367-9934-81f07d2f63c4

### 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 = "e80ee207-9505-49ab-8ca8-bc57d80e2cab"
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: Command and Control",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by host.id with maxspan=10s
  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
   process.parent.name == "foomatic-rip" and
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")] by process.entity_id
  [network where host.os.type == "linux" and event.type == "start" and
   event.action == "connection_attempted"] by process.parent.entity_id
'''

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

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

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

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

[[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 10s, correlated by host.id, process.entity_id, process.parent.entity_id.

Stage 1: process

[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
   process.parent.name == "foomatic-rip" and
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")] by process.entity_id

Stage 2: network

[network where host.os.type == "linux" and event.type == "start" and
   event.action == "connection_attempted"] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Network Library Load via LdrLoadDLL

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

Identifies the load of a networking library by calling directly the LdrLoadDLL windows API and from an unsigned module.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = "Identifies the load of a networking library by calling directly the LdrLoadDLL windows API and from an unsigned module."
id = "1d11bfcd-b3dd-41f6-b770-fb7cca437019"
license = "Elastic License v2"
name = "Network Library Load via LdrLoadDLL"
os_list = ["windows"]
version = "1.0.5"

query = '''
sequence by process.entity_id with maxspan=1m
 [library where not dll.code_signature.status == "trusted" and 
  not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and 
  not dll.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\*") and 
  not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
  not dll.hash.sha256 in ("4bbe61307e8baa6e782c271361a41905f8ef2f7cdf62fa8fb4f4844860f3dc3d",
                          "5bcea56e9f25b53dfbf71d41f157647263a71754fb5c3b8b607c34c4d66d2e26",
                          "14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5")] as event0
 [library where
   dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and 
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*LdrLoadDLL*") and
    stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|", event0.dll.name)) and
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                                                   $entry.symbol_info : ("*LoadLibrary*",
                                                                         "*LdrResolveDelayLoadedAPI*",
                                                                         "*hmpalert.dll!CVCCP*",
                                                                         "*LdrGetProcedureAddressEx*",
                                                                         "?:\\Program Files (x86)\\*.dll*",
                                                                         "?:\\Program Files\\*.dll*",
                                                                         "*KernelBase.dll!CreateProcess*")) and
   /* Managed Code, Cynet MemScanner, xSecuritas, Mcafee */
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes :
                         ("*8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b*",
                          "48898424e80300004883bc24e803000000750eff94247e030000898424f0030000eb30488d8c2430010000ff94248e03000048898424e80300004883bc24e803",
                          "8bd885db751eff55c88945f8eb168d8592fdffff50ff55d08bd885db7506ff55c88945f856ff55bc85db0f847601000080bd82fcffff0074508b45fc05a00000",
                          "488b55a8c6420c01833d8bbeb25f007406ff1593c7b25f8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b8d70ffffff48894a10488d65", 
                          "2048894538488b4d1048c1e103488b7d38488b7550f3a44c8b4d284d8b49484c8b45284d8b4040488b5528488b5220488b4d28488b8988000000ff95a0000000",
                          "83c4209d61c38b1890906683fb1875158b580485db740e8b5b0c81fb33003200750331dbc331db4bc30000000000000000000000000000000000000000000000")) and
   not process.code_signature.subject_name : ("ZOHO Corporation Private Limited", "Sophos Ltd", "Electronic Arts, Inc.", "Epic Games Inc.")]
  [network where event.action == "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.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")]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


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

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

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

Stage 1: library

[library where not dll.code_signature.status == "trusted" and 
  not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and 
  not dll.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\*") and 
  not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
  not dll.hash.sha256 in ("4bbe61307e8baa6e782c271361a41905f8ef2f7cdf62fa8fb4f4844860f3dc3d",
                          "5bcea56e9f25b53dfbf71d41f157647263a71754fb5c3b8b607c34c4d66d2e26",
                          "14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5")] as event0

Stage 2: library

[library where
   dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*LdrLoadDLL*") and
    stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|", event0.dll.name)) and
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                                                   $entry.symbol_info : ("*LoadLibrary*",
                                                                         "*LdrResolveDelayLoadedAPI*",
                                                                         "*hmpalert.dll!CVCCP*",
                                                                         "*LdrGetProcedureAddressEx*",
                                                                         "?:\\Program Files (x86)\\*.dll*",
                                                                         "?:\\Program Files\\*.dll*",
                                                                         "*KernelBase.dll!CreateProcess*")) and
   not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes :
                         ("*8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b*",
                          "48898424e80300004883bc24e803000000750eff94247e030000898424f0030000eb30488d8c2430010000ff94248e03000048898424e80300004883bc24e803",
                          "8bd885db751eff55c88945f8eb168d8592fdffff50ff55d08bd885db7506ff55c88945f856ff55bc85db0f847601000080bd82fcffff0074508b45fc05a00000",
                          "488b55a8c6420c01833d8bbeb25f007406ff1593c7b25f8945b4488bcce82c000000908b45b4488b55a8c6420c01488b55a8488b8d70ffffff48894a10488d65",
                          "2048894538488b4d1048c1e103488b7d38488b7550f3a44c8b4d284d8b49484c8b45284d8b4040488b5528488b5220488b4d28488b8988000000ff95a0000000",
                          "83c4209d61c38b1890906683fb1875158b580485db740e8b5b0c81fb33003200750331dbc331db4bc30000000000000000000000000000000000000000000000")) and
   not process.code_signature.subject_name : ("ZOHO Corporation Private Limited", "Sophos Ltd", "Electronic Arts, Inc.", "Epic Games Inc.")]

Stage 3: network

[network where event.action == "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.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")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
event.actioneq
  • connection_attempted corpus 72 (elastic 72)
field:"EventType" kind:eq value:"connection_attempted"
process.thread.Ext.call_stack_summarycontains
  • concat("ntdll.dll|", event0.dll.name) (expression)
field:"process.thread.Ext.call_stack_summary" kind:contains

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuseqtrustedexcludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted"
dll.hash.sha256in14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5, 4bbe61307e8baa6e782c271361a41905f8ef2f7cdf62fa8fb4f4844860f3dc3d, 5bcea56e9f25b53dfbf71d41f157647263a71754fb5c3b8b607c34c4d66d2e26excludes:dll.hash.sha256 field:"dll.hash.sha256" value:"14da1fbca85ff2b8ac19ab63f4b7019614865ce8d87bce68100c97174b786ff5" field:"dll.hash.sha256" value:"4bbe61307e8baa6e782c271361a41905f8ef2f7cdf62fa8fb4f4844860f3dc3d" field:"dll.hash.sha256" value:"5bcea56e9f25b53dfbf71d41f157647263a71754fb5c3b8b607c34c4d66d2e26"
dll.pathstarts_with?:\Program Files\, ?:\Program Files (x86)\, ?:\Windows\excludes:dll.path field:"dll.path" value:"?:\Program Files\" field:"dll.path" value:"?:\Program Files (x86)\" field:"dll.path" value:"?:\Windows\"
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\"
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.code_signature.subject_nameeqZOHO Corporation Private Limited, Sophos Ltd, Electronic Arts, Inc., Epic Games Inc.excludes:process.code_signature.subject_name
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

New ActiveSyncAllowedDeviceID Added via PowerShell

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

Identifies the use of the Exchange PowerShell cmdlet, Set-CASMailbox, to add a new ActiveSync allowed device. Adversaries may target user email to collect sensitive information.

Known False Positives

  • Legitimate exchange system administration activity.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/12/15"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the use of the Exchange PowerShell cmdlet, Set-CASMailbox, to add a new ActiveSync allowed device.
Adversaries may target user email to collect sensitive information.
"""
false_positives = ["Legitimate exchange system administration activity."]
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 = "New ActiveSyncAllowedDeviceID Added via PowerShell"
note = """## Triage and analysis

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

### Investigating New ActiveSyncAllowedDeviceID Added via PowerShell

ActiveSync is a protocol enabling mobile devices to synchronize with Exchange mailboxes, crucial for accessing emails on-the-go. Adversaries may exploit the Exchange PowerShell cmdlet, Set-CASMailbox, to add unauthorized devices, gaining persistent access to sensitive email data. The detection rule identifies suspicious PowerShell activity by monitoring for specific command patterns, helping to flag potential unauthorized device additions and mitigate risks associated with account manipulation.

### Possible investigation steps

- Review the alert details to identify the specific process name (e.g., powershell.exe, pwsh.exe, powershell_ise.exe) and the command line arguments used, focusing on the presence of "Set-CASMailbox" and "ActiveSyncAllowedDeviceIDs".
- Examine the user account associated with the process execution to determine if the account has a history of legitimate administrative actions or if it might be compromised.
- Check the device ID added to the ActiveSyncAllowedDeviceIDs list to verify if it is recognized and authorized for use within the organization.
- Investigate the source IP address and host from which the PowerShell command was executed to assess if it aligns with expected administrative activity or if it originates from an unusual or suspicious location.
- Review recent email access logs for the user account to identify any unusual patterns or access from unfamiliar devices that could indicate unauthorized access.
- Correlate this event with other security alerts or logs from data sources like Microsoft Defender XDR or Sysmon to identify any related suspicious activities or patterns.

### False positive analysis

- Legitimate administrative tasks may trigger the rule when IT staff use PowerShell to configure or update ActiveSync settings for users. To manage this, create exceptions for known administrative accounts or specific maintenance windows.
- Automated scripts for device management that include the Set-CASMailbox cmdlet can cause false positives. Review and whitelist these scripts if they are verified as part of routine operations.
- Third-party applications that integrate with Exchange and modify ActiveSync settings might be flagged. Identify and exclude these applications if they are trusted and necessary for business operations.
- Regular audits of device additions by authorized personnel can help distinguish between legitimate and suspicious activities, allowing for more accurate exception handling.
- Consider the context of the activity, such as the time of day and the user account involved, to refine detection rules and reduce false positives.

### Response and remediation

- Immediately isolate the affected user account by disabling it to prevent further unauthorized access to the mailbox.
- Revoke the ActiveSync device access by removing the unauthorized device ID from the user's mailbox settings using the Exchange PowerShell cmdlet.
- Conduct a thorough review of the affected user's mailbox and account activity logs to identify any unauthorized access or data exfiltration attempts.
- Reset the password for the compromised user account and enforce multi-factor authentication (MFA) to enhance security.
- Notify the security team and relevant stakeholders about the incident for further investigation and potential escalation.
- Implement additional monitoring on the affected account and similar accounts for any unusual activity or further attempts to add unauthorized devices.
- Review and update the organization's security policies and procedures related to mobile device access and PowerShell usage to prevent recurrence."""
references = [
    "https://www.volexity.com/blog/2020/12/14/dark-halo-leverages-solarwinds-compromise-to-breach-organizations/",
    "https://docs.microsoft.com/en-us/powershell/module/exchange/set-casmailbox?view=exchange-ps",
]
risk_score = 47
rule_id = "ce64d965-6cb0-466d-b74f-8d2c76f47f05"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Execution",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "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.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and process.args : "Set-CASMailbox*ActiveSyncAllowedDeviceIDs*"
'''

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.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.002"
name = "Additional Email Delegate Permissions"
reference = "https://attack.mitre.org/techniques/T1098/002/"

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

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

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

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

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

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

[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"

[[rule.threat.technique.subtechnique]]
id = "T1114.002"
name = "Remote Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/002/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and process.args : "Set-CASMailbox*ActiveSyncAllowedDeviceIDs*"

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
  • Set-CASMailbox*ActiveSyncAllowedDeviceIDs*
field:"process.args" kind:wildcard value:"Set-CASMailbox*ActiveSyncAllowedDeviceIDs*"
process.namewildcard
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • powershell_ise.exe corpus 53 (splunk 29, elastic 24)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
field:"process_basename" kind:wildcard

Node.js Pre or Post-Install Script Execution

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

This rule detects the execution of Node.js pre or post-install scripts. These scripts are executed by the Node.js package manager (npm) during the installation of packages. Adversaries may abuse this technique to execute arbitrary commands on the system and establish persistence. This activity was observed in the wild as part of the Shai-Hulud worm.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the execution of Node.js pre or post-install scripts. These scripts are executed
by the Node.js package manager (npm) during the installation of packages. Adversaries may abuse
this technique to execute arbitrary commands on the system and establish persistence. This activity
was observed in the wild as part of the Shai-Hulud worm.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Node.js Pre or Post-Install Script Execution"
references = [
    "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
    "https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack",
    "https://www.elastic.co/blog/shai-hulud-worm-2-0-updated-response",
]
risk_score = 47
rule_id = "0871a5d8-6b5f-4a12-a568-fd7bc05bd8db"
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",
  "OS: macOS",
  "Use Case: Threat Detection",
  "Tactic: Persistence",
  "Tactic: Execution",
  "Tactic: Defense Evasion",
  "Data Source: Elastic Defend",
  "Resources: Investigation Guide",
  "Data Source: Crowdstrike",
  "Data Source: SentinelOne",
]
type = "eql"
query = '''
sequence by host.id with maxspan=10s
  [process where host.os.type in ("linux", "macos") and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and process.name == "node" and process.args == "install"] by process.entity_id
  [process where host.os.type in ("linux", "macos") and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and process.parent.name == "node"] by process.parent.entity_id
'''

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

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

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

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

[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"

[[rule.threat.technique.subtechnique]]
id = "T1204.005"
name = "Malicious Library"
reference = "https://attack.mitre.org/techniques/T1204/005/"

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

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

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

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

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

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

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

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

[[rule.threat.technique]]
id = "T1195"
name = "Supply Chain Compromise"
reference = "https://attack.mitre.org/techniques/T1195/"

[[rule.threat.technique.subtechnique]]
id = "T1195.001"
name = "Compromise Software Dependencies and Development Tools"
reference = "https://attack.mitre.org/techniques/T1195/001/"

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

Stages and Predicates

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

Stage 1: process

[process where host.os.type in ("linux", "macos") and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and process.name == "node" and process.args == "install"] by process.entity_id

Stage 2: process

[process where host.os.type in ("linux", "macos") and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and process.parent.name == "node"] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2 corpus 119 (elastic 119)
  • exec corpus 180 (elastic 180)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • install corpus 2 (elastic 2)
field:"process.args" kind:eq value:"install"
process.nameeq
  • node corpus 17 (elastic 17)
field:"process_basename" kind:eq value:"node"
process.parent.nameeq
  • node corpus 12 (elastic 12)
field:"parent_process_basename" kind:eq value:"node"

Persistence via GenAI Tool

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

Detects when a GenAI process or descendant attempts to modify commonly abused file persistence entries. This activity could be the result of exploiting a prompt injection vulnerability or compromised external dependency.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when a GenAI process or descendant attempts to modify commonly abused file persistence entries. This activity
could be the result of exploiting a prompt injection vulnerability or compromised external dependency.
"""
id = "1a2e350a-4f4b-411b-af91-b1555eebe17f"
license = "Elastic License v2"
name = "Persistence via GenAI Tool"
os_list = ["macos", "windows"]
reference = [
    "https://cymulate.com/blog/cve-2025-547954-54795-claude-inverseprompt/",
    "https://specterops.io/blog/2025/11/21/an-evening-with-claude-code/",
    "https://www.straiker.ai/blog/nomshub-cursor-remote-tunneling-sandbox-breakout",
]
version = "1.0.7"

query = '''
sequence by process.entity_id with maxspan=1m
[process where event.type == "start" and event.action in ("exec", "start") and
 (
  process.parent.name in ("claude", "claude.exe", "cursor.exe", "cursor", "Cursor", "codex", "codex.exe", "sandbox-exec",
  "openai", "openai.exe", "ollama.exe", "ollama", "textgen.exe", "textgen", "lmstudio.exe", "lmstudio",
  "copilot.exe", "copilot", "gemini-cli.exe", "llm", "windsurf", "windsurf.exe", "Windsurf.exe", "Windsurf Helper", "Windsurf Helper (Plugin)", "Windsurf Helper (Renderer)", "Windsurf Helper (GPU)") or

  descendant of [process where event.action in ("exec", "start") and
                 process.parent.name in ("claude", "claude.exe", "cursor.exe", "cursor", "codex", "codex.exe", "sandbox-exec",
                 "openai", "openai.exe", "ollama.exe", "ollama", "textgen.exe", "textgen", "lmstudio.exe", "lmstudio", "copilot.exe",
                 "copilot", "gemini-cli.exe", "llm", "windsurf", "windsurf.exe", "Windsurf.exe", "Windsurf Helper", "Windsurf Helper (Plugin)", "Windsurf Helper (Renderer)", "Windsurf Helper (GPU)")]
 ) and
 not process.Ext.effective_parent.executable == "/opt/jc/bin/jumpcloud-agent" and
 not (process.executable like ("/opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby",
                               "/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby") and
      process.args in ("/opt/homebrew/Library/Homebrew/brew.rb",
                       "/usr/local/Homebrew/Library/Homebrew/brew.rb") and
      process.args == "services")]
[file where not event.action in ("deletion", "open", "rename") and
  file.path : ("/private/etc/rc.local",
               "/etc/rc.local",
               "/etc/sudoers",
               "/System/Library/LaunchAgents/*.plist",
               "/Library/LaunchAgents/*.plist",
               "/Users/*/Library/LaunchAgents/*.plist",
               "/System/Library/LaunchDaemons/*.plist",
               "/Library/LaunchDaemons/*.plist",
               "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
               "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\*") and
  not file.name : "com.github.facebook.watchman.plist" and
  not process.code_signature.subject_name == "Ollama Inc."]
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"
[[threat.technique.subtechnique]]
id = "T1037.004"
name = "RC Scripts"
reference = "https://attack.mitre.org/techniques/T1037/004/"


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

[[threat.technique.subtechnique]]
id = "T1543.004"
name = "Launch Daemon"
reference = "https://attack.mitre.org/techniques/T1543/004/"


[[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.10.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.type == "start" and event.action in ("exec", "start") and
 (
  process.parent.name in ("claude", "claude.exe", "cursor.exe", "cursor", "Cursor", "codex", "codex.exe", "sandbox-exec",
  "openai", "openai.exe", "ollama.exe", "ollama", "textgen.exe", "textgen", "lmstudio.exe", "lmstudio",
  "copilot.exe", "copilot", "gemini-cli.exe", "llm", "windsurf", "windsurf.exe", "Windsurf.exe", "Windsurf Helper", "Windsurf Helper (Plugin)", "Windsurf Helper (Renderer)", "Windsurf Helper (GPU)") or

  descendant of [process where event.action in ("exec", "start") and
                 process.parent.name in ("claude", "claude.exe", "cursor.exe", "cursor", "codex", "codex.exe", "sandbox-exec",
                 "openai", "openai.exe", "ollama.exe", "ollama", "textgen.exe", "textgen", "lmstudio.exe", "lmstudio", "copilot.exe",
                 "copilot", "gemini-cli.exe", "llm", "windsurf", "windsurf.exe", "Windsurf.exe", "Windsurf Helper", "Windsurf Helper (Plugin)", "Windsurf Helper (Renderer)", "Windsurf Helper (GPU)")]
 ) and
 not process.Ext.effective_parent.executable == "/opt/jc/bin/jumpcloud-agent" and
 not (process.executable like ("/opt/homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby",
                               "/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/*/bin/ruby") and
      process.args in ("/opt/homebrew/Library/Homebrew/brew.rb",
                       "/usr/local/Homebrew/Library/Homebrew/brew.rb") and
      process.args == "services")]

Stage 2: file

[file where not event.action in ("deletion", "open", "rename") and
  file.path : ("/private/etc/rc.local",
               "/etc/rc.local",
               "/etc/sudoers",
               "/System/Library/LaunchAgents/*.plist",
               "/Library/LaunchAgents/*.plist",
               "/Users/*/Library/LaunchAgents/*.plist",
               "/System/Library/LaunchDaemons/*.plist",
               "/Library/LaunchDaemons/*.plist",
               "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
               "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\*") and
  not file.name : "com.github.facebook.watchman.plist" and
  not process.code_signature.subject_name == "Ollama Inc."]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec corpus 180 (elastic 180)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
file.pathwildcard
  • /Library/LaunchAgents/*.plist corpus 2 (elastic 2)
  • /Library/LaunchDaemons/*.plist corpus 2 (elastic 2)
  • /System/Library/LaunchAgents/*.plist
  • /System/Library/LaunchDaemons/*.plist
  • /Users/*/Library/LaunchAgents/*.plist corpus 2 (elastic 2)
  • /etc/rc.local corpus 2 (elastic 2)
  • /etc/sudoers corpus 2 (elastic 2)
  • /private/etc/rc.local
  • ?:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\* corpus 12 (elastic 12)
  • ?:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\* corpus 13 (elastic 13)
field:"TargetFilename" kind:wildcard
process.parent.namein
  • Cursor corpus 4 (elastic 4)
  • Windsurf Helper corpus 2 (elastic 2)
  • Windsurf Helper (GPU) corpus 2 (elastic 2)
  • Windsurf Helper (Plugin) corpus 2 (elastic 2)
  • Windsurf Helper (Renderer) corpus 2 (elastic 2)
  • Windsurf.exe corpus 2 (elastic 2)
  • claude corpus 4 (elastic 4)
  • claude.exe corpus 3 (elastic 3)
  • codex corpus 4 (elastic 4)
  • codex.exe corpus 4 (elastic 4)
  • copilot corpus 4 (elastic 4)
  • copilot.exe corpus 3 (elastic 3)
  • cursor corpus 4 (elastic 4)
  • cursor.exe corpus 3 (elastic 3)
  • gemini-cli.exe corpus 4 (elastic 4)
  • llm
  • lmstudio corpus 4 (elastic 4)
  • lmstudio.exe corpus 3 (elastic 3)
  • ollama corpus 4 (elastic 4)
  • ollama.exe corpus 3 (elastic 3)
  • openai
  • openai.exe
  • sandbox-exec
  • textgen corpus 4 (elastic 4)
  • textgen.exe corpus 4 (elastic 4)
  • windsurf corpus 2 (elastic 2)
  • windsurf.exe
field:"parent_process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

Potential HackersChoice Tool Downloaded

#
Source
github.com/elastic/protections-artifacts

Identifies processes that are capable of downloading files with command line arguments containing URLs to HackersChoice's tools. These tools are often used by threat actors to gain access to systems.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies processes that are capable of downloading files with command line arguments containing URLs to
HackersChoice's tools. These tools are often used by threat actors to gain access to systems.
"""
id = "cb351778-7329-4de9-82b5-6705f772a3af"
license = "Elastic License v2"
name = "Potential HackersChoice Tool Downloaded"
os_list = ["linux"]
reference = ["https://github.com/hackerschoice"]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and process.name in ("curl", "wget") and 
process.command_line like~ ("*github.com/hackerschoice/*", "*thc.org/*", "*nossl.segfault.net/*", "*gsocket.io/*")
'''

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 = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.004"
name = "SSH"
reference = "https://attack.mitre.org/techniques/T1021/004/"


[[threat.technique]]
id = "T1563"
name = "Remote Service Session Hijacking"
reference = "https://attack.mitre.org/techniques/T1563/"
[[threat.technique.subtechnique]]
id = "T1563.001"
name = "SSH Hijacking"
reference = "https://attack.mitre.org/techniques/T1563/001/"



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

[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 in ("curl", "wget") and 
process.command_line like~ ("*github.com/hackerschoice/*", "*thc.org/*", "*nossl.segfault.net/*", "*gsocket.io/*")

Indicators

These rows show field, operator, and value matches.

Potential Persistence via Direct Crontab Modification

#
Source
github.com/elastic/protections-artifacts

Detects the modification of the crontab file. Attackers can modify the crontab file to execute commands at specific times or intervals to maintain persistence on the system. Modifying the crontab directly is uncommon, and abused by attackers to automate persistence.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the modification of the crontab file. Attackers can modify the crontab file to execute commands at specific
times or intervals to maintain persistence on the system. Modifying the crontab directly is uncommon, and abused by
attackers to automate persistence.
"""
id = "b3bcbab6-e216-4d70-bdee-2b69affbb386"
license = "Elastic License v2"
name = "Potential Persistence via Direct Crontab Modification"
os_list = ["linux", "macos"]
version = "1.0.12"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "crontab" and process.args == "-" and
process.parent.executable like (
  "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/boot/*", "/etc/cron*", "/etc/init.d/*", "/etc/update-motd.d/*",
  "/srv/*", "/var/log/*", "/var/www/*", "/home/*/.*"
) and not (
  process.parent.executable in (
    "/var/www/html/admin/modules/iotserver/bin/check_license.php",
    "/tmp/newroot/opt/puppetlabs/puppet/bin/puppet",
    "/tmp/package/install.sh",
    "/tmp/newroot/usr/sbin/veeamworker",
    "/tmp/newroot/usr/sbin/veeamservice"
  ) or
  process.parent.command_line in (
    "/bin/bash +x ./ninja-deb-uninstall.sh", "./update-cronjobs.sh", "/bin/bash ./leip.sh", "/bin/bash ./2leip.sh"
  ) or
  process.parent.name == "bundle" or
  process.working_directory == "/opt/microsoft/mdatp/conf" or
  process.parent.args like "/var/lib/dpkg/*" or
  process.env_vars == "LD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/lib" or
  process.parent.executable like (
    "/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*",
    "/home/*/.rbenv/versions/*/bin/ruby"
  )
)
'''

min_endpoint_version = "8.7.0"
optional_actions = []
[[actions]]
action = "kill_process"
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.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"



[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.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"



[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.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"



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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "crontab" and process.args == "-" and
process.parent.executable like (
  "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/boot/*", "/etc/cron*", "/etc/init.d/*", "/etc/update-motd.d/*",
  "/srv/*", "/var/log/*", "/var/www/*", "/home/*/.*"
) and not (
  process.parent.executable in (
    "/var/www/html/admin/modules/iotserver/bin/check_license.php",
    "/tmp/newroot/opt/puppetlabs/puppet/bin/puppet",
    "/tmp/package/install.sh",
    "/tmp/newroot/usr/sbin/veeamworker",
    "/tmp/newroot/usr/sbin/veeamservice"
  ) or
  process.parent.command_line in (
    "/bin/bash +x ./ninja-deb-uninstall.sh", "./update-cronjobs.sh", "/bin/bash ./leip.sh", "/bin/bash ./2leip.sh"
  ) or
  process.parent.name == "bundle" or
  process.working_directory == "/opt/microsoft/mdatp/conf" or
  process.parent.args like "/var/lib/dpkg/*" or
  process.env_vars == "LD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/lib" or
  process.parent.executable like (
    "/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*",
    "/home/*/.rbenv/versions/*/bin/ruby"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • - corpus 3 (elastic 3)
field:"process.args" kind:eq value:"-"
process.nameeq
  • crontab
field:"process_basename" kind:eq value:"crontab"
process.parent.executablewildcard
  • ./* corpus 5 (elastic 5)
  • /boot/* corpus 2 (elastic 2)
  • /dev/shm/* corpus 12 (elastic 12)
  • /etc/cron*
  • /etc/init.d/*
  • /etc/update-motd.d/*
  • /home/*/.*
  • /srv/*
  • /tmp/* corpus 13 (elastic 13)
  • /var/log/*
  • /var/tmp/* corpus 13 (elastic 13)
  • /var/www/* corpus 2 (elastic 2)
field:"ParentImage" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.env_varseqLD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/libexcludes:process.env_vars field:"process.env_vars" value:"LD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/lib"
process.parent.argsstarts_with/var/lib/dpkg/excludes:process.parent.args field:"process.parent.args" value:"/var/lib/dpkg/"
process.parent.command_linein./update-cronjobs.sh, /bin/bash +x ./ninja-deb-uninstall.sh, /bin/bash ./2leip.sh, /bin/bash ./leip.shexcludes:process.parent.command_line
process.parent.executablein/tmp/newroot/opt/puppetlabs/puppet/bin/puppet, /tmp/newroot/usr/sbin/veeamservice, /tmp/newroot/usr/sbin/veeamworker, /tmp/package/install.sh, /var/www/html/admin/modules/iotserver/bin/check_license.phpexcludes:process.parent.executable
process.parent.executablewildcard/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*, /home/*/.rbenv/versions/*/bin/rubyexcludes:process.parent.executable field:"process.parent.executable" value:"/home/*/.local/share/uv/python/cpython-*-linux-x86_64-gnu/bin/python*" field:"process.parent.executable" value:"/home/*/.rbenv/versions/*/bin/ruby"
process.parent.nameeqbundleexcludes:process.parent.name field:"process.parent.name" value:"bundle"
process.working_directoryeq/opt/microsoft/mdatp/confexcludes:process.working_directory field:"process.working_directory" value:"/opt/microsoft/mdatp/conf"

Potential Widespread Malware Infection Across Multiple Hosts

#
Status
production
Severity
high
Time window
9m
Group by
event.code, rule.name
Author
Elastic
Source
github.com/elastic/detection-rules

This rule uses alert data to determine when a malware signature is triggered in multiple hosts. Analysts can use this to prioritize triage and response, as this can potentially indicate a widespread malware infection.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/05/08"
maturity = "production"
updated_date = "2025/07/16"

[rule]
author = ["Elastic"]
description = """
This rule uses alert data to determine when a malware signature is triggered in multiple hosts. Analysts can use this to
prioritize triage and response, as this can potentially indicate a widespread malware infection.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Potential Widespread Malware Infection Across Multiple Hosts"
note = """## Triage and analysis

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

### Investigating Potential Widespread Malware Infection Across Multiple Hosts

Endpoint security technologies monitor and analyze activities on devices to detect malicious behavior. Adversaries exploit these systems by deploying malware that triggers specific signatures across multiple hosts, indicating a coordinated attack. The detection rule identifies such threats by analyzing alert data for specific malware signatures across several hosts, flagging potential widespread infections for prioritized investigation.

### Possible investigation steps

- Review the alert details to identify the specific rule.name and event.code that triggered the alert, focusing on those with a high count of distinct host.id values.
- Correlate the identified rule.name with known malware signatures or recent threat intelligence reports to understand the potential impact and behavior of the malware.
- Examine the affected host.id entries to determine if there are any commonalities, such as shared network segments, user accounts, or software versions, that could indicate the initial infection vector.
- Investigate the timeline of events for each affected host to identify any suspicious activities or anomalies preceding the alert, such as unusual file downloads or execution of unknown processes.
- Check for any additional alerts or logs related to the same host.id entries to assess if there are other indicators of compromise or related malicious activities.
- Coordinate with IT and security teams to isolate affected hosts if necessary, and initiate containment and remediation procedures based on the findings.

### False positive analysis

- Legitimate software updates or installations may trigger malware signatures, especially if they involve new or uncommon software. Users can create exceptions for known software update processes to prevent these alerts from being flagged as potential threats.
- Security testing tools or penetration testing activities might mimic malware behavior, leading to false positives. Analysts should coordinate with IT and security teams to whitelist these activities during scheduled tests.
- Custom scripts or administrative tools that perform automated tasks across multiple hosts can be mistaken for malicious activity. Identifying and excluding these scripts from the rule can reduce unnecessary alerts.
- Frequent use of remote management tools that execute scripts or commands on multiple hosts may trigger alerts. Users should ensure these tools are recognized and excluded from the rule to avoid false positives.
- Known benign applications that use shellcode or memory manipulation techniques for legitimate purposes should be reviewed and added to an exception list to prevent them from being flagged.

### Response and remediation

- Isolate affected hosts immediately to prevent further spread of the malware across the network. This can be done by disconnecting them from the network or using network segmentation techniques.
- Conduct a thorough scan of the isolated hosts using updated antivirus or endpoint detection and response (EDR) tools to identify and remove the malicious files or processes associated with the detected signatures.
- Analyze the identified malware to understand its behavior and entry points. This will help in determining if additional hosts may be compromised and require similar remediation actions.
- Apply security patches and updates to all affected systems to close any vulnerabilities that the malware may have exploited.
- Restore affected systems from clean backups if the malware has caused significant damage or if the integrity of the system cannot be assured after cleaning.
- Monitor network traffic and endpoint activities closely for any signs of persistence or re-infection, using enhanced detection rules and updated threat intelligence feeds.
- Escalate the incident to the appropriate internal or external cybersecurity teams if the infection appears to be part of a larger coordinated attack, ensuring that all relevant data and findings are shared for further investigation and response."""
references = ["https://github.com/elastic/protections-artifacts/tree/main/yara/rules"]
risk_score = 73
rule_id = "28371aa1-14ed-46cf-ab5b-2fc7d1942278"
severity = "high"
tags = [
    "Domain: Endpoint",
    "Data Source: Elastic Defend",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Rule Type: Higher-Order Rule",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-endpoint.alerts-*
| where event.code in ("malicious_file", "memory_signature", "shellcode_thread") and rule.name is not null
| keep host.id, rule.name, event.code
| stats Esql.host_id_count_distinct = count_distinct(host.id) by rule.name, event.code
| where Esql.host_id_count_distinct >= 3
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"



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

Stages and Predicates

Stage 1: from

from logs-endpoint.alerts-*

Stage 2: where

| where event.code in ("malicious_file", "memory_signature", "shellcode_thread") and rule.name is not null

Stage 3: keep

| keep host.id, rule.name, event.code

Stage 4: stats

| stats Esql.host_id_count_distinct = count_distinct(host.id) by rule.name, event.code

Stage 5: where

| where Esql.host_id_count_distinct >= 3

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Esql.host_id_count_distinctge
  • 3
field:"Esql.host_id_count_distinct" kind:ge value:"3"
event.codein
  • malicious_file corpus 3 (elastic 3)
  • memory_signature corpus 3 (elastic 3)
  • shellcode_thread corpus 3 (elastic 3)
field:"EventID" kind:in
rule.nameis_not_null
  • (no value, null check)
field:"rule.name" kind:is_not_null

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.host_id_count_distinctSTATS Esql.host_id_count_distinct = count_distinct(host.id)
rule.nameSTATS BY
event.codeSTATS BY

Protected Storage Service Access via SMB

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

Identifies remote access to the Windows Protected Storage Service through the IPC$ share. Attackers may abuse this named pipe to interact with the Protected Storage Service and extract sensitive credentials, certificates, or DPAPI backup keys.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2026/06/26"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/06/26"

[rule]
author = ["Elastic"]
description = """
Identifies remote access to the Windows Protected Storage Service through the IPC$ share. Attackers may abuse this
named pipe to interact with the Protected Storage Service and extract sensitive credentials, certificates, or DPAPI
backup keys.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Protected Storage Service Access via SMB"
note = """## Triage and analysis

### Investigating Protected Storage Service Access via SMB

The Protected Storage Service manages sensitive user data such as passwords, certificates, and private keys. Remote
access to the `protected_storage` named pipe over the IPC$ share is unusual and may indicate an attempt to extract
credentials or abuse DPAPI to retrieve domain backup keys from domain controllers.

#### Possible investigation steps

- Identify the source system and user account that initiated the access by reviewing `source.ip`, `user.name`, and
  `winlog.event_data.SubjectUserName`.
- Determine whether the target host is a domain controller or other high-value system that stores DPAPI backup keys.
- Review authentication events (4624, 4625) around the alert time to identify how the source authenticated to the
  target.
- Investigate other alerts associated with the source host or user during the past 48 hours.
- Check for follow-on credential access activity such as registry hive access, LSASS access, or lateral movement.

### False positive analysis

- This activity is rarely expected in most environments. If legitimate administrative tooling accesses this pipe,
  confirm the source, account, and target system before adding an exception.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the source host if unauthorized access is confirmed.
- Investigate credential exposure and reset passwords for potentially compromised accounts.
- Review domain controller DPAPI backup key exposure if the target is a domain controller.
"""
references = [
    "https://threathunterplaybook.com/hunts/windows/190620-DomainDPAPIBackupKeyExtraction/notebook.html",
    "https://www.elastic.co/security-labs/detect-credential-access",
]
setup = """## Setup

Audit Detailed File Share must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-detailed-file-share
"""
risk_score = 73
rule_id = "9bed06f5-0c32-488a-9353-d565fc9d1573"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Lateral Movement",
    "Resources: Investigation Guide",
    "Use Case: Active Directory Monitoring",
    "Data Source: Active Directory",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
host.os.type:windows and event.category:file and event.code:5145 and
  winlog.event_data.ShareName:"\\\\*\\IPC$" and
  winlog.event_data.RelativeTargetName:"protected_storage" and
  not source.ip:("::" or "::1" or "0.0.0.0" or "127.0.0.1")
'''


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

[[rule.threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"

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

Stages and Predicates

Stage 1: query

host.os.type:windows and event.category:file and event.code:5145 and
  winlog.event_data.ShareName:"\\\\*\\IPC$" and
  winlog.event_data.RelativeTargetName:"protected_storage" and
  not source.ip:("::" or "::1" or "0.0.0.0" or "127.0.0.1")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
source.ipin0.0.0.0, 127.0.0.1, ::, ::1excludes:source.ip

Remcos RAT ExePath Registry Modification

#
Source
github.com/elastic/protections-artifacts

Identifies registry modification consistent with the Remcos Remote Access Trojan (RAT). Remcos RAT is used by attackers to perform actions on infected machines remotely.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Defense Impairment

Rule Body

[rule]
description = """
Identifies registry modification consistent with the Remcos Remote Access Trojan (RAT). Remcos RAT is used by attackers
to perform actions on infected machines remotely.
"""
id = "d8e20cd0-e00d-4188-8728-b3adccf10495"
license = "Elastic License v2"
name = "Remcos RAT ExePath Registry Modification"
os_list = ["windows"]
reference = [
    "https://any.run/malware-trends/remcos",
    "https://attack.mitre.org/software/S0332/",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
]
version = "1.0.3"

query = '''
registry where event.action == "modification" and
  registry.value == "EXEpath" and
  process.code_signature.trusted != true and
  /* EXEpath used by RemcosRAT watchdog to restart it if killed and it contains encrypted path */
  registry.path : "HKEY_USERS\\S-1-5-*\\SOFTWARE\\*\\exepath" and
  registry.data.strings : "?*" and
  not registry.data.strings regex~ """.*[a-z0-9]{8,}.*"""
'''

min_endpoint_version = "8.1.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 = "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/"
[[threat]]
framework = "MITRE ATT&CK"

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

[internal]
min_endpoint_version = "8.1.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and
  registry.value == "EXEpath" and
  process.code_signature.trusted != true and
  registry.path : "HKEY_USERS\\S-1-5-*\\SOFTWARE\\*\\exepath" and
  registry.data.strings : "?*" and
  not registry.data.strings regex~ """.*[a-z0-9]{8,}.*"""

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
registry.data.stringsregex_match.*[a-z0-9]{8,}.*excludes:registry.data.strings field:"registry.data.strings" value:".*[a-z0-9]{8,}.*"

Sensitive Privilege SeEnableDelegationPrivilege assigned to a Principal

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

Identifies the assignment of the SeEnableDelegationPrivilege sensitive "user right" to a security principal. This right enables computer and user accounts to be trusted for delegation. Attackers can abuse it to compromise Active Directory accounts and elevate their privileges.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/01/27"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/04/27"

[rule]
author = ["Elastic"]
description = """
Identifies the assignment of the SeEnableDelegationPrivilege sensitive "user right" to a security principal. This
right enables computer and user accounts to be trusted for delegation. Attackers can abuse it to compromise Active
Directory accounts and elevate their privileges.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
language = "kuery"
license = "Elastic License v2"
name = "Sensitive Privilege SeEnableDelegationPrivilege assigned to a Principal"
references = [
    "https://blog.harmj0y.net/activedirectory/the-most-dangerous-user-right-you-probably-have-never-heard-of/",
    "https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_alert_active_directory_user_control.yml",
    "https://twitter.com/_nwodtuhs/status/1454049485080907776",
    "https://www.thehacker.recipes/ad/movement/kerberos/delegations",
    "https://github.com/atc-project/atomic-threat-coverage/blob/master/Atomic_Threat_Coverage/Logging_Policies/LP_0105_windows_audit_authorization_policy_change.md",
]
risk_score = 73
rule_id = "f494c678-3c33-43aa-b169-bb3d5198c41d"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Persistence",
    "Data Source: Active Directory",
    "Resources: Investigation Guide",
    "Use Case: Active Directory Monitoring",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.code:4704 and host.os.type:"windows" and winlog.event_data.PrivilegeList:"SeEnableDelegationPrivilege"
'''

note = """## Triage and analysis

### Investigating Sensitive Privilege SeEnableDelegationPrivilege assigned to a Principal

#### Possible investigation steps

- Which principal received SeEnableDelegationPrivilege, and is it narrow enough for delegation administration?
  - Focus: the "4704" grant's `winlog.event_data.PrivilegeList`, `winlog.event_data.TargetSid`, and `winlog.computer_name`; resolve `winlog.event_data.TargetSid` when the account name is absent.
  - Implication: escalate when the target is a human user, broad admin cohort, stale account, or identity not dedicated to delegation administration; lower concern only for a narrow delegation-admin or service-management principal with controlled source, rollback, and no follow-on abuse.

- Did a direct actor assign the right, or is the event local policy application?
  - Why: "4704" often shows "SYSTEM" or the machine account applying policy, which is not the same as identifying the upstream policy editor.
  - Focus: `winlog.event_data.SubjectUserSid`, `winlog.event_data.SubjectUserName`, `winlog.event_data.SubjectLogonId`, and `winlog.computer_name` to separate a human or service actor from "S-1-5-18" or a machine account.
  - Implication: escalate when a user-backed or unexpected service account directly assigned the right; when the subject is "SYSTEM" or the machine account, treat it as policy application and keep the upstream policy source unresolved until evidence outside "4704" explains it.

- If the grant came from a user-backed session, does the linked logon fit the admin tier?
  - Focus: authentication events on `host.id` where `winlog.event_data.TargetLogonId` matches `winlog.event_data.SubjectLogonId`; read `source.ip`, `winlog.logon.type`, and `winlog.event_data.AuthenticationPackageName`. $investigate_0
  - Hint: search `winlog.event_data.SubjectLogonId` separately for "4648" explicit-credential context. Missing authentication telemetry is unresolved, not benign; skip this bridge for SYSTEM or machine-account policy application.
  - Implication: escalate for an unusual admin source, remote-interactive or NewCredentials logon, unexpected NTLM, or explicit-credential use; lower concern when Kerberos and the source host fit the controlled delegation-admin workflow.

- Did authorization-policy activity stay bounded and roll back?
  - Focus: surrounding grant/removal events on `winlog.computer_name` for the same `winlog.event_data.SubjectUserSid` and `winlog.event_data.SubjectLogonId`, including other `winlog.event_data.PrivilegeList` or `winlog.event_data.TargetSid` values. $investigate_1
  - Hint: check paired removals for the same `winlog.event_data.TargetSid`, `winlog.event_data.PrivilegeList`, and `winlog.computer_name`. $investigate_2
  - Implication: escalate when the same context grants other rights, removes guardrails, touches multiple principals, repeats the grant, or lacks rollback; lower urgency when activity stays bounded to one controlled grant-plus-rollback cycle for the same target.

- Did the actor or newly empowered account modify delegation attributes after the grant?
  - Why: this right is most dangerous when followed by delegation changes on user or computer objects.
  - Focus: later "5136" events where `winlog.event_data.SubjectUserSid` matches the assigning or granted principal; review `winlog.event_data.ObjectDN`, `winlog.event_data.AttributeLDAPDisplayName`, and `winlog.event_data.AttributeValue` for "userAccountControl" trusted-for-delegation flags or "msDS-AllowedToDelegateTo" updates. $investigate_3
  - Hint: if "5136" coverage is unavailable, preserve `winlog.event_data.TargetSid`, `winlog.event_data.SubjectUserSid`, and `winlog.computer_name` for AD follow-up instead of treating absent evidence as benign.
  - Implication: escalate when either principal soon changes delegation flags or constrained-delegation targets because these values can enable Kerberos S4U abuse against named services; absence of follow-on changes lowers urgency only when target, source, and rollback also align.

- If local evidence remains suspicious or unresolved, do detection alerts for either SID widen scope?
  - Focus: recent alert-window results for the assigning account SID, `winlog.event_data.SubjectUserSid`. $investigate_4
  - Hint: compare the same recent window with alerts for the granted account SID, `winlog.event_data.TargetSid`. $investigate_5
  - Implication: escalate scope when either account has privilege, directory, ticket, or lateral-movement alerts; keep the case local when histories are quiet and local evidence supports a controlled workflow.

- Escalate for unexpected target/source, abnormal session, absent rollback, follow-on delegation changes, or related alerts; close only when target, source, session, rollback, delegation attributes, and scope bind one controlled workflow; preserve and escalate mixed or incomplete evidence.

### False positive analysis

- Controlled delegation administration can legitimately trigger this rule when a dedicated delegation-admin or service-management principal is temporarily granted this right. Confirm only when `winlog.event_data.TargetSid`, `winlog.event_data.SubjectUserSid` or SYSTEM/machine policy path, `winlog.computer_name`, direct-session `source.ip`, `winlog.logon.type`, `winlog.event_data.AuthenticationPackageName`, rollback, and bounded `winlog.event_data.AttributeLDAPDisplayName` or `winlog.event_data.ObjectDN` changes all fit the same change; use change records or AD owner confirmation when telemetry cannot prove intent, and do not close if any dimension diverges.
- Before creating an exception, validate recurrence for the same source, `winlog.event_data.TargetSid`, `winlog.computer_name`, direct-session source when applicable, and bounded delegation-attribute pattern. Build the exception from that minimum workflow, never from "SeEnableDelegationPrivilege" or the rule name alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and document the controlled workflow evidence: target SID, assigning or policy-application source, emitting system, linked authentication context, rollback, and bounded delegation-attribute changes. Keep any exception narrow and require the same workflow to recur before suppressing future alerts.
- If suspicious but unconfirmed, preserve the alert document, exported authorization-policy grant/removal records, linked "4624"/"4648" authentication records, SID-resolution notes, and any related "5136" delegation-change records before containment. Apply reversible containment such as heightened monitoring on both identities or temporary delegation-administration restrictions. Escalate to stronger containment only if follow-on directory changes, repeated grants, or related alerts show broader abuse.
- If confirmed malicious, preserve the same Windows Security records and SID-resolution evidence before destructive actions. Disable or restrict the granting or granted principal, contain the originating admin workstation when identified from `source.ip`, and hand off to Active Directory or incident response if direct response is unavailable.
- After containment, remove SeEnableDelegationPrivilege from the granted principal, verify paired removal evidence, revert unauthorized delegation-related attribute changes, and review recent authorization-policy events from the same actor for additional rollback. If delegation abuse is confirmed, prioritize credential hygiene for affected identities.
- Post-incident hardening: restrict delegation-administration rights to dedicated accounts, keep Windows Security auditing for authorization-policy and directory-service changes enabled on domain controllers, and document the final workflow or abuse pattern for future triage.
"""

setup = """## Setup

Audit Authorization Policy Change must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-authorization-policy-change
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.code",
    "host.name",
    "host.id",
    "winlog.computer_name",
    "winlog.event_data.SubjectUserName",
    "winlog.event_data.SubjectUserSid",
    "winlog.event_data.SubjectDomainName",
    "winlog.event_data.SubjectLogonId",
    "winlog.event_data.TargetSid",
    "winlog.event_data.PrivilegeList",
    "winlog.activity_id",
]

[transform]

[[transform.investigate]]
label = "Logon events for the assigning session"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4648", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

[[transform.investigate]]
label = "User-right changes by the same source session"
description = ""
providers = [
  [
    { excluded = false, field = "winlog.computer_name", queryType = "phrase", value = "{{winlog.computer_name}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4704", valueType = "string" }
  ],
  [
    { excluded = false, field = "winlog.computer_name", queryType = "phrase", value = "{{winlog.computer_name}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4705", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

[[transform.investigate]]
label = "User-right removals for the granted principal"
description = ""
providers = [
  [
    { excluded = false, field = "winlog.computer_name", queryType = "phrase", value = "{{winlog.computer_name}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.TargetSid", queryType = "phrase", value = "{{winlog.event_data.TargetSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.PrivilegeList", queryType = "phrase", value = "{{winlog.event_data.PrivilegeList}}", valueType = "string" },
    { excluded = false, field = "event.code", queryType = "phrase", value = "4705", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

[[transform.investigate]]
label = "Delegation attribute changes by involved principals"
description = ""
providers = [
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.AttributeLDAPDisplayName", queryType = "phrase", value = "userAccountControl", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.AttributeLDAPDisplayName", queryType = "phrase", value = "msDS-AllowedToDelegateTo", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.TargetSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.AttributeLDAPDisplayName", queryType = "phrase", value = "userAccountControl", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.code", queryType = "phrase", value = "5136", valueType = "string" },
    { excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.TargetSid}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.AttributeLDAPDisplayName", queryType = "phrase", value = "msDS-AllowedToDelegateTo", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

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

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

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"

[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.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

Stages and Predicates

Stage 1: query

event.code:4704 and host.os.type:"windows" and winlog.event_data.PrivilegeList:"SeEnableDelegationPrivilege"

Indicators

These rows show field, operator, and value matches.

Suspicious Network Module LoadLibrary

#
Source
github.com/elastic/protections-artifacts

Detects attempts to load a Microsoft networking related module from a potentially altered call stack in order to conceal the true source of the call.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Detects attempts to load a Microsoft networking related module from a potentially altered call stack in order to conceal
the true source of the call.
"""
id = "7bfc7234-49c6-4f52-93d6-f9d8ba13903b"
license = "Elastic License v2"
name = "Suspicious Network Module LoadLibrary"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.3"

query = '''
library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Windows\\System32\\KernelBase.dll!LoadLibrary*") and
 process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*" and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|kernelbase.dll*" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info regex~ """C:\\Windows\\System32\\KernelBase.dll!([A-K]|[M-Z]).+""") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\ntdll.dll!LdrLoadDll*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\kernel32.dll!BaseThreadInitThunk*") and
 not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll")
'''

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

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


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

library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Windows\\System32\\KernelBase.dll!LoadLibrary*") and
 process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*" and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|kernelbase.dll*" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info regex~ """C:\\Windows\\System32\\KernelBase.dll!([A-K]|[M-Z]).+""") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\ntdll.dll!LdrLoadDll*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\kernel32.dll!BaseThreadInitThunk*") and
 not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                                               "ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|* corpus 4 (elastic 4)
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|kernelbase.dll|*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stack_summaryinntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll" field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll"
process.thread.Ext.call_stack_summarywildcardntdll.dll|kernelbase.dll|*|kernelbase.dll*excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|*|kernelbase.dll*"

Suspicious Portable Executable Encoded in Powershell Script

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

Detects PowerShell scripts that includes a base64-encoded portable executable (PE) header, indicating an embedded binary payload. Attackers embed PEs in scripts to load payloads in memory and avoid writing executables to disk.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2021/10/15"
integration = ["windows"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Detects PowerShell scripts that includes a base64-encoded portable executable (PE) header, indicating an embedded
binary payload. Attackers embed PEs in scripts to load payloads in memory and avoid writing executables to disk.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-windows.powershell*"]
language = "kuery"
license = "Elastic License v2"
name = "Suspicious Portable Executable Encoded in Powershell Script"
note = """## Triage and analysis

> **Disclaimer**:
> This guide was created by humans with the assistance of generative AI. While its contents have been manually curated to include the most valuable information, always validate assumptions and adjust procedures to match your internal runbooks and incident triage and response policies.

### Investigating Suspicious Portable Executable Encoded in Powershell Script

This alert indicates PowerShell Script Block Logging captured script content that contains a base64-encoded Portable Executable (PE) header pattern, suggesting an embedded Windows binary payload. This technique is commonly used to stage executables for in-memory loading or later execution while minimizing on-disk artifacts.

#### Key alert fields to review

- `user.name`, `user.domain`, `user.id`: Account execution context for correlation, prioritization, and scoping.
- `host.name`, `host.id`: Host execution context for correlation, prioritization, and scoping.
- `powershell.file.script_block_text`: Script block content that matched the detection logic.
- `powershell.file.script_block_id`, `powershell.sequence`, `powershell.total`: Script block metadata to pivot to other fragments or reconstruct full script content when split across multiple events.
- `file.path`, `file.directory`, `file.name`: File-origin context when the script block is sourced from an on-disk file.
- `powershell.file.script_block_length`: Script block length (size) context.

#### Possible investigation steps

- Capture and reconstruct the full script content:
  - Review `powershell.file.script_block_text` in full to identify the encoded blob boundaries and any surrounding helper logic (string concatenation, chunking, decryption, decompression, or obfuscation).
  - If `powershell.file.script_block_id` is present, collect all related events for that ID and use `powershell.sequence` and `powershell.total` to reconstruct the complete script when content is split across multiple records.
  - Confirm reconstruction completeness by ensuring the sequence range is consistent with `powershell.total` and that the combined content is coherent.
  - Use `powershell.file.script_block_length` to help prioritize unusually large script blocks that are more likely to contain full payloads or staged components.
- Determine the script origin and execution context:
  - Use `user.name`, `user.domain`, and `user.id` to identify the initiating account and whether this activity is expected for that user (approved automation vs. unusual interactive activity).
  - Use `host.name` and `host.id` to identify the affected asset, its owner/role, and whether PowerShell automation is typical for this host.
  - If `file.path`, `file.directory`, or `file.name` are present, treat the alert as file-sourced script execution:
    - Validate whether the path and name align with approved administrative tooling and distribution locations.
    - Prioritize investigation when scripts are sourced from user-writable locations, temporary directories, or uncommon paths for your environment.
- Identify likely payload handling behavior within the script:
  - Look for logic that transforms the encoded content into executable bytes and how it is consumed (written to disk, loaded as an assembly, reflectively invoked, or mapped into memory).
  - Note any secondary behaviors in the same script block that increase risk, such as staged downloads, persistence-related actions, or attempts to reduce visibility.
  - Identify whether the script constructs multiple encoded blobs, and document which blob is ultimately used for execution.
- Scope the activity using alert pivots:
  - Search for additional script block events for the same `host.id` and `user.id` around `@timestamp` to identify lead-up actions and follow-on behavior.
  - Search across hosts for the same `powershell.file.script_block_text` patterns (the encoded header and any unique strings nearby) to identify other potentially affected systems.
  - If a script file is indicated by `file.path`/`file.name`, search for the same path/name across your environment to determine distribution and reuse.
- Correlate with adjacent telemetry (if available):
  - Pivot on `host.id`/`host.name` and `@timestamp` into process telemetry to identify the PowerShell session and any processes that appear shortly after the script ran, which may indicate payload execution outcomes.
  - Pivot on `host.id`/`host.name` and `@timestamp` into network telemetry to identify outbound connections that could indicate payload retrieval or command-and-control activity shortly before or after script execution.
  - Review authentication activity for the same `user.id` around the alert time to identify unusual logons (unexpected host, timing, or access pattern) that could explain how the execution context was obtained.
- Analyze the embedded payload in an isolated workflow (when permitted):
  - Decode the base64 content and validate whether it forms a legitimate PE.
  - Derive stable indicators (hashes, unique strings, and high-level metadata) and use them to widen the scope across endpoints and historical telemetry.
  - Preserve decoded artifacts and analysis notes according to your incident handling and evidence retention procedures.

### False positive analysis

- Approved administrative or deployment automation that embeds executables in PowerShell scripts for distribution in tightly controlled environments.
- Vendor-provided installers, updaters, or management tooling that stages binaries through PowerShell as part of legitimate maintenance activity.
- Authorized security testing or adversary emulation that intentionally uses embedded payloads or in-memory loading techniques.
- False positives are more likely when `file.path` points to known software distribution locations and the executing `user.id` is an approved automation account; validate against change records and expected tooling.

### Response and remediation

- If the activity is unexpected or malicious:
  - Contain the affected host(s) based on criticality to prevent further execution or lateral movement.
  - Preserve evidence by saving the full reconstructed script content (using `powershell.file.script_block_id` plus all fragments, if split) and recording the associated `@timestamp`, `host.id`, `host.name`, and `user.id` for timeline reconstruction.
- Assess scope and impact:
  - Hunt for the same script patterns across other hosts and users, and expand scoping using any indicators derived from payload analysis.
  - Review the initiating account for signs of compromise; apply credential hygiene actions per policy (reset credentials, revoke sessions, and review access).
- Eradicate and recover:
  - Remove or remediate the script source indicated by `file.path` (if present) and any persistence mechanisms identified during triage (for example, suspicious or newly introduced services).
  - If a PE payload is confirmed, follow malware incident procedures to determine whether host reimaging or deeper forensic review is required.
- Post-incident improvements:
  - Review PowerShell governance for the affected population (script approval processes, least privilege, and monitoring of script block content) to reduce recurrence.
  - Document validated benign patterns and trusted automation paths to streamline future triage and reduce alert fatigue.
"""
references = [
    "https://github.com/atc-project/atc-data/blob/master/docs/Logging_Policies/LP_0109_windows_powershell_script_block_log.md",
]
risk_score = 47
rule_id = "ad84d445-b1ce-4377-82d9-7c633f28bf9a"
setup = """## Setup

PowerShell Script Block Logging must be enabled to generate the events used by this rule (e.g., 4104).
Setup instructions: https://ela.st/powershell-logging-setup
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: PowerShell Logs",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.category:process and host.os.type:windows and
  powershell.file.script_block_text : (
    TVqQAAMAAAAEAAAA
  ) and not user.id : "S-1-5-18"
'''


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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1027.013"
name = "Encrypted/Encoded File"
reference = "https://attack.mitre.org/techniques/T1027/013/"

[[rule.threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user.id",
    "user.domain",
    "powershell.file.script_block_text",
    "powershell.file.script_block_id",
    "powershell.sequence",
    "powershell.total",
    "file.path",
    "file.directory",
    "file.name",
    "process.pid",
    "host.name",
    "host.id",
    "powershell.file.script_block_length"
]

Stages and Predicates

Stage 1: query

event.category:process and host.os.type:windows and
  powershell.file.script_block_text : (
    TVqQAAMAAAAEAAAA
  ) and not user.id : "S-1-5-18"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Suspicious Pseudo-Terminal Proxy Execution via su

#
Source
github.com/elastic/protections-artifacts

Detects the use of "su" with the "-P" or "--pty" option combined with "-c" or "--command" execution. This pattern may indicate an attempt to abuse a privileged pseudo-terminal proxy to relay controlled output from a privileged process. This technique has been demonstrated in exploitation chains targeting AppArmor policy management pseudo-files (".load", ".replace", ".remove") where attackers redirect the output of a privileged utility into these files to load, replace, or remove AppArmor profiles. While "su" usage itself is common, invocation with "--pty" together with command execution is uncommon, and may indicate attempts to proxy controlled data through a privileged process during local privilege escalation activity.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Detects the use of "su" with the "-P" or "--pty" option combined with "-c" or "--command" execution. This pattern may
indicate an attempt to abuse a privileged pseudo-terminal proxy to relay controlled output from a privileged process.
This technique has been demonstrated in exploitation chains targeting AppArmor policy management pseudo-files (".load",
".replace", ".remove") where attackers redirect the output of a privileged utility into these files to load, replace, or
remove AppArmor profiles. While "su" usage itself is common, invocation with "--pty" together with command execution is
uncommon, and may indicate attempts to proxy controlled data through a privileged process during local privilege
escalation activity.
"""
id = "4ef797e7-6f67-4cfd-a1de-236e7f4f8355"
license = "Elastic License v2"
name = "Suspicious Pseudo-Terminal Proxy Execution via su"
os_list = ["linux"]
reference = [
    "https://cdn2.qualys.com/advisory/2026/03/10/crack-armor.txt",
    "https://blog.qualys.com/vulnerabilities-threat-research/2026/03/12/crackarmor-critical-apparmor-flaws-enable-local-privilege-escalation-to-root",
]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "su" and
process.args in ("-P", "--pty") and process.args in ("-c", "--command")
/* May add this in the future, but keeping it broad now to detect general pseudo-terminal proxy execution
and process.command_line like "*stty*raw*"
*/
'''

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 = "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.type == "start" and event.action == "exec" and process.name == "su" and
process.args in ("-P", "--pty") and process.args in ("-c", "--command")
/* May add this in the future, but keeping it broad now to detect general pseudo-terminal proxy execution
and process.command_line like "*stty*raw*"
*/

Indicators

These rows show field, operator, and value matches.

Suspicious Service was Installed in the System

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

Identifies the creation of a new Windows service with a suspicious service name or command value. Windows services typically run as SYSTEM and can be used for privilege escalation and persistence.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/08/30"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/07/29"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a new Windows service with a suspicious service name or command value. Windows services
typically run as SYSTEM and can be used for privilege escalation and persistence.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-system.system*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Service was Installed in the System"

setup = """## Setup

Audit Security System Extension must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-security-system-extension
"""

risk_score = 47
rule_id = "da87eee1-129c-4661-a7aa-57d0b9645fad"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
    "Data Source: Windows Security Event Logs",
    "Data Source: Windows System Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
any where host.os.type == "windows" and
(
  (
    event.code : "4697" and
    (
      (
        (
          winlog.event_data.ServiceFileName : (
            "*COMSPEC*", "*\\127.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*cmd.exe*",
            "*echo*", "*RemComSvc*", "*.bat*", "*.cmd*", "*certutil*", "*vssadmin*", "*certmgr*", "*bitsadmin*",
            "*\\Users\\*", "*\\Windows\\Tasks\\*", "*\\PerfLogs\\*", "*\\Windows\\Debug\\*",
            "*regsvr32*", "*msbuild*", "*winexesvc.exe*", "*DumpSvc.exe*", "*pwsh.exe*", "*PAExec*"
          ) or
          winlog.event_data.ServiceFileName regex~ """%systemroot%\\[a-z0-9]+\.exe"""
        ) and
        not winlog.event_data.ServiceFileName: (
              "%SystemRoot%\\PSEXESVC.exe", "%SystemRoot%\\\\RemComSvc.exe",
              "%SystemRoot%\\pbpsdeploy.exe", "%SystemRoot%\\system32\\RemComSvc.exe",
              "\"C:\\Program Files\\Common Files\\Zoom\\Support\\CptService.exe*",
              "\"C:\\Program Files\\Common Files\\ZoomVDIPluginManagement\\Support\\CptService.exe*",
              "\"C:\\Program Files (x86)\\CheckPoint\\Endpoint Security\\EFR\\host\\cpsechost.exe\" service"
        )
      ) or
      winlog.event_data.ServiceName : (
         "mssecsvc2.0", "WCESERVICE*", "WCE SERVICE*", "pwdump*", "gsecdump*", "cachedump*"
      )
    )
  ) or
  (
    event.code : "7045" and
    (
      (
        winlog.event_data.ImagePath : (
          "*COMSPEC*", "*\\127.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*cmd.exe*",
          "*echo*", "*.bat*", "*.cmd*", "*certutil*", "*vssadmin*", "*certmgr*", "*bitsadmin*",
          "*\\Users\\*", "*\\Windows\\Tasks\\*", "*\\PerfLogs\\*", "*\\Windows\\Debug\\*",
          "*regsvr32*", "*msbuild*", "*winexesvc.exe*", "*DumpSvc.exe*", "*pwsh.exe*", "*PAExec*"
        ) and
        not winlog.event_data.ImagePath : (
              "%SystemRoot%\\PSEXESVC.exe", "%SystemRoot%\\\\RemComSvc.exe",
              "%SystemRoot%\\pbpsdeploy.exe", "%SystemRoot%\\system32\\RemComSvc.exe",
              "\"C:\\Program Files\\Common Files\\Zoom\\Support\\CptService.exe*",
              "\"C:\\Program Files\\Common Files\\ZoomVDIPluginManagement\\Support\\CptService.exe*",
              "\"C:\\Program Files (x86)\\CheckPoint\\Endpoint Security\\EFR\\host\\cpsechost.exe\" service"
        )
      ) or
      winlog.event_data.ServiceName : (
         "mssecsvc2.0", "WCESERVICE*", "WCE SERVICE*", "pwdump*", "gsecdump*", "cachedump*"
      )
    )
  )
)
'''


note = """## Triage and analysis

### Investigating Suspicious Service was Installed in the System

#### Possible investigation steps

- What exact service creation event and matched artifact caused the alert?
  Focus: `event.code`, `host.name`, `winlog.event_data.ServiceName`, `winlog.event_data.ServiceFileName`, `winlog.event_data.ImagePath`.
  Implication: Event `4697` uses `winlog.event_data.ServiceFileName`; event `7045` uses `winlog.event_data.ImagePath`. Treat malware or credential-dump service names such as `mssecsvc2.0`, `WCESERVICE*`, `WCE SERVICE*`, `pwdump*`, `gsecdump*`, or `cachedump*`, or a command containing PAExec, Winexe, DumpSvc, PowerShell, command shell, admin share, user-writable, or service-control utility traits, as suspicious unless the exact host, service name, command, and alert time map to a validated change record or verified owner confirmation.
  Review matching service events with $investigate_0

- Do the installing account and service account explain this specific service creation?
  Focus: `event.code`, `user.name`, `user.domain`, `winlog.logon.id`, `winlog.event_data.ServiceAccount` for event `4697`, and `winlog.event_data.AccountName` for event `7045`.
  Implication: Event `4697` can identify the installing account and logon session and records the service account in `winlog.event_data.ServiceAccount`. Event `7045` records the service account in `winlog.event_data.AccountName`, but identifying the installer may require recovery of a matching Security event or surrounding service-control and process telemetry. Escalate if the recovered installer identity cannot be tied to the exact service install, if the service runs as a privileged or unexpected account, or if the account context conflicts with the claimed workflow. A benign branch requires recovered evidence that the same account created this same service during a validated maintenance or deployment window on this host. Missing Security or corroborating telemetry remains unresolved.
  Search recent service install events on the matched host with $investigate_1

- Does the live host still show the same service configuration and referenced artifact?
  Focus: On the matched `host.id` or `host.name`, retrieve the current service by exact `winlog.event_data.ServiceName` with `sc.exe qc`, `sc.exe queryex`, or `Get-CimInstance Win32_Service -Filter Name='<service name>'`; record the service path, account, status, and start context, then inspect the referenced executable or script on disk when it is still present.
  Implication: Live service configuration can confirm current path, account, status, and start context, but configuration alone does not prove the service command executed. Escalate when the current service or referenced artifact supports persistence, or when process telemetry, service-control logs, or other execution events show the service command ran. If live-host retrieval or artifact inspection is unavailable, the unavailable live-host evidence remains unresolved. A benign branch requires the live or recovered service state to match the exact expected service lifecycle, such as a short-lived remote support service removed after the named deployment task, without extra commands or altered paths.

- Are there corroborating process, file, registry, or authentication events on the same host around the service installation?
  Focus: `host.id`, `winlog.event_data.ServiceName`, `winlog.event_data.ServiceAccount` for event `4697`, `winlog.event_data.AccountName` for event `7045`, `user.name`, and `winlog.record_id`.
  Implication: Process, file, registry, and service-control telemetry are supporting sources and may be absent from the final alert; recover them manually by host and time before drawing conclusions. Escalate if recovered events show the service launching shell, LOLBin, credential-dumping, or user-writable path payloads. If those supporting sources are missing, keep the case unresolved instead of treating absence as benign.

- If local evidence is suspicious or unresolved, has the same service name appeared on other hosts?
  Focus: `winlog.event_data.ServiceName`, `host.name`, `winlog.event_data.ServiceFileName`, `winlog.event_data.ImagePath`, `user.name`.
  Implication: Use this only after the local service and artifact checks above. Reuse across hosts supports a lateral movement, remote administration, or shared deployment hypothesis; scope containment and account review to matching hosts when the service name or installer context is suspicious. A benign branch requires recovered events on the additional hosts to share the same deployment window, installing account when available, and exact service command for one validated change record. Absence of related alerts does not prove benign.
  Pivot on the service name across hosts with $investigate_2

Disposition: Escalate suspicious service commands, mismatched installer or service-account context, persistent live service state, or repeated hosts; close only when alert-local fields plus recovered service and host evidence prove the exact expected workflow; preserve and escalate mixed or incomplete cases for more context before final disposition.

### False positive analysis

- Remote administration and deployment tools such as PAExec, RemCom, and Winexe can create temporary services that match the suspicious service-name or command patterns. Close only when the recovered `winlog.event_data.ServiceName`, command field, installing account, target host, and timing all match one validated maintenance or deployment action.
- PowerShell, `pwsh.exe`, `cmd.exe`, `rundll32`, `regsvr32`, `msbuild`, `bitsadmin`, `certutil`, or `vssadmin` in a service command should remain suspicious until the referenced script or command content, service account, and owner confirmation explain the exact alert artifact on this host.
- Scope exceptions to durable alert fields. For event `4697`, use exact `winlog.event_data.ServiceName` and `winlog.event_data.ServiceFileName`; for event `7045`, use exact `winlog.event_data.ServiceName` and `winlog.event_data.ImagePath`. Add `host.id` or `host.name`, plus `user.name` and `user.domain`, when those fields repeat in the validated benign pattern.

### Response and remediation

- Collect and preserve case evidence, export the alert and matched service event, and preserve volatile process, memory, executable, script, service configuration, and file-system artifacts that could be lost before isolation, process termination, service removal, cleanup, or other disruptive action.
- Review recovered evidence and scope affected hosts/accounts by service name, service command, installing account, target host, and related authentication before containment decisions.
- If malicious service execution is confirmed, use the endpoint response integration as the preferred path to isolate affected hosts, and disable exposed accounts as reversible containment while retaining evidence. When direct response is unavailable, document handoff to the responsible incident-response or endpoint-operations owner for host isolation and to the identity owner for account containment.
- After scoping and preservation, stop malicious service processes if running, remove the malicious service or persistence entry, quarantine associated executable or script files, and run an antimalware scan.
- Reset or rotate credentials for accounts that installed, ran, or were accessed by the malicious service after credential exposure review.
- Record confirmed service names, commands, recovered file hashes, installing accounts, affected hosts, and telemetry or detection gaps for responsible detection and logging owners after scoping and containment.
"""
[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "host.name",
    "event.code",
    "winlog.event_data.ServiceName",
    "winlog.event_data.ServiceFileName",
    "winlog.event_data.ImagePath",
    "winlog.event_data.ServiceAccount",
    "winlog.event_data.AccountName",
    "winlog.event_data.ServiceStartType",
    "winlog.event_data.StartType",
    "user.id",
    "user.name",
    "user.domain",
]


[[transform.investigate]]
label = "Matched service on host"
description = ""
providers = [
    [
        { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
        { excluded = false, field = "winlog.event_data.ServiceName", queryType = "phrase", value = "{{winlog.event_data.ServiceName}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    ],
    [
        { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
        { excluded = false, field = "winlog.event_data.ServiceName", queryType = "phrase", value = "{{winlog.event_data.ServiceName}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "7045", valueType = "string" },
    ],
]
relativeFrom = "now-24h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Recent service installs on host"
description = ""
providers = [
    [
        { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    ],
    [
        { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "7045", valueType = "string" },
    ],
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Same service name across hosts"
description = ""
providers = [
    [
        { excluded = false, field = "winlog.event_data.ServiceName", queryType = "phrase", value = "{{winlog.event_data.ServiceName}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "4697", valueType = "string" },
    ],
    [
        { excluded = false, field = "winlog.event_data.ServiceName", queryType = "phrase", value = "{{winlog.event_data.ServiceName}}", valueType = "string" },
        { excluded = false, field = "event.code", queryType = "phrase", value = "7045", valueType = "string" },
    ],
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[rule.threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"



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

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

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

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

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

Stages and Predicates

Stage 1: any

any where host.os.type == "windows" and
(
  (
    event.code : "4697" and
    (
      (
        (
          winlog.event_data.ServiceFileName : (
            "*COMSPEC*", "*\\127.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*cmd.exe*",
            "*echo*", "*RemComSvc*", "*.bat*", "*.cmd*", "*certutil*", "*vssadmin*", "*certmgr*", "*bitsadmin*",
            "*\\Users\\*", "*\\Windows\\Tasks\\*", "*\\PerfLogs\\*", "*\\Windows\\Debug\\*",
            "*regsvr32*", "*msbuild*", "*winexesvc.exe*", "*DumpSvc.exe*", "*pwsh.exe*", "*PAExec*"
          ) or
          winlog.event_data.ServiceFileName regex~ """%systemroot%\\[a-z0-9]+\.exe"""
        ) and
        not winlog.event_data.ServiceFileName: (
              "%SystemRoot%\\PSEXESVC.exe", "%SystemRoot%\\\\RemComSvc.exe",
              "%SystemRoot%\\pbpsdeploy.exe", "%SystemRoot%\\system32\\RemComSvc.exe",
              "\"C:\\Program Files\\Common Files\\Zoom\\Support\\CptService.exe*",
              "\"C:\\Program Files\\Common Files\\ZoomVDIPluginManagement\\Support\\CptService.exe*",
              "\"C:\\Program Files (x86)\\CheckPoint\\Endpoint Security\\EFR\\host\\cpsechost.exe\" service"
        )
      ) or
      winlog.event_data.ServiceName : (
         "mssecsvc2.0", "WCESERVICE*", "WCE SERVICE*", "pwdump*", "gsecdump*", "cachedump*"
      )
    )
  ) or
  (
    event.code : "7045" and
    (
      (
        winlog.event_data.ImagePath : (
          "*COMSPEC*", "*\\127.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*cmd.exe*",
          "*echo*", "*.bat*", "*.cmd*", "*certutil*", "*vssadmin*", "*certmgr*", "*bitsadmin*",
          "*\\Users\\*", "*\\Windows\\Tasks\\*", "*\\PerfLogs\\*", "*\\Windows\\Debug\\*",
          "*regsvr32*", "*msbuild*", "*winexesvc.exe*", "*DumpSvc.exe*", "*pwsh.exe*", "*PAExec*"
        ) and
        not winlog.event_data.ImagePath : (
              "%SystemRoot%\\PSEXESVC.exe", "%SystemRoot%\\\\RemComSvc.exe",
              "%SystemRoot%\\pbpsdeploy.exe", "%SystemRoot%\\system32\\RemComSvc.exe",
              "\"C:\\Program Files\\Common Files\\Zoom\\Support\\CptService.exe*",
              "\"C:\\Program Files\\Common Files\\ZoomVDIPluginManagement\\Support\\CptService.exe*",
              "\"C:\\Program Files (x86)\\CheckPoint\\Endpoint Security\\EFR\\host\\cpsechost.exe\" service"
        )
      ) or
      winlog.event_data.ServiceName : (
         "mssecsvc2.0", "WCESERVICE*", "WCE SERVICE*", "pwdump*", "gsecdump*", "cachedump*"
      )
    )
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.codewildcard
  • 4697 corpus 3 (splunk 2, elastic 1)
  • 7045 corpus 19 (splunk 18, elastic 1)
field:"EventID" kind:wildcard
winlog.event_data.ImagePathwildcard
  • *.bat*
  • *.cmd*
  • *Admin$* corpus 2 (sigma 1, elastic 1)
  • *COMSPEC*
  • *DumpSvc.exe*
  • *PAExec*
  • *\127.0.0.1*
  • *\PerfLogs\*
  • *\Users\*
  • *\Windows\Debug\*
  • *\Windows\Tasks\*
  • *bitsadmin*
  • *certmgr*
  • *certutil*
  • *cmd.exe*
  • *echo*
  • *msbuild*
  • *powershell*
  • *pwsh.exe*
  • *regsvr32*
  • *rundll32*
  • *vssadmin*
  • *winexesvc.exe*
field:"ImagePath" kind:wildcard
winlog.event_data.ServiceFileNameregex_match
  • %systemroot%\[a-z0-9]+.exe
field:"ServiceFileName" kind:regex_match value:"%systemroot%\[a-z0-9]+.exe"
winlog.event_data.ServiceFileNamewildcard
  • *.bat*
  • *.cmd*
  • *Admin$* corpus 2 (sigma 1, elastic 1)
  • *COMSPEC*
  • *DumpSvc.exe*
  • *PAExec*
  • *RemComSvc*
  • *\127.0.0.1*
  • *\PerfLogs\*
  • *\Users\*
  • *\Windows\Debug\*
  • *\Windows\Tasks\*
  • *bitsadmin*
  • *certmgr*
  • *certutil*
  • *cmd.exe*
  • *echo*
  • *msbuild*
  • *powershell*
  • *pwsh.exe*
  • *regsvr32*
  • *rundll32*
  • *vssadmin*
  • *winexesvc.exe*
field:"ServiceFileName" kind:wildcard
winlog.event_data.ServiceNamewildcard
  • WCE SERVICE*
  • WCESERVICE*
  • cachedump*
  • gsecdump*
  • mssecsvc2.0
  • pwdump*
field:"ServiceName" kind:wildcard

Suspicious Stop of TCCD via Launchctl

#
Source
github.com/elastic/protections-artifacts

Detects the abnormal stop of the TCC daemon via the launchctl system binary. This activity can indicate an attempt to restart the TCC daemon following an exploit and may indicate a threat actors attempt to bypass security controls, escalate privileges, evade defenses.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Detects the abnormal stop of the TCC daemon via the launchctl system binary. This activity can indicate an attempt to
restart the TCC daemon following an exploit and may indicate a threat actors attempt to bypass security controls,
escalate privileges, evade defenses.
"""
id = "ffda6af2-fa65-4ef6-88a4-318b396844fe"
license = "Elastic License v2"
name = "Suspicious Stop of TCCD via Launchctl"
os_list = ["macos"]
version = "1.0.15"

query = '''
process where event.type == "start" and 
    (
        (
            process.name == "launchctl" and
            process.args like~ "stop" and
            process.args like~ "com.apple.tccd"
        ) or 
        (
            (process.name in ("sh", "zsh", "bash", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
            process.args == "-c" and
            process.args like~ "*com.apple.tccd"
        )
    ) and not 
process.parent.executable in ("/sbin/launchd",
                              "/usr/local/jamf/bin/jamf", 
                              "/usr/bin/sudo") and not 
process.Ext.effective_parent.executable in ("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
                                            "/usr/local/jamf/bin/jamf", 
                                            "/Applications/iTerm.app/Contents/MacOS/iTerm2")
'''

min_endpoint_version = "8.5.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 = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"


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

[internal]
min_endpoint_version = "8.5.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and 
    (
        (
            process.name == "launchctl" and
            process.args like~ "stop" and
            process.args like~ "com.apple.tccd"
        ) or 
        (
            (process.name in ("sh", "zsh", "bash", "dash", "csh", "tcsh", "ksh", "tclsh", "fish") or process.name like "tclsh*") and
            process.args == "-c" and
            process.args like~ "*com.apple.tccd"
        )
    ) and not 
process.parent.executable in ("/sbin/launchd",
                              "/usr/local/jamf/bin/jamf", 
                              "/usr/bin/sudo") and not 
process.Ext.effective_parent.executable in ("/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
                                            "/usr/local/jamf/bin/jamf", 
                                            "/Applications/iTerm.app/Contents/MacOS/iTerm2")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Suspicious Windows Server Update Service Child Process

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious child processes spawned from the Windows Server Update Service. This may indicate successful exploitation and execution via CVE-2025-59287.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[rule]
description = """
Identifies suspicious child processes spawned from the Windows Server Update Service. This may indicate successful
exploitation and execution via CVE-2025-59287.
"""
id = "b2768980-3858-4bc7-a08e-c9bd9d6bb314"
license = "Elastic License v2"
name = "Suspicious Windows Server Update Service Child Process"
os_list = ["windows"]
reference = [
    "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-59287",
    "https://hawktrace.com/blog/CVE-2025-59287",
]
version = "1.0.1"

query = '''
process where event.type == "start" and
 (
  (process.parent.name : "w3wp.exe" and process.parent.args : "WsusPool") or
  process.parent.name : "WsusService.exe" or
  descendant of [process where event.action == "start" and process.name : "WsusService.exe"] or
  descendant of [process where event.action == "start" and process.name : "w3wp.exe" and process.args : "WsusPool"]
  ) and
  not process.executable : ("C:\\Windows\\System32\\conhost.exe",
                            "C:\\Windows\\system32\\WerFault.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\cvtres.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\csc.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\vbc.exe")
'''

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

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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and
 (
  (process.parent.name : "w3wp.exe" and process.parent.args : "WsusPool") or
  process.parent.name : "WsusService.exe" or
  descendant of [process where event.action == "start" and process.name : "WsusService.exe"] or
  descendant of [process where event.action == "start" and process.name : "w3wp.exe" and process.args : "WsusPool"]
  ) and
  not process.executable : ("C:\\Windows\\System32\\conhost.exe",
                            "C:\\Windows\\system32\\WerFault.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\cvtres.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\csc.exe",
                            "C:\\Windows\\Microsoft.NET\\Framework64\\*\\vbc.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.parent.argswildcard
  • WsusPool corpus 2 (elastic 2)
field:"process.parent.args" kind:wildcard value:"WsusPool"
process.parent.namewildcard
  • WsusService.exe corpus 3 (elastic 2, splunk 1)
  • w3wp.exe corpus 8 (elastic 8)
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcardC:\Windows\System32\conhost.exe, C:\Windows\system32\WerFault.exe, C:\Windows\Microsoft.NET\Framework64\*\cvtres.exe, C:\Windows\Microsoft.NET\Framework64\*\csc.exe, C:\Windows\Microsoft.NET\Framework64\*\vbc.exeexcludes:process.executable

Unusual Process Spawned by a Parent Process

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

A machine learning job has detected a suspicious Windows process. This process has been classified as malicious in two ways. It was predicted to be malicious by the ProblemChild supervised ML model, and it was found to be an unusual child process name, for the parent process, by an unsupervised ML model. Such a process may be an instance of suspicious or malicious activity, possibly involving LOLbins, that may be resistant to detection using conventional search rules.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has detected a suspicious Windows process. This process has been classified as malicious in two
ways. It was predicted to be malicious by the ProblemChild supervised ML model, and it was found to be an unusual child
process name, for the parent process, by an unsupervised ML model. Such a process may be an instance of suspicious or
malicious activity, possibly involving LOLbins, that may be resistant to detection using conventional search rules.
"""
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "problem_child_rare_process_by_parent_ea"
name = "Unusual Process Spawned by a Parent Process"
note = """## Triage and analysis

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

### Investigating Unusual Process Spawned by a Parent Process

In Windows environments, processes are often spawned by parent processes to perform legitimate tasks. However, adversaries can exploit this by using legitimate tools, known as LOLbins, to execute malicious activities stealthily. The detection rule leverages machine learning to identify anomalies in process creation patterns, flagging processes that deviate from typical behavior, thus uncovering potential threats that evade traditional detection methods.

### Possible investigation steps

- Review the parent process and child process names to determine if they are known legitimate applications or if they are commonly associated with LOLbins or other malicious activities.
- Check the process creation time and correlate it with any known user activity or scheduled tasks to identify if the process execution aligns with expected behavior.
- Investigate the command line arguments used by the suspicious process to identify any unusual or potentially malicious commands or scripts being executed.
- Analyze the network activity associated with the process to detect any suspicious outbound connections or data exfiltration attempts.
- Examine the file path and hash of the executable to verify its legitimacy and check against known malware databases or threat intelligence sources.
- Review any recent changes to the system, such as software installations or updates, that might explain the unusual process behavior.
- Consult endpoint detection and response (EDR) logs or other security tools to gather additional context and evidence related to the process and its activities.

### False positive analysis

- Legitimate administrative tools like PowerShell or command prompt may be flagged when used for routine tasks. Users can create exceptions for these tools when executed by known and trusted parent processes.
- Software updates or installations often spawn processes that might appear unusual. Exclude these processes by identifying their typical parent-child relationships during updates.
- Custom scripts or automation tools used within the organization might trigger alerts. Document these scripts and their expected behavior to create exceptions for them.
- Frequent use of remote management tools can lead to false positives. Ensure these tools are whitelisted when used by authorized personnel.
- Regularly review and update the list of exceptions to accommodate changes in legitimate process behaviors over time.

### Response and remediation

- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate the suspicious process identified by the alert to stop any ongoing malicious actions.
- Conduct a thorough analysis of the process and its parent to understand the scope of the compromise and identify any additional malicious activities or files.
- Remove any malicious files or artifacts associated with the process from the system to ensure complete remediation.
- Restore the system from a known good backup if the integrity of the system is compromised beyond repair.
- Update and patch the system to close any vulnerabilities that may have been exploited by the adversary.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/problemchild",
    "https://www.elastic.co/security-labs/detecting-living-off-the-land-attacks-with-new-elastic-integration",
]
risk_score = 21
rule_id = "ea09ff26-3902-4c53-bb8e-24b7a5d029dd"
setup = """## Setup

The rule requires the Living off the Land (LotL) Attack Detection integration assets to be installed, as well as Windows process events collected by integrations such as Elastic Defend or Winlogbeat.

### LotL Attack Detection Setup
The LotL Attack Detection integration detects living-off-the-land activity in Windows process events.

#### Prerequisite Requirements:
- Fleet is required for LotL Attack Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Windows process events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) integration or Winlogbeat(https://www.elastic.co/guide/en/beats/winlogbeat/current/_winlogbeat_overview.html).
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
- To set up and run Winlogbeat, follow [this](https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-installation-configuration.html) guide.

#### The following steps should be executed to install assets associated with the LotL Attack Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Living off the Land Attack Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Use Case: Living off the Land Attack Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"

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

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

User Keychain DB Access by Osascript

#
Source
github.com/elastic/protections-artifacts

Detects when OsaScript attempts to open the user's Keychain DB. This activity is not normal and should be considered suspicious. The macOS keychain is highly sought after and targeted by threat actors as it contains sensitive credential data that can be used to further compromise a user or environment.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when OsaScript attempts to open the user's Keychain DB. This activity is not normal and should be considered
suspicious. The macOS keychain is highly sought after and targeted by threat actors as it contains sensitive credential
data that can be used to further compromise a user or environment.
"""
id = "e89a6e10-7568-4b02-807c-596d51b65fbc"
license = "Elastic License v2"
name = "User Keychain DB Access by Osascript"
os_list = ["macos"]
reference = ["https://github.com/MythicAgents/apfell"]
version = "1.0.10"

query = '''
file where event.action == "open" and 
 file.name like "login.keychain-db" and 
 process.name == "osascript"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"



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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: file

file where event.action == "open" and 
 file.name like "login.keychain-db" and 
 process.name == "osascript"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
file.namewildcard
  • login.keychain-db corpus 5 (elastic 5)
field:"file.name" kind:wildcard value:"login.keychain-db"
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"

WPS Office Exploit via DLL Hijack

#
Source
github.com/elastic/protections-artifacts

Identifies the load of a remote library by the WPS Office promecefpluginhost.exe executable. This may indicate the successful exploitation of CVE-2024-7262 or CVE-2024-7263 via DLL hijack.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the load of a remote library by the WPS Office promecefpluginhost.exe executable. This may indicate the
successful exploitation of CVE-2024-7262 or CVE-2024-7263 via DLL hijack.
"""
id = "ad9f49b7-08f3-4929-b9b1-3ff2c1a3afa3"
license = "Elastic License v2"
name = "WPS Office Exploit via DLL Hijack"
os_list = ["windows"]
reference = [
    "https://www.welivesecurity.com/en/eset-research/analysis-of-two-arbitrary-code-execution-vulnerabilities-affecting-wps-office/",
    "https://mp.weixin.qq.com/s/F8hNyESBdKhwXkQPgtGpew",
]
version = "1.0.3"

query = '''
library where process.name : "promecefpluginhost.exe" and
  dll.path : "?:\\Users\\*\\AppData\\Local\\Temp\\wps\\INetCache\\*"
'''

min_endpoint_version = "8.0.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 = "T1189"
name = "Drive-by Compromise"
reference = "https://attack.mitre.org/techniques/T1189/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"


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

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

Stage 1: library

library where process.name : "promecefpluginhost.exe" and
  dll.path : "?:\\Users\\*\\AppData\\Local\\Temp\\wps\\INetCache\\*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.pathwildcard
  • ?:\Users\*\AppData\Local\Temp\wps\INetCache\* corpus 2 (elastic 2)
field:"ImageLoaded" kind:wildcard value:"?:\Users\*\AppData\Local\Temp\wps\INetCache\*"
process.namewildcard
  • promecefpluginhost.exe corpus 2 (elastic 2)
field:"process_basename" kind:wildcard value:"promecefpluginhost.exe"

Back to all Elastic rules