Detection rules › Elastic

Elastic rules: 3c

AWS Management Console Brute Force of Root User Identity

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

Identifies a high number of failed authentication attempts to the AWS management console for the Root user identity. An adversary may attempt to brute force the password for the Root user identity, as it has complete access to all services and resources for the AWS account.

Known False Positives

  • Automated processes that attempt to authenticate using expired credentials and unbounded retries may lead to false positives.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2020/07/21"
integration = ["aws"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies a high number of failed authentication attempts to the AWS management console for the Root user identity. An
adversary may attempt to brute force the password for the Root user identity, as it has complete access to all services
and resources for the AWS account.
"""
false_positives = [
    """
    Automated processes that attempt to authenticate using expired credentials and unbounded retries may lead to false
    positives.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Management Console Brute Force of Root User Identity"
note = """## Triage and analysis

### Investigating AWS Management Console Brute Force of Root User Identity

The AWS Management Console provides a web interface for managing AWS resources. Because the root user has unrestricted privileges, repeated failed console login attempts targeting this identity represent a high-risk credential access event. Even if no login succeeded, this activity may indicate reconnaissance, password spraying, or credential stuffing attempts targeting the root user.

This rule uses a threshold rule that detects a high number of failed `ConsoleLogin` events (`event.outcom: failure` with `userIdentity.type: Root`) within a short timeframe from the same IP address or user agent.  
Threshold rules only summarize grouped field values, so analysts must use timeline to review the actual events that triggered the alert.

#### Possible investigation steps

- **Review in Timeline.**  
  Open the alert and *Investigate in timeline* to view the individual CloudTrail events contributing to the threshold alert. Review:  
  - `source.ip`, `user_agent.original`, `geo fields` and `@timestamp` for each failure.  
  - Look for patterns such as distributed sources or repeated retries at consistent intervals.  
  - Look for any corresponding successful `ConsoleLogin` events around the same timeframe from the same IP or agent.

- **Assess IP reputation and geolocation.**  
  Use IP intelligence tools to evaluate whether the source addresses belong to known cloud providers, TOR nodes, or foreign regions outside your normal operations.  
  - Correlate against `cloud.region` and `geo fields` and compare with expected login locations for your organization.

- **Check for related activity.**  
  Review CloudTrail for other API calls from the same source IP (for example, `GetSessionToken`, `AssumeRole`, or `ListUsers`) that may indicate scripted credential testing or discovery.

- **Correlate with GuardDuty findings.**  
  GuardDuty may raise complementary findings for anomalous console login behavior or brute force attempts. Review recent GuardDuty and AWS Config alerts for the same timeframe.

- **Determine business context.**  
  Confirm whether the source IPs are internal (for example, corporate VPN, IT admin network) or part of legitimate red-team or third-party testing. If uncertain, treat as suspicious.

### False positive analysis

- **Forgotten or mistyped credentials.**  
  Repeated failed logins from known internal IPs could indicate a legitimate user typing errors. Validate by checking if a successful root login followed soon after.  
- **Automation or scanners.**  
  Misconfigured monitoring tools or old browser sessions attempting to reuse cached credentials may trigger this rule.  
- **Planned penetration testing.**  
  Red-team or security testing activities can generate deliberate brute force attempts. Verify via ticketing or testing schedules.

### Response and remediation

> The AWS Incident Response Playbooks classify root login attempts as Priority-1 credential compromise events.  
> Follow these steps whether or not your organization has a formal IR team.

**Immediate containment**
- **Check for success.**  
  After pivoting to Timeline, confirm whether any `ConsoleLogin` events from the same IP or user agent show `event.oucome: success`.  
  - If a successful login occurred, immediately follow the *AWS Management Console Root Login* rule investigation guide.  
- **Rotate the root password.**  
  Use AWS’s password reset function to set a strong, unique password stored in an offline vault.  
- **Enable or verify Multi-Factor Authentication (MFA)** on the root account. If MFA was already configured, review the device registration for changes or suspicious resets.  
- **Block offending IPs or networks.**  
  Use AWS WAF, VPC network ACLs, or Security Groups to temporarily block the IPs used in the failed attempts.  
- **Alert internal teams.**  
  Notify your security operations or cloud governance teams of the brute force pattern and actions taken.

**Evidence preservation**
- Export all failed `ConsoleLogin` events visible in Timeline (±30 minutes around the alert window) to a restricted evidence bucket.  
- Preserve GuardDuty findings, AWS Config history, and CloudTrail logs for the same timeframe for further analysis.

**Scoping and investigation**
- Query CloudTrail across other AWS accounts and regions for additional failed or successful `ConsoleLogin` events from the same IPs.  
- Check IAM activity for simultaneous key creation, role modifications, or new users — signs of lateral or parallel intrusion attempts.  
- Review network telemetry (VPC Flow Logs, CloudFront, WAF) to determine whether the activity originated from a distributed or scripted attack pattern.

**Recovery and hardening**
- Confirm MFA is enabled and enforced on the root account.  
- Remove any root access keys (none should exist under normal security posture).  
- Enable organization-wide CloudTrail, GuardDuty, and Security Hub across all regions.  
- Set up real-time alerts for any future `ConsoleLogin` failures from the root user exceeding expected baselines.  
- Store root credentials offline with dual-custody and document controlled access procedures.

### Additional information

- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/tree/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks):** See “Credential Compromise” and “Account Compromise” for investigation, containment, and escalation guidance.  
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs):** Reference runbooks for failed-login response, evidence preservation, and MFA enforcement.  
- **AWS Documentation:** [Tasks that require the root user](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root).  
- **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/IAM/latest/UserGuide/id_root-user.html"]
risk_score = 73
rule_id = "4d50a94f-2844-43fa-8395-6afbd5e1c5ef"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS Sign-In",
    "Use Case: Identity and Access Audit",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "threshold"

query = '''
data_stream.dataset:aws.cloudtrail and 
event.provider:signin.amazonaws.com and 
event.action:ConsoleLogin and 
aws.cloudtrail.user_identity.type:Root and 
event.outcome:failure
'''

[rule.investigation_fields]
field_names = [
    "cloud.account.id",
]

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

[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"

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

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[rule.threshold]
field = ["cloud.account.id"]
value = 10

Stages and Predicates

Stage 1: query

data_stream.dataset:aws.cloudtrail and 
event.provider:signin.amazonaws.com and 
event.action:ConsoleLogin and 
aws.cloudtrail.user_identity.type:Root and 
event.outcome:failure
Threshold
gte 10

Indicators

These rows show field, operator, and value matches.

Azure Compute Restore Point Collection Deleted by Unusual User

#
Status
production
Severity
medium
Time window
9m
Group by
azure.activitylogs.identity.claims_initiated_by_user.name, azure.resource.group
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the deletion of Azure Restore Point Collections by a user who has not previously performed this activity. Restore Point Collections contain recovery points for virtual machines, enabling point-in-time recovery capabilities. Adversaries may delete these collections to prevent recovery during ransomware attacks or to cover their tracks during malicious operations.

Known False Positives

  • Restore Point Collection deletions may be performed by system administrators during routine cleanup or decommissioning activities. Verify whether the user and resource should be performing these operations. Deletions from unfamiliar users or targeting critical resources should be investigated. If known behavior is causing false positives, it can be exempted from the rule.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/10/13"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies the deletion of Azure Restore Point Collections by a user who has not previously performed this activity.
Restore Point Collections contain recovery points for virtual machines, enabling point-in-time recovery capabilities.
Adversaries may delete these collections to prevent recovery during ransomware attacks or to cover their tracks during
malicious operations.
"""
false_positives = [
    """
    Restore Point Collection deletions may be performed by system administrators during routine cleanup or
    decommissioning activities. Verify whether the user and resource should be performing these operations. Deletions
    from unfamiliar users or targeting critical resources 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 Compute Restore Point Collection Deleted by Unusual User"
note = """## Triage and analysis

### Investigating Azure Compute Restore Point Collection Deleted by Unusual User

Azure Compute Restore Point Collections are critical components for disaster recovery, containing snapshots that enable point-in-time
recovery of virtual machines. Deletion of these collections can severely impact an organization's ability to recover from
incidents, making them attractive targets for adversaries conducting ransomware attacks or attempting to cover their tracks.

This rule detects when a user who has not previously deleted Restore Point Collections performs this operation, which may
indicate unauthorized activity or a compromised account.

### Possible investigation steps

- Review the `azure.activitylogs.identity.claims_initiated_by_user.name` field to identify the specific user who performed the deletion operation.
- Investigate the `azure.resource.id` or `azure.resource.name` fields to identify which Restore Point Collection was deleted and assess its criticality to business operations.
- Review the timeline of the deletion event and correlate it with other security events or user activities to identify any suspicious patterns or related activities.
- Verify whether the user account has legitimate access to perform this operation and whether this deletion was authorized through change management processes.
- Check for any other unusual activities by the same user account around the time of the deletion, such as privilege escalation attempts or access to other sensitive resources.
- Investigate whether there are any active alerts or indicators of compromise related to ransomware activity in the environment.

### False positive analysis

- Routine administrative activities by infrastructure teams may trigger this alert when team members rotate or new administrators are onboarded. Create exceptions for known administrative accounts after verification.
- Automated cleanup scripts or Azure policies that periodically remove old restore points may cause alerts. Identify and exclude service accounts used for these automated operations.
- Planned decommissioning activities or migration projects may involve legitimate deletion of restore point collections. Document these activities and create temporary exceptions during known maintenance windows.
- Testing and development environments may see frequent creation and deletion of resources. Consider excluding these environments from monitoring or adjusting the rule to focus on production resources only.

### Response and remediation

- Immediately verify the legitimacy of the deletion operation with the user or their manager. If the activity is unauthorized, proceed with incident response procedures.
- If unauthorized deletion is confirmed, immediately isolate the affected user account to prevent further malicious activity. Reset credentials and review account permissions.
- Check if the deleted Restore Point Collection can be recovered through Azure backup services or other recovery mechanisms.
- Review and audit all recent activities performed by the affected user account to identify other potentially malicious actions.
- Assess the impact on disaster recovery capabilities and inform relevant stakeholders about potential recovery limitations.
- Review access controls and permissions for Restore Point Collection management, implementing principle of least privilege where necessary.
- If ransomware activity is suspected, escalate to the security incident response team and implement broader containment measures, including checking for other indicators of ransomware such as deletion of Recovery Services vaults or backup fabric containers.
- Document the incident and update detection rules or procedures based on lessons learned.
"""
references = [
    "https://www.microsoft.com/en-us/security/blog/2023/07/25/storm-0501-ransomware-attacks-expanding-to-hybrid-cloud-environments/",
]
risk_score = 47
rule_id = "c1a3e2f0-8a1b-11ef-9b4a-f661ea17fbce"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Storage",
    "Data Source: Azure",
    "Data Source: Azure Activity Logs",
    "Use Case: Threat Detection",
    "Tactic: Impact",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: azure.activitylogs and
    event.action: "MICROSOFT.COMPUTE/RESTOREPOINTCOLLECTIONS/DELETE" and
    event.outcome: (Success or success)
'''


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


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

[rule.new_terms]
field = "new_terms_fields"
value = ["azure.activitylogs.identity.claims_initiated_by_user.name", "azure.resource.group"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: azure.activitylogs and
    event.action: "MICROSOFT.COMPUTE/RESTOREPOINTCOLLECTIONS/DELETE" and
    event.outcome: (Success or success)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • azure.activitylogs corpus 38 (elastic 38)
field:"data_stream.dataset" kind:eq value:"azure.activitylogs"
event.actioneq
  • MICROSOFT.COMPUTE/RESTOREPOINTCOLLECTIONS/DELETE corpus 2 (elastic 2)
field:"EventType" kind:eq value:"MICROSOFT.COMPUTE/RESTOREPOINTCOLLECTIONS/DELETE"
event.outcomein
  • Success corpus 306 (elastic 306)
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:in

Azure Storage Account Deletion by Unusual User

#
Status
production
Severity
medium
Time window
9m
Group by
azure.activitylogs.identity.claims_initiated_by_user.name
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies when an Azure Storage Account is deleted. Adversaries may delete storage accounts to disrupt operations, destroy evidence, or cause denial of service. This activity could indicate an attacker attempting to cover their tracks after data exfiltration or as part of a destructive attack. Monitoring storage account deletions is critical for detecting potential impact on business operations and data availability.

Known False Positives

  • Storage administrators may legitimately delete storage accounts during decommissioning, resource cleanup, or infrastructure optimization. Verify that the deletion was expected and follows organizational change management processes. Consider exceptions for approved maintenance windows.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when an Azure Storage Account is deleted. Adversaries may delete storage accounts to disrupt operations,
destroy evidence, or cause denial of service. This activity could indicate an attacker attempting to cover their tracks
after data exfiltration or as part of a destructive attack. Monitoring storage account deletions is critical for
detecting potential impact on business operations and data availability.
"""
false_positives = [
    """
    Storage administrators may legitimately delete storage accounts during decommissioning, resource cleanup, or
    infrastructure optimization. Verify that the deletion was expected and follows organizational change management
    processes. Consider exceptions for approved maintenance windows.
    """,
]
from = "now-9m"
index = ["logs-azure.activitylogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure Storage Account Deletion by Unusual User"
note = """## Triage and analysis

### Investigating Azure Storage Account Deletion by Unusual User

Azure Storage Accounts provide scalable cloud storage for applications and services. Deletion of storage accounts is a high-impact operation that permanently removes all contained data including blobs, files, queues, and tables. Adversaries may delete storage accounts to destroy evidence of their activities, disrupt business operations, or cause denial of service as part of ransomware or destructive attacks. This detection monitors for successful storage account deletion operations to identify potential malicious activity.

### Possible investigation steps

- Review the Azure activity logs to identify the user or service principal that initiated the storage account deletion by examining the principal ID, UPN and user agent fields.
- Check the specific storage account name in `azure.resource.name` to understand which storage resources were deleted and assess the business impact.
- Investigate the timing of the event to correlate with any other suspicious activities, such as unusual login patterns, privilege escalation attempts, or other resource deletions.
- Examine the user's recent activity history to identify any other storage accounts or Azure resources that were deleted or modified by the same principal.
- Verify if the storage account deletion aligns with approved change requests or maintenance windows in your organization.
- Check if the deleted storage account contained critical data and whether backups are available for recovery.
- Review any related alerts or activities such as data exfiltration, configuration changes, or access policy modifications that occurred before the deletion.
- Investigate if the account was recently compromised by checking for suspicious authentication events or privilege escalations.

### False positive analysis

- Legitimate decommissioning of unused storage accounts may trigger this alert. Document approved storage account cleanup activities and coordinate with infrastructure teams to understand planned deletions.
- DevOps automation tools might delete temporary storage accounts as part of infrastructure lifecycle management. Identify service principals used by CI/CD pipelines and consider creating exceptions for these automated processes.
- Testing and development environments may have frequent storage account creation and deletion cycles. Consider filtering out non-production storage accounts if appropriate for your environment.
- Cost optimization initiatives may involve deleting unused or redundant storage accounts. Coordinate with finance and infrastructure teams to understand planned resource optimization activities.

### Response and remediation

- Immediately investigate whether the deletion was authorized by verifying with the account owner or relevant stakeholders.
- If the deletion was unauthorized, attempt to recover the storage account if soft-delete is enabled, or restore data from backups.
- Disable the compromised user account or service principal if unauthorized activity is confirmed and investigate how the credentials were obtained.
- Review and restrict Azure RBAC permissions to ensure only authorized users have storage account deletion capabilities (requires Contributor or Owner role).
- Implement Azure Resource Locks to prevent accidental or malicious deletion of critical storage accounts.
- Configure Azure Activity Log alerts to notify security teams immediately when storage accounts are deleted.
- Conduct a full security assessment to identify any other compromised resources or accounts and look for indicators of broader compromise.
- Document the incident and update security policies and procedures to prevent similar incidents in the future.
"""
references = [
    "https://www.microsoft.com/en-us/security/blog/2025/08/27/storm-0501s-evolving-techniques-lead-to-cloud-based-ransomware/"
]
risk_score = 47
rule_id = "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Storage",
    "Data Source: Azure",
    "Data Source: Azure Activity Logs",
    "Use Case: Threat Detection",
    "Tactic: Impact",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: azure.activitylogs and
    azure.activitylogs.operation_name: "MICROSOFT.STORAGE/STORAGEACCOUNTS/DELETE" and
    azure.activitylogs.identity.claims_initiated_by_user.name: *
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"

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


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

[rule.new_terms]
field = "new_terms_fields"
value = ["azure.activitylogs.identity.claims_initiated_by_user.name"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

Stages and Predicates

Stage 1: new_terms

data_stream.dataset: azure.activitylogs and
    azure.activitylogs.operation_name: "MICROSOFT.STORAGE/STORAGEACCOUNTS/DELETE" and
    azure.activitylogs.identity.claims_initiated_by_user.name: *

Indicators

These rows show field, operator, and value matches.

BCDEdit Safe Mode Command Execution

#
Source
github.com/elastic/protections-artifacts

Identifies when the command-line tool for managing Boot Configuration Data (BCDEdit.exe) is spawned from an untrusted process, office application, or script interpreter and used to specify a reboot into Safe Mode.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when the command-line tool for managing Boot Configuration Data (BCDEdit.exe) is spawned from an untrusted
process, office application, or script interpreter and used to specify a reboot into Safe Mode.
"""
id = "6d660b32-23bf-434b-a588-1cdc91224664"
license = "Elastic License v2"
name = "BCDEdit Safe Mode Command Execution"
os_list = ["windows"]
reference = [
    "https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/",
    "https://community.spiceworks.com/how_to/94471-how-to-reboot-into-safe-mode-at-a-command-prompt",
]
version = "1.0.32"

query = '''
process where event.action == "start" and
  (process.name : "bcdedit.exe" or process.pe.original_file_name : "bcdedit.exe") and
  process.args : ("minimal", "network", "safebootalternateshell") and
    descendant of
      [process where event.action == "start" and
        (process.code_signature.trusted != true or
         process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSACCESS.EXE", "MSPUB.EXE",
                         "OUTLOOK.EXE", "fltldr.exe", "cscript.exe", "powershell.exe", "pwsh.exe",
                         "wscript.exe", "cmd.exe", "rundll32.exe", "regsvr32.exe", "mshta.exe",
                         "msbuild.exe"))
      ]
'''

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

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

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



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

[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (process.name : "bcdedit.exe" or process.pe.original_file_name : "bcdedit.exe") and
  process.args : ("minimal", "network", "safebootalternateshell") and
    descendant of
      [process where event.action == "start" and
        (process.code_signature.trusted != true or
         process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSACCESS.EXE", "MSPUB.EXE",
                         "OUTLOOK.EXE", "fltldr.exe", "cscript.exe", "powershell.exe", "pwsh.exe",
                         "wscript.exe", "cmd.exe", "rundll32.exe", "regsvr32.exe", "mshta.exe",
                         "msbuild.exe"))
      ]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • minimal
  • network
  • safebootalternateshell
field:"process.args" kind:wildcard
process.namewildcard
  • bcdedit.exe corpus 9 (elastic 5, splunk 4)
field:"process_basename" kind:wildcard value:"bcdedit.exe"
process.pe.original_file_namewildcard
  • bcdedit.exe corpus 9 (elastic 7, sigma 2)
field:"OriginalFileName" kind:wildcard value:"bcdedit.exe"

Command Interpreter with IP Address Argument

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

This rule detects suspicious command interpreters that are executed with an IP address as an argument. This activity may indicate the use of a command interpreter to download additional payloads or tools from a remote server.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects suspicious command interpreters that are executed with an IP address as an argument. This activity may
indicate the use of a command interpreter to download additional payloads or tools from a remote server.
"""
id = "99c1bc0d-6d96-4e3c-b246-c23a65971455"
license = "Elastic License v2"
name = "Command Interpreter with IP Address Argument"
os_list = ["linux"]
version = "1.0.8"

query = '''
sequence by process.entity_id with maxspan=5s
  [process where event.type == "start" and event.action == "exec" and process.parent.executable like (
     "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
     "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
     "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
     "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
     "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
     "/bin/node", "/usr/bin/node", "/usr/local/bin/node"
   ) and
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c" and
   process.command_line like~ ("*curl*http*", "*wget*http*") and
   process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" and
   not process.command_line like~ ("*localhost*", "*127.0.0.1*")]
  [network where event.type == "start" and event.action == "connection_attempted" and process.name in ("curl", "wget") and
   not (destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
     destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
     "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
     "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
     "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
     "FF00::/8"
     )
   )]
'''

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

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

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

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

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



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


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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.parent.executable like (
     "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
     "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
     "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
     "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
     "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
     "/bin/node", "/usr/bin/node", "/usr/local/bin/node"
   ) and
   process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c" and
   process.command_line like~ ("*curl*http*", "*wget*http*") and
   process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" and
   not process.command_line like~ ("*localhost*", "*127.0.0.1*")]

Stage 2: network

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

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted
  • exec
field:"EventType" kind:eq
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • -c
field:"process.args" kind:eq value:"-c"
process.command_lineregex_match
  • .*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.*
field:"CommandLine" kind:regex_match value:".*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.*"
process.command_linewildcard
  • *curl*http*
  • *wget*http*
field:"CommandLine" kind:wildcard
process.namein
  • bash
  • csh
  • curl
  • dash
  • fish
  • ksh
  • sh
  • tcsh
  • wget
  • zsh
field:"process_basename" kind:in
process.parent.executablewildcard
  • /bin/lua*
  • /bin/node
  • /bin/perl*
  • /bin/php*
  • /bin/python*
  • /bin/ruby*
  • /usr/bin/lua*
  • /usr/bin/node
  • /usr/bin/perl*
  • /usr/bin/php*
  • /usr/bin/python*
  • /usr/bin/ruby*
  • /usr/local/bin/lua*
  • /usr/local/bin/node
  • /usr/local/bin/perl*
  • /usr/local/bin/php*
  • /usr/local/bin/python*
  • /usr/local/bin/ruby*
field:"ParentImage" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

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

Failed Access Attempt to Web Browser Files

#
Source
github.com/elastic/protections-artifacts

Identifies a failed access attempt to web browser's credential store data. Adversaries may steal credentials from web browsers by reading files specific to the target browser.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies a failed access attempt to web browser's credential store data. Adversaries may steal credentials from web
browsers by reading files specific to the target browser.
"""
id = "ebbb46d3-eb7f-4247-88fe-9bc5525443b3"
license = "Elastic License v2"
name = "Failed Access Attempt to Web Browser Files"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/globally-distributed-stealers",
    "https://www.elastic.co/security-labs/detect-credential-access",
]
version = "1.0.37"

query = '''
file where event.type == "access" and event.outcome == "failure" and process.pid != 4 and user.id != "S-1-5-18" and
    process.executable != null and process.thread.Ext.call_stack_summary != null and
    (
     file.name : ("logins.json", "cert?.db", "key?.db", "signons.sqlite", "cookies.sqlite") or 
     file.path : 
           ("?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Local State",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Local State", 
            "?:\\users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data", 
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data")
     ) and

    not (file.path : "?:\\Windows\\System32\\spool\\drivers\\x64\\*" and
         process.executable : "?:\\Windows\\System32\\PrintIsolationHost.exe") and
    not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and user.id : "S-1-5-18") and
    not (process.code_signature.subject_name : 
              ("Rapid7 LLC", "Mozilla Corporation", "Commvault Systems, Inc.", "Google LLC", "TPZ SOLUCOES DIGITAIS LTDA",
               "Bitdefender SRL", "Ivanti, Inc.", "McAfee, Inc.", "Fortinet Technologies*", "Zscaler, Inc.", "Bromium, Inc.", 
               "Duck Duck Go, Inc.", "Galactic Advisors, Inc.", "Kaspersky Lab JSC", "3Dconnexion SAM", "Opera Norway AS", 
               "Dashlane", "TeamDev Ltd.", "Mobatek", "Shift Technologies Inc.", "Nextron Systems GmbH",
               "Wavesor Software (Eightpoint Technologies Ltd. SEZC)", "Viber Media S.a r.l.", "Eric R. Zimmerman",
               "SAP SE", "Vivaldi Technologies AS", "ONELAUNCH TECHNOLOGIES INC.", "SentinelOne Inc.", "Brave Software, Inc.",
               "Overwolf Ltd", "YANDEX LLC", "Keeper Security Inc.", "Dashlane USA, Inc.", "Spotify AB", "Island Technology Inc.",
               "Zoom Video Communications, Inc.", "Emsisoft Ltd", "REVERSO S.A.S.", "Zoom Video Communications, Inc.",
               "TeamDev Ltd.", "TeamDev Management*", "Fabrice PARISOT", "Beijing Qihu Technology Co., Ltd.", "timeBro GmbH",
               "Lenovo", "7270356 Canada Inc.", "VS REVO GROUP OOD", "Jio Platforms Limited", "Zhuhai Kingsoft Office Software Co., Ltd.",
               "Adaware Software (7270356 CANADA INC.)", "Google Inc", "SweetLabs Inc", "Avast Software s.r.o.", "Athenahealth, Inc.",
               "Tencent Technology (Shenzhen) Company Limited", "AOMEI International Network Limited", "Lavasoft Software Canada Inc.",
               "memtime GmbH", "Grammarly, Inc.", "Sunstream Labs (Capital Intellect Inc.)", "Echo Infini Sdn. Bhd.", "Matrix42 AG",
               "Sunstream Labs (Capital Intellect Inc.)", "OneStart Technologies LLC", "Grammarly, Inc.", "Canva", "PERPLEXITY AI, INC.",
               "salesforce.com, inc.", "Matrix42 AG", "BlazerBrowser.com LLC", "BROWSERWORKS LTD", "Exclaimer Ltd", "BrowseAI LLC") and
         process.code_signature.trusted == true) and
    not (process.executable : "C:\\Users\\*\\AppData\\Local\\Microsoft\\BingSvc\\BingSvc.exe" and process.code_signature.trusted == true and
         process.code_signature.subject_name == "Microsoft Corporation") and
    not process.executable : ("?:\\Program Files (x86)\\*.exe",
                              "?:\\Program Files\\*.exe",
                              "?:\\Windows\\System32\\cleanmgr.exe",
                              "?:\\Windows\\System32\\cmimageworker.exe",
                              "?:\\Windows\\System32\\igfxext.exe",
                              "?:\\Windows\\SysWOW64\\SearchIndexer.exe",
                              "?:\\Windows\\SysWOW64\\msiexec.exe",
                              "?:\\Windows\\System32\\msiexec.exe",
                              "C:\\Windows\\System32\\RuntimeBroker.exe",
                              "C:\\Windows\\System32\\taskhostw.exe",
                              "C:\\Windows\\System32\\MoUsoCoreWorker.exe",
                              "\\Device\\Mup\\*",
                              "?:\\Windows\\explorer.exe",
                              "?:\\Windows\\CCM\\CcmExec.exe",
                              "?:\\Windows\\System32\\cmd.exe",
                              "?:\\Windows\\System32\\dllhost.exe",
                              "?:\\Windows\\System32\\svchost.exe",
                              "?:\\Windows\\System32\\Robocopy.exe",
                              "?:\\Windows\\System32\\SearchProtocolHost.exe",
                              "?:\\Users\\*e\\AppData\\Local\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
                              "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge SxS\\Application\\msedge.exe",
                              "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",
                              "?:\\Users\\*\\AppData\\Local\\Carbonate\\Carbonate\\Application\\Carbonate.exe",
                              "C:\\Windows\\UUS\\Packages\\Preview\\amd64\\MoUsoCoreWorker.exe") and
    not (user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and process.executable : "?:\\Windows\\System32\\svchost.exe") and
    not process.executable :
                ("?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\MsSense.exe",
                 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
                 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MpCopyAccelerator.exe") and
    not (process.name : "certutil.exe" and file.extension : "db") and 
    not file.path : "?:\\Users\\*\\AppData\\Local\\Temp\\GoogleChromePortable\\profile\\Default\\Login Data" and
    not process.thread.Ext.call_stack_summary :
                 ("ntdll.dll|kernelbase.dll|hmpalert.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                  "ntdll.dll|pghook.dll|kernelbase.dll|hmpalert.dll|pcpksp.dll|ncrypt.dll|crypt32.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
    not (process.name : "chrome.exe" and 
         file.path : ("?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA", 
                      "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PLAYWRIGHT_CHROMIUMDEV_PROFILE-*\\DEFAULT\\LOGIN DATA", 
                      "?:\\USERS\\*\\APPDATA\\LOCAL\\CHROMIUM\\USER DATA\\DEFAULT\\LOGIN DATA")) and
     not file.path : ("?:\\USERS\\*\\APPDATA\\ROAMING\\BURPSUITE\\PRE-WIRED-BROWSER\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\PGADMIN4\\USER DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\UNGOOGLED-CHROMIUM-PORTABLE\\DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA",
                   "?:\\Users\\*\\chrome-device\\Default\\Login Data",
                   "?:\\Users\\*\\EBWebView\\Default\\Login Data",
                   "?:\\Users\\*\\Favorites\\BOOKMARKS\\Default\\Login Data",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\ELROND\\MAIAR\\USER DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Default BackupDD\\Login Data",
                   "?:\\Users\\*\\Favorites\\bookmarks\\Default\\Login Data",
                   "?:\\users\\*\\mayanks\\JxBrowserData\\Default\\Login Data",
                   "?:\\Users\\*\\AppData\\Local\\pc_app_store\\User Data\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Melvor Idle\\User Data\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Streaming\\User Data\\Default\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\BETAFLIGHT-CONFIGURATOR\\USER DATA\\DEFAULT\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\LEADING\\USER DATA\\DEFAULT\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\CHROMIUM\\USER DATA\\DEFAULT\\*",
                   "?:\\Users\\*\\AppData\\Local\\Uniflash\\User Data\\Default\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\PGADMIN4\\USER DATA\\DEFAULT\\*",
                   "?:\\users\\*\\appdata\\local\\Market Axess\\Data\\*\\mayanks\\JxBrowserData\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Temp\\flutter_tools.*\\flutter_tools_chrome_device.*\\Default\\Login Data",
                   "?:\\Users\\*\\AppData\\Local\\*\\EBWebView\\Snapshots\\*\\Default\\Login Data",
                   "?:\\USERS\\*\\APPDATA\\ROAMING\\BURPSUITE\\PRE-WIRED-BROWSER\\SNAPSHOTS\\*\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\EBWEBVIEW\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\ALS_JXBROWSER_CONTEXT_*\\LOGIN DATA",
                   "?:\\ProgramData\\Microsoft\\Windows\\Containers\\BaseImages\\*\\BaseLayer\\Files\\Users\\WDAGUtilityAccount\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data") and
     not process.thread.Ext.call_stack_summary like
                             ("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|browsersettings.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|kernelbase.dll|shift.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|kernelbase.dll|msedge.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|rsaenh.dll|cryptsp.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|defaultpackoffer.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|appvisvsubsystems32.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|qipcap.dll|cmd.exe|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.dll|*",
                              "ntdll.dll|kernelbase.dll|procexp64.exe|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|mso30win32client.dll|mso20win32client.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscorlib.ni.dll|Unbacked|mscorlib.ni.dll|clr.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|appvisvsubsystems32.dll|kernelbase.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|filesyncsessions.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|fluencyds.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|dsadmin.dll|dsuiext.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|microsoft.sharepoint.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|spark-windows-desktop-ui.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|*")
'''

min_endpoint_version = "8.7.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 = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"

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


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



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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: file

file where event.type == "access" and event.outcome == "failure" and process.pid != 4 and user.id != "S-1-5-18" and
    process.executable != null and process.thread.Ext.call_stack_summary != null and
    (
     file.name : ("logins.json", "cert?.db", "key?.db", "signons.sqlite", "cookies.sqlite") or 
     file.path : 
           ("?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Local State",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Local State", 
            "?:\\users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data", 
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data")
     ) and

    not (file.path : "?:\\Windows\\System32\\spool\\drivers\\x64\\*" and
         process.executable : "?:\\Windows\\System32\\PrintIsolationHost.exe") and
    not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and user.id : "S-1-5-18") and
    not (process.code_signature.subject_name : 
              ("Rapid7 LLC", "Mozilla Corporation", "Commvault Systems, Inc.", "Google LLC", "TPZ SOLUCOES DIGITAIS LTDA",
               "Bitdefender SRL", "Ivanti, Inc.", "McAfee, Inc.", "Fortinet Technologies*", "Zscaler, Inc.", "Bromium, Inc.", 
               "Duck Duck Go, Inc.", "Galactic Advisors, Inc.", "Kaspersky Lab JSC", "3Dconnexion SAM", "Opera Norway AS", 
               "Dashlane", "TeamDev Ltd.", "Mobatek", "Shift Technologies Inc.", "Nextron Systems GmbH",
               "Wavesor Software (Eightpoint Technologies Ltd. SEZC)", "Viber Media S.a r.l.", "Eric R. Zimmerman",
               "SAP SE", "Vivaldi Technologies AS", "ONELAUNCH TECHNOLOGIES INC.", "SentinelOne Inc.", "Brave Software, Inc.",
               "Overwolf Ltd", "YANDEX LLC", "Keeper Security Inc.", "Dashlane USA, Inc.", "Spotify AB", "Island Technology Inc.",
               "Zoom Video Communications, Inc.", "Emsisoft Ltd", "REVERSO S.A.S.", "Zoom Video Communications, Inc.",
               "TeamDev Ltd.", "TeamDev Management*", "Fabrice PARISOT", "Beijing Qihu Technology Co., Ltd.", "timeBro GmbH",
               "Lenovo", "7270356 Canada Inc.", "VS REVO GROUP OOD", "Jio Platforms Limited", "Zhuhai Kingsoft Office Software Co., Ltd.",
               "Adaware Software (7270356 CANADA INC.)", "Google Inc", "SweetLabs Inc", "Avast Software s.r.o.", "Athenahealth, Inc.",
               "Tencent Technology (Shenzhen) Company Limited", "AOMEI International Network Limited", "Lavasoft Software Canada Inc.",
               "memtime GmbH", "Grammarly, Inc.", "Sunstream Labs (Capital Intellect Inc.)", "Echo Infini Sdn. Bhd.", "Matrix42 AG",
               "Sunstream Labs (Capital Intellect Inc.)", "OneStart Technologies LLC", "Grammarly, Inc.", "Canva", "PERPLEXITY AI, INC.",
               "salesforce.com, inc.", "Matrix42 AG", "BlazerBrowser.com LLC", "BROWSERWORKS LTD", "Exclaimer Ltd", "BrowseAI LLC") and
         process.code_signature.trusted == true) and
    not (process.executable : "C:\\Users\\*\\AppData\\Local\\Microsoft\\BingSvc\\BingSvc.exe" and process.code_signature.trusted == true and
         process.code_signature.subject_name == "Microsoft Corporation") and
    not process.executable : ("?:\\Program Files (x86)\\*.exe",
                              "?:\\Program Files\\*.exe",
                              "?:\\Windows\\System32\\cleanmgr.exe",
                              "?:\\Windows\\System32\\cmimageworker.exe",
                              "?:\\Windows\\System32\\igfxext.exe",
                              "?:\\Windows\\SysWOW64\\SearchIndexer.exe",
                              "?:\\Windows\\SysWOW64\\msiexec.exe",
                              "?:\\Windows\\System32\\msiexec.exe",
                              "C:\\Windows\\System32\\RuntimeBroker.exe",
                              "C:\\Windows\\System32\\taskhostw.exe",
                              "C:\\Windows\\System32\\MoUsoCoreWorker.exe",
                              "\\Device\\Mup\\*",
                              "?:\\Windows\\explorer.exe",
                              "?:\\Windows\\CCM\\CcmExec.exe",
                              "?:\\Windows\\System32\\cmd.exe",
                              "?:\\Windows\\System32\\dllhost.exe",
                              "?:\\Windows\\System32\\svchost.exe",
                              "?:\\Windows\\System32\\Robocopy.exe",
                              "?:\\Windows\\System32\\SearchProtocolHost.exe",
                              "?:\\Users\\*e\\AppData\\Local\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
                              "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge SxS\\Application\\msedge.exe",
                              "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",
                              "?:\\Users\\*\\AppData\\Local\\Carbonate\\Carbonate\\Application\\Carbonate.exe",
                              "C:\\Windows\\UUS\\Packages\\Preview\\amd64\\MoUsoCoreWorker.exe") and
    not (user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and process.executable : "?:\\Windows\\System32\\svchost.exe") and
    not process.executable :
                ("?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\MsSense.exe",
                 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
                 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MpCopyAccelerator.exe") and
    not (process.name : "certutil.exe" and file.extension : "db") and 
    not file.path : "?:\\Users\\*\\AppData\\Local\\Temp\\GoogleChromePortable\\profile\\Default\\Login Data" and
    not process.thread.Ext.call_stack_summary :
                 ("ntdll.dll|kernelbase.dll|hmpalert.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll",
                  "ntdll.dll|pghook.dll|kernelbase.dll|hmpalert.dll|pcpksp.dll|ncrypt.dll|crypt32.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
    not (process.name : "chrome.exe" and 
         file.path : ("?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA", 
                      "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PLAYWRIGHT_CHROMIUMDEV_PROFILE-*\\DEFAULT\\LOGIN DATA", 
                      "?:\\USERS\\*\\APPDATA\\LOCAL\\CHROMIUM\\USER DATA\\DEFAULT\\LOGIN DATA")) and
     not file.path : ("?:\\USERS\\*\\APPDATA\\ROAMING\\BURPSUITE\\PRE-WIRED-BROWSER\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\PGADMIN4\\USER DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\UNGOOGLED-CHROMIUM-PORTABLE\\DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\PUPPETEER_DEV_CHROME_PROFILE-*\\DEFAULT\\LOGIN DATA",
                   "?:\\Users\\*\\chrome-device\\Default\\Login Data",
                   "?:\\Users\\*\\EBWebView\\Default\\Login Data",
                   "?:\\Users\\*\\Favorites\\BOOKMARKS\\Default\\Login Data",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\ELROND\\MAIAR\\USER DATA\\DEFAULT\\LOGIN DATA",
                   "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Default BackupDD\\Login Data",
                   "?:\\Users\\*\\Favorites\\bookmarks\\Default\\Login Data",
                   "?:\\users\\*\\mayanks\\JxBrowserData\\Default\\Login Data",
                   "?:\\Users\\*\\AppData\\Local\\pc_app_store\\User Data\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Melvor Idle\\User Data\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Streaming\\User Data\\Default\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\BETAFLIGHT-CONFIGURATOR\\USER DATA\\DEFAULT\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\LEADING\\USER DATA\\DEFAULT\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\CHROMIUM\\USER DATA\\DEFAULT\\*",
                   "?:\\Users\\*\\AppData\\Local\\Uniflash\\User Data\\Default\\*",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\PGADMIN4\\USER DATA\\DEFAULT\\*",
                   "?:\\users\\*\\appdata\\local\\Market Axess\\Data\\*\\mayanks\\JxBrowserData\\Default\\*",
                   "?:\\Users\\*\\AppData\\Local\\Temp\\flutter_tools.*\\flutter_tools_chrome_device.*\\Default\\Login Data",
                   "?:\\Users\\*\\AppData\\Local\\*\\EBWebView\\Snapshots\\*\\Default\\Login Data",
                   "?:\\USERS\\*\\APPDATA\\ROAMING\\BURPSUITE\\PRE-WIRED-BROWSER\\SNAPSHOTS\\*\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\EBWEBVIEW\\DEFAULT\\LOGIN DATA",
                   "?:\\USERS\\*\\APPDATA\\LOCAL\\TEMP\\ALS_JXBROWSER_CONTEXT_*\\LOGIN DATA",
                   "?:\\ProgramData\\Microsoft\\Windows\\Containers\\BaseImages\\*\\BaseLayer\\Files\\Users\\WDAGUtilityAccount\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data") and
     not process.thread.Ext.call_stack_summary like
                             ("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|browsersettings.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|kernelbase.dll|shift.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|kernelbase.dll|msedge.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|rsaenh.dll|cryptsp.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|defaultpackoffer.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|appvisvsubsystems32.dll|kernelbase.dll|hmpalert.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|qipcap.dll|cmd.exe|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.dll|*",
                              "ntdll.dll|kernelbase.dll|procexp64.exe|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|mso30win32client.dll|mso20win32client.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscorlib.ni.dll|Unbacked|mscorlib.ni.dll|clr.dll|kernel32.dll|ntdll.dll",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|appvisvsubsystems32.dll|kernelbase.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|filesyncsessions.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|fluencyds.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|dsadmin.dll|dsuiext.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|microsoft.sharepoint.dll|*",
                              "ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|spark-windows-desktop-ui.dll|*",
                              "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.outcomeeq
  • failure corpus 10 (elastic 10)
field:"event.outcome" kind:eq value:"failure"
event.typeeq
  • access corpus 9 (elastic 9)
field:"event.type" kind:eq value:"access"
file.namewildcard
  • cert?.db corpus 3 (elastic 3)
  • cookies.sqlite corpus 11 (elastic 11)
  • key?.db corpus 11 (elastic 11)
  • logins.json corpus 11 (elastic 11)
  • signons.sqlite corpus 4 (elastic 4)
field:"file.name" kind:wildcard
file.pathwildcard
  • ?:\Users\*\AppData\Local\Google\Chrome\User Data\Local State corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Microsoft\Edge\User Data\Default\Login Data corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Microsoft\Edge\User Data\Local State corpus 4 (elastic 4)
  • ?:\users\*\AppData\Local\Google\Chrome\User Data\Default\Login Data corpus 4 (elastic 4)
field:"TargetFilename" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
process.thread.Ext.call_stack_summaryis_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_summary" kind:is_not_null
user.idne
  • S-1-5-18 corpus 37 (elastic 37)
field:"user.id" kind:ne value:"S-1-5-18"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqdbexcludes:file.extension field:"file.extension" value:"db"
process.nameeqcertutil.exeexcludes:process.name field:"process.name" value:"certutil.exe"
file.pathstarts_with?:\Windows\System32\spool\drivers\x64\excludes:file.path field:"file.path" value:"?:\Windows\System32\spool\drivers\x64\"
process.executableeq?:\Windows\System32\PrintIsolationHost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\PrintIsolationHost.exe"
file.pathwildcard?:\USERS\*\APPDATA\LOCAL\TEMP\PUPPETEER_DEV_CHROME_PROFILE-*\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\TEMP\PLAYWRIGHT_CHROMIUMDEV_PROFILE-*\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\CHROMIUM\USER DATA\DEFAULT\LOGIN DATAexcludes:file.path field:"file.path" value:"?:\USERS\*\APPDATA\LOCAL\TEMP\PUPPETEER_DEV_CHROME_PROFILE-*\DEFAULT\LOGIN DATA" field:"file.path" value:"?:\USERS\*\APPDATA\LOCAL\TEMP\PLAYWRIGHT_CHROMIUMDEV_PROFILE-*\DEFAULT\LOGIN DATA" field:"file.path" value:"?:\USERS\*\APPDATA\LOCAL\CHROMIUM\USER DATA\DEFAULT\LOGIN DATA"
process.nameeqchrome.exeexcludes:process.name field:"process.name" value:"chrome.exe"
process.code_signature.subject_nameeqMicrosoft Corporationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcardC:\Users\*\AppData\Local\Microsoft\BingSvc\BingSvc.exeexcludes:process.executable field:"process.executable" value:"C:\Users\*\AppData\Local\Microsoft\BingSvc\BingSvc.exe"
process.code_signature.subject_namewildcardRapid7 LLC, Mozilla Corporation, Commvault Systems, Inc., Google LLC, TPZ SOLUCOES DIGITAIS LTDA, Bitdefender SRL, Ivanti, Inc., McAfee, Inc., Fortinet Technologies*, Zscaler, Inc., Bromium, Inc., Duck Duck Go, Inc., Galactic Advisors, Inc., Kaspersky Lab JSC, 3Dconnexion SAM, Opera Norway AS, Dashlane, TeamDev Ltd., Mobatek, Shift Technologies Inc., Nextron Systems GmbH, Wavesor Software (Eightpoint Technologies Ltd. SEZC), Viber Media S.a r.l., Eric R. Zimmerman, SAP SE, Vivaldi Technologies AS, ONELAUNCH TECHNOLOGIES INC., SentinelOne Inc., Brave Software, Inc., Overwolf Ltd, YANDEX LLC, Keeper Security Inc., Dashlane USA, Inc., Spotify AB, Island Technology Inc., Zoom Video Communications, Inc., Emsisoft Ltd, REVERSO S.A.S., Zoom Video Communications, Inc., TeamDev Ltd., TeamDev Management*, Fabrice PARISOT, Beijing Qihu Technology Co., Ltd., timeBro GmbH, Lenovo, 7270356 Canada Inc., VS REVO GROUP OOD, Jio Platforms Limited, Zhuhai Kingsoft Office Software Co., Ltd., Adaware Software (7270356 CANADA INC.), Google Inc, SweetLabs Inc, Avast Software s.r.o., Athenahealth, Inc., Tencent Technology (Shenzhen) Company Limited, AOMEI International Network Limited, Lavasoft Software Canada Inc., memtime GmbH, Grammarly, Inc., Sunstream Labs (Capital Intellect Inc.), Echo Infini Sdn. Bhd., Matrix42 AG, Sunstream Labs (Capital Intellect Inc.), OneStart Technologies LLC, Grammarly, Inc., Canva, PERPLEXITY AI, INC., salesforce.com, inc., Matrix42 AG, BlazerBrowser.com LLC, BROWSERWORKS LTD, Exclaimer Ltd, BrowseAI LLCexcludes:process.code_signature.subject_name
process.executableeq?:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\svchost.exe"
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.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
file.pathwildcard?:\USERS\*\APPDATA\ROAMING\BURPSUITE\PRE-WIRED-BROWSER\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\TEMP\PUPPETEER_DEV_CHROME_PROFILE-*\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\PGADMIN4\USER DATA\DEFAULT\LOGIN DATA, ?:\USERS\*\UNGOOGLED-CHROMIUM-PORTABLE\DATA\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\TEMP\PUPPETEER_DEV_CHROME_PROFILE-*\DEFAULT\LOGIN DATA, ?:\Users\*\chrome-device\Default\Login Data, ?:\Users\*\EBWebView\Default\Login Data, ?:\Users\*\Favorites\BOOKMARKS\Default\Login Data, ?:\USERS\*\APPDATA\LOCAL\ELROND\MAIAR\USER DATA\DEFAULT\LOGIN DATA, ?:\Users\*\AppData\Local\Microsoft\Edge\Default BackupDD\Login Data, ?:\Users\*\Favorites\bookmarks\Default\Login Data, ?:\users\*\mayanks\JxBrowserData\Default\Login Data, ?:\Users\*\AppData\Local\pc_app_store\User Data\Default\*, ?:\Users\*\AppData\Local\Melvor Idle\User Data\Default\*, ?:\Users\*\AppData\Local\Streaming\User Data\Default\*, ?:\USERS\*\APPDATA\LOCAL\BETAFLIGHT-CONFIGURATOR\USER DATA\DEFAULT\*, ?:\USERS\*\APPDATA\LOCAL\LEADING\USER DATA\DEFAULT\*, ?:\USERS\*\APPDATA\LOCAL\CHROMIUM\USER DATA\DEFAULT\*, ?:\Users\*\AppData\Local\Uniflash\User Data\Default\*, ?:\USERS\*\APPDATA\LOCAL\PGADMIN4\USER DATA\DEFAULT\*, ?:\users\*\appdata\local\Market Axess\Data\*\mayanks\JxBrowserData\Default\*, ?:\Users\*\AppData\Local\Temp\flutter_tools.*\flutter_tools_chrome_device.*\Default\Login Data, ?:\Users\*\AppData\Local\*\EBWebView\Snapshots\*\Default\Login Data, ?:\USERS\*\APPDATA\ROAMING\BURPSUITE\PRE-WIRED-BROWSER\SNAPSHOTS\*\DEFAULT\LOGIN DATA, ?:\USERS\*\EBWEBVIEW\DEFAULT\LOGIN DATA, ?:\USERS\*\APPDATA\LOCAL\TEMP\ALS_JXBROWSER_CONTEXT_*\LOGIN DATA, ?:\ProgramData\Microsoft\Windows\Containers\BaseImages\*\BaseLayer\Files\Users\WDAGUtilityAccount\AppData\Local\Microsoft\Edge\User Data\Default\Login Dataexcludes:file.path
file.pathwildcard?:\Users\*\AppData\Local\Temp\GoogleChromePortable\profile\Default\Login Dataexcludes:file.path field:"file.path" value:"?:\Users\*\AppData\Local\Temp\GoogleChromePortable\profile\Default\Login Data"
process.executablewildcard?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\System32\cleanmgr.exe, ?:\Windows\System32\cmimageworker.exe, ?:\Windows\System32\igfxext.exe, ?:\Windows\SysWOW64\SearchIndexer.exe, ?:\Windows\SysWOW64\msiexec.exe, ?:\Windows\System32\msiexec.exe, C:\Windows\System32\RuntimeBroker.exe, C:\Windows\System32\taskhostw.exe, C:\Windows\System32\MoUsoCoreWorker.exe, \Device\Mup\*, ?:\Windows\explorer.exe, ?:\Windows\CCM\CcmExec.exe, ?:\Windows\System32\cmd.exe, ?:\Windows\System32\dllhost.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\System32\Robocopy.exe, ?:\Windows\System32\SearchProtocolHost.exe, ?:\Users\*e\AppData\Local\Microsoft\EdgeWebView\Application\*\msedgewebview2.exe, ?:\Users\*\AppData\Local\Microsoft\Edge SxS\Application\msedge.exe, ?:\Users\*\AppData\Local\Microsoft\Edge\Application\msedge.exe, ?:\Users\*\AppData\Local\Carbonate\Carbonate\Application\Carbonate.exe, C:\Windows\UUS\Packages\Preview\amd64\MoUsoCoreWorker.exeexcludes:process.executable
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\MsSense.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*\MpCopyAccelerator.exeexcludes:process.executable field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\MsSense.exe" field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender\Platform\*\MsMpEng.exe" field:"process.executable" value:"?:\ProgramData\Microsoft\Windows Defender\Platform\*\MpCopyAccelerator.exe"
process.thread.Ext.call_stack_summaryeqntdll.dll|kernelbase.dll|hmpalert.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|pghook.dll|kernelbase.dll|hmpalert.dll|pcpksp.dll|ncrypt.dll|crypt32.dll|aadtb.dll|threadpoolwinrt.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|hmpalert.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll" field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|pghook.dll|kernelbase.dll|hmpalert.dll|pcpksp.dll|ncrypt.dll|crypt32.dll|aadtb.dll|threadpoolwinrt.dll|ntdll.dll|kernel32.dll|ntdll.dll"
process.thread.Ext.call_stack_summarywildcardntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|browsersettings.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|hmpalert.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|*, ntdll.dll|kernelbase.dll|shift.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|msedge.dll|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|rsaenh.dll|cryptsp.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|defaultpackoffer.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|appvisvsubsystems32.dll|kernelbase.dll|hmpalert.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|aclayers.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|qipcap.dll|cmd.exe|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|acrord32.dll|*, ntdll.dll|kernelbase.dll|procexp64.exe|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|mso30win32client.dll|mso20win32client.dll|kernel32.dll|ntdll.dll, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscorlib.ni.dll|Unbacked|mscorlib.ni.dll|clr.dll|kernel32.dll|ntdll.dll, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|windows.security.authentication.*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|appvisvsubsystems32.dll|kernelbase.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|filesyncsessions.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|fluencyds.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|dsadmin.dll|dsuiext.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|microsoft.sharepoint.dll|*, ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|spark-windows-desktop-ui.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|sophosed.dll|kernelbase.dll|hmpalert.dll|mso20win32client.dll|*excludes:process.thread.Ext.call_stack_summary

Firewall Policy Changed by a Suspicious Process

#
Time window
1m
Source
github.com/elastic/protections-artifacts

Identifies attempts to modify the Windows Firewall Policy in order to permit an unsigned executable that was recently introduced. Malicious software frequently employs such alterations during installation to ensure uninterrupted network connectivity.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Identifies attempts to modify the Windows Firewall Policy in order to permit an unsigned executable that was recently
introduced. Malicious software frequently employs such alterations during installation to ensure uninterrupted network
connectivity.
"""
id = "bf072c39-90bc-4b1b-9c78-1d8a9bd6f0e1"
license = "Elastic License v2"
name = "Firewall Policy Changed by a Suspicious Process"
os_list = ["windows"]
version = "1.0.7"

query = '''
sequence with maxspan=1m 
[process where event.action == "start" and 
(
 ((process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and 
 (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
  (process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") or
   process.executable regex~ """c:\\windows\\[a-z0-9\-\_\.]+\.exe""")) or 

   process.executable : "?:\\Windows\\Microsoft.NET\\*" or 

   (process.code_signature.subject_name : "NetSupport Ltd" and process.Ext.relative_file_creation_time <= 500 and 
    not process.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe"))
 ) and
 not process.hash.sha256 in ("0f418b6eda02552ef104a836a8ba812ddcfae11506dc96cae71b719046cd749c",
                             "4cdb4fd1bb7a23c802abb6b5c0a973679495154b17a2234ea19e11fd0c8a2b0a",
                             "7d766d78c07024537114c7ddaec864810cac822719caf13ff738b52c2b663c75",
                             "e3fb22644ccfe21f511848e516c172802b9b6513625af1e5877e9dd88e8fe477") and
 not (process.executable : "?:\\ProgramData\\checkmk\\agent\\bin\\cmk-agent-ctl.exe" and
      process.parent.executable : ("?:\\Program Files\\checkmk\\service\\check_mk_agent.exe",
                                   "?:\\Program Files (x86)\\checkmk\\service\\check_mk_agent.exe")) and
not (process.code_signature.subject_name : "Incredibuild Software ltd." and process.code_signature.trusted == true)
] as event0 
[registry where 
  registry.path : "HKLM\\SYSTEM\\ControlSet*\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\FirewallRules\\*" and 
  registry.data.strings : "*Allow*Public|*" and stringcontains~(registry.data.strings, event0.process.executable)]
'''

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

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

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



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: process

[process where event.action == "start" and 
(
 ((process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and 
 (process.code_signature.trusted == false or process.code_signature.exists == false) and 
  not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
  (process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") or
   process.executable regex~ """c:\\windows\\[a-z0-9\-\_\.]+\.exe""")) or 

   process.executable : "?:\\Windows\\Microsoft.NET\\*" or 

   (process.code_signature.subject_name : "NetSupport Ltd" and process.Ext.relative_file_creation_time <= 500 and 
    not process.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe"))
 ) and
 not process.hash.sha256 in ("0f418b6eda02552ef104a836a8ba812ddcfae11506dc96cae71b719046cd749c",
                             "4cdb4fd1bb7a23c802abb6b5c0a973679495154b17a2234ea19e11fd0c8a2b0a",
                             "7d766d78c07024537114c7ddaec864810cac822719caf13ff738b52c2b663c75",
                             "e3fb22644ccfe21f511848e516c172802b9b6513625af1e5877e9dd88e8fe477") and
 not (process.executable : "?:\\ProgramData\\checkmk\\agent\\bin\\cmk-agent-ctl.exe" and
      process.parent.executable : ("?:\\Program Files\\checkmk\\service\\check_mk_agent.exe",
                                   "?:\\Program Files (x86)\\checkmk\\service\\check_mk_agent.exe")) and
not (process.code_signature.subject_name : "Incredibuild Software ltd." and process.code_signature.trusted == true)
] as event0

Stage 2: registry

[registry where 
  registry.path : "HKLM\\SYSTEM\\ControlSet*\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\FirewallRules\\*" and 
  registry.data.strings : "*Allow*Public|*" and stringcontains~(registry.data.strings, event0.process.executable)]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.Ext.relative_file_name_modify_timele
  • 500 transforms: number corpus 21 (elastic 21)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"500"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.subject_namewildcard
  • NetSupport Ltd corpus 3 (elastic 3)
field:"Signature" kind:wildcard value:"NetSupport Ltd"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executableregex_match
  • c:\windows\[a-z0-9\-\_.]+.exe corpus 3 (elastic 3)
field:"Image" kind:regex_match value:"c:\windows\[a-z0-9\-\_.]+.exe"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\* corpus 17 (elastic 17)
  • ?:\Windows\Microsoft.NET\* corpus 5 (elastic 5)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
field:"Image" kind:wildcard
registry.data.stringscontains
  • event0.process.executable (field reference)
field:"Details" kind:contains value:"event0.process.executable"
registry.data.stringswildcard
  • *Allow*Public|*
field:"Details" kind:wildcard value:"*Allow*Public|*"
registry.pathwildcard
  • HKLM\SYSTEM\ControlSet*\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\*
field:"TargetObject" kind:wildcard value:"HKLM\SYSTEM\ControlSet*\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqIncredibuild Software ltd.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Incredibuild Software ltd."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeq?:\ProgramData\checkmk\agent\bin\cmk-agent-ctl.exeexcludes:process.executable field:"process.executable" value:"?:\ProgramData\checkmk\agent\bin\cmk-agent-ctl.exe"
process.parent.executableeq?:\Program Files\checkmk\service\check_mk_agent.exe, ?:\Program Files (x86)\checkmk\service\check_mk_agent.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\checkmk\service\check_mk_agent.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\checkmk\service\check_mk_agent.exe"
process.hash.sha256in0f418b6eda02552ef104a836a8ba812ddcfae11506dc96cae71b719046cd749c, 4cdb4fd1bb7a23c802abb6b5c0a973679495154b17a2234ea19e11fd0c8a2b0a, 7d766d78c07024537114c7ddaec864810cac822719caf13ff738b52c2b663c75, e3fb22644ccfe21f511848e516c172802b9b6513625af1e5877e9dd88e8fe477excludes:process.hash.sha256

Full User-Mode Dumps Enabled System-Wide

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

Identifies the enable of the full user-mode dumps feature system-wide. This feature allows Windows Error Reporting (WER) to collect data after an application crashes. This setting is a requirement for the LSASS Shtinkering attack, which fakes the communication of a crash on LSASS, generating a dump of the process memory, which gives the attacker access to the credentials present on the system without having to bring malware to the system. This setting is not enabled by default, and applications must create their registry subkeys to hold settings that enable them to collect dumps.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Defense Impairment
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/08/28"
integration = ["endpoint", "windows", "m365_defender"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies the enable of the full user-mode dumps feature system-wide. This feature allows Windows Error Reporting (WER)
to collect data after an application crashes. This setting is a requirement for the LSASS Shtinkering attack, which
fakes the communication of a crash on LSASS, generating a dump of the process memory, which gives the attacker access to
the credentials present on the system without having to bring malware to the system. This setting is not enabled by
default, and applications must create their registry subkeys to hold settings that enable them to collect dumps.
"""
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 = "Full User-Mode Dumps Enabled System-Wide"
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 Full User-Mode Dumps Enabled System-Wide

Full user-mode dumps are a diagnostic feature in Windows that captures detailed information about application crashes, aiding in troubleshooting. However, attackers can exploit this by triggering dumps of sensitive processes like LSASS to extract credentials. The detection rule identifies registry changes enabling this feature system-wide, flagging potential misuse by excluding legitimate system processes, thus alerting analysts to suspicious activity.

### Possible investigation steps

- Review the registry path HKLM\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\DumpType to confirm if the value is set to "2" or "0x00000002", indicating full user-mode dumps are enabled.
- Check for any recent changes to the registry key by examining the modification timestamps and identifying the user or process responsible for the change.
- Investigate the context of the alert by reviewing recent process execution logs to identify any suspicious processes that may have triggered the dump, especially those not matching the legitimate svchost.exe process with user IDs S-1-5-18, S-1-5-19, or S-1-5-20.
- Analyze any generated dump files for sensitive information, such as credentials, and determine if they were accessed or exfiltrated by unauthorized users or processes.
- Correlate the alert with other security events or logs, such as Sysmon or Microsoft Defender XDR, to identify any related suspicious activities or patterns that could indicate a broader attack.

### False positive analysis

- Legitimate system processes like svchost.exe may trigger the rule if they are not properly excluded. Ensure that the exclusion for svchost.exe is correctly configured by verifying the process executable path and user IDs.
- Custom applications that require full user-mode dumps for legitimate debugging purposes might be flagged. Identify these applications and create specific registry subkey exclusions to prevent false positives.
- System administrators performing routine maintenance or diagnostics might enable full user-mode dumps temporarily. Document these activities and consider creating temporary exceptions during maintenance windows.
- Security tools or monitoring software that simulate crash scenarios for testing purposes could trigger the rule. Verify the legitimacy of these tools and add them to an exclusion list if they are part of regular security operations.
- Updates or patches from software vendors that modify registry settings for error reporting might be misinterpreted as suspicious. Monitor update schedules and correlate any rule triggers with known update activities to avoid unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further credential access or lateral movement by the attacker.
- Terminate any unauthorized processes that are generating full user-mode dumps, especially those related to LSASS, to stop further credential dumping.
- Conduct a thorough review of the registry settings on the affected system to ensure that the full user-mode dumps feature is disabled unless explicitly required for legitimate purposes.
- Change all credentials that may have been exposed, particularly those associated with high-privilege accounts, to mitigate the risk of unauthorized access.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar registry changes across the network to detect and respond to future attempts promptly.
- Review and update endpoint protection configurations to ensure they are capable of detecting and blocking similar credential dumping techniques."""
references = [
    "https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps",
    "https://github.com/deepinstinct/Lsass-Shtinkering",
    "https://media.defcon.org/DEF%20CON%2030/DEF%20CON%2030%20presentations/Asaf%20Gilboa%20-%20LSASS%20Shtinkering%20Abusing%20Windows%20Error%20Reporting%20to%20Dump%20LSASS.pdf",
]
risk_score = 47
rule_id = "220be143-5c67-4fdb-b6ce-dd6826d024fd"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and
    registry.path : (
        "HKLM\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\DumpType",
        "\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\DumpType"
    ) and
    registry.data.strings : ("2", "0x00000002") and
    not (process.executable : "?:\\Windows\\system32\\svchost.exe" and user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20"))
'''

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.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
    registry.path : (
        "HKLM\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\DumpType",
        "\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\DumpType"
    ) and
    registry.data.strings : ("2", "0x00000002") and
    not (process.executable : "?:\\Windows\\system32\\svchost.exe" and user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
registry.data.stringswildcard
  • 0x00000002 corpus 4 (elastic 2, splunk 2)
  • 2 corpus 3 (elastic 2, sigma 1)
field:"Details" kind:wildcard
registry.pathwildcard
  • HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\DumpType
  • \REGISTRY\MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\DumpType
field:"TargetObject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

GRUB Configuration Generation through Built-in Utilities

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

This rule detects the generation of a new GRUB configuration file using built-in Linux commands. The GRUB configuration file is used to configure the GRUB bootloader, which is responsible for loading the Linux kernel and initramfs image during the boot process. Attackers may use these built-in utilities to generate a new GRUB configuration file that includes malicious kernel parameters or boot options, which can be leveraged to maintain persistence on the system.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the generation of a new GRUB configuration file using built-in Linux commands. The GRUB configuration
file is used to configure the GRUB bootloader, which is responsible for loading the Linux kernel and initramfs image
during the boot process. Attackers may use these built-in utilities to generate a new GRUB configuration file that
includes malicious kernel parameters or boot options, which can be leveraged to maintain persistence on the system.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "GRUB Configuration Generation through Built-in Utilities"
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 GRUB Configuration Generation through Built-in Utilities

GRUB, the Grand Unified Bootloader, is crucial for loading the Linux kernel during system startup. It uses configuration files to determine boot parameters. Adversaries may exploit utilities like `grub-mkconfig` to alter these files, embedding malicious parameters for persistence. The detection rule identifies suspicious executions of these utilities, especially when initiated by atypical parent processes, signaling potential misuse.

### Possible investigation steps

- Review the process execution details to identify the parent process of the suspicious GRUB configuration utility execution. Check if the parent process is unusual or unexpected based on the query's exclusion list.
- Examine the command-line arguments used in the execution of the GRUB configuration utility to identify any potentially malicious kernel parameters or boot options.
- Investigate the user account associated with the process execution to determine if it has the necessary privileges and if the activity aligns with the user's typical behavior.
- Check the system's recent changes or updates, especially those related to bootloader configurations, to identify any unauthorized modifications.
- Analyze system logs for any other suspicious activities or anomalies around the time of the GRUB configuration utility execution to gather additional context.

### False positive analysis

- Routine system updates or maintenance tasks may trigger the rule when legitimate processes like package managers (e.g., pacman, dnf, yum) or system utilities (e.g., sudo) execute GRUB configuration commands. Users can mitigate this by adding these processes to the exception list in the rule configuration.
- Automated scripts or cron jobs that regularly update GRUB configurations for legitimate reasons might be flagged. To handle this, identify these scripts and add their parent process names or paths to the exclusion criteria.
- Custom administrative scripts that manage bootloader settings could also cause false positives. Review these scripts and, if verified as safe, include their parent process details in the rule's exceptions.
- Some Linux distributions may have specific utilities or services that interact with GRUB as part of their normal operation. Investigate these utilities and consider excluding them if they are confirmed to be benign and necessary for system functionality.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further malicious activity or lateral movement.
- Terminate any suspicious processes related to `grub-mkconfig`, `grub2-mkconfig`, or `update-grub` that were initiated by atypical parent processes.
- Review and restore the GRUB configuration file from a known good backup to ensure no malicious parameters are present.
- Conduct a thorough examination of the system for additional signs of compromise, focusing on persistence mechanisms and unauthorized changes to boot parameters.
- Escalate the incident to the security operations team for further analysis and to determine if additional systems are affected.
- Implement monitoring for future unauthorized executions of GRUB configuration utilities, ensuring alerts are generated for similar suspicious activities.
- Review and update access controls and permissions to restrict the execution of GRUB configuration utilities to authorized personnel only."""
risk_score = 21
rule_id = "aabdad51-51fb-4a66-9d82-3873e42accb8"
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: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.parent.executable != null and process.name in ("grub-mkconfig", "grub2-mkconfig", "update-grub") and not (
  process.parent.name in ("run-parts", "sudo", "update-grub", "pacman", "dockerd", "dnf", "rpm", "yum") or
  process.parent.executable like (
    "/var/lib/dpkg/info/*", "/usr/lib/bootloader/grub2-efi/config", "/tmp/newroot/*", "/usr/lib/kernel/install.d/*",
    "/run/user/*/.bubblewrap/*/timeout"
  ) or
  process.parent.executable in (
    "/usr/bin/timeout", "/usr/sbin/nvidia-boot-update", "/usr/lib/oci-linux-config/misc_updates.sh",
    "/opt/puppetlabs/puppet/bin/puppet", "/usr/sbin/selinux-activate", "/usr/lib/skylight/stop-workspace",
    "/var/lib/aws-replication-agent/install_agent", "/usr/local/CTS/bin/apply_personality",
    "/opt/puppetlabs/puppet/bin/ruby"
  ) or
  (process.parent.name like ("python*", "platform-python*") and process.parent.command_line like "*ansible*")
)
'''

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.parent.executable != null and process.name in ("grub-mkconfig", "grub2-mkconfig", "update-grub") and not (
  process.parent.name in ("run-parts", "sudo", "update-grub", "pacman", "dockerd", "dnf", "rpm", "yum") or
  process.parent.executable like (
    "/var/lib/dpkg/info/*", "/usr/lib/bootloader/grub2-efi/config", "/tmp/newroot/*", "/usr/lib/kernel/install.d/*",
    "/run/user/*/.bubblewrap/*/timeout"
  ) or
  process.parent.executable in (
    "/usr/bin/timeout", "/usr/sbin/nvidia-boot-update", "/usr/lib/oci-linux-config/misc_updates.sh",
    "/opt/puppetlabs/puppet/bin/puppet", "/usr/sbin/selinux-activate", "/usr/lib/skylight/stop-workspace",
    "/var/lib/aws-replication-agent/install_agent", "/usr/local/CTS/bin/apply_personality",
    "/opt/puppetlabs/puppet/bin/ruby"
  ) or
  (process.parent.name like ("python*", "platform-python*") and process.parent.command_line like "*ansible*")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.namein
  • grub-mkconfig
  • grub2-mkconfig
  • update-grub
field:"process_basename" kind:in
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.command_linematchansibleexcludes:process.parent.command_line field:"process.parent.command_line" value:"ansible"
process.parent.namestarts_withpython, platform-pythonexcludes:process.parent.name field:"process.parent.name" value:"python" field:"process.parent.name" value:"platform-python"
process.parent.executablein/opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /usr/bin/timeout, /usr/lib/oci-linux-config/misc_updates.sh, /usr/lib/skylight/stop-workspace, /usr/local/CTS/bin/apply_personality, /usr/sbin/nvidia-boot-update, /usr/sbin/selinux-activate, /var/lib/aws-replication-agent/install_agentexcludes:process.parent.executable
process.parent.executablewildcard/var/lib/dpkg/info/*, /usr/lib/bootloader/grub2-efi/config, /tmp/newroot/*, /usr/lib/kernel/install.d/*, /run/user/*/.bubblewrap/*/timeoutexcludes:process.parent.executable
process.parent.nameindnf, dockerd, pacman, rpm, run-parts, sudo, update-grub, yumexcludes:process.parent.name

Host Detected with Suspicious Windows Process(es)

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

A machine learning job combination has identified a host with one or more suspicious Windows processes that exhibit unusually high malicious probability scores.These process(es) have been classified as malicious in several ways. The process(es) were predicted to be malicious by the ProblemChild supervised ML model. If the anomaly contains a cluster of suspicious processes, each process has the same host name, and the aggregate score of the event cluster was calculated to be unusually high by an unsupervised ML model. Such a cluster often contains 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 combination has identified a host with one or more suspicious Windows processes that exhibit
unusually high malicious probability scores.These process(es) have been classified as malicious in several ways. The
process(es) were predicted to be malicious by the ProblemChild supervised ML model. If the anomaly contains a cluster of
suspicious processes, each process has the same host name, and the aggregate score of the event cluster was calculated
to be unusually high by an unsupervised ML model. Such a cluster often contains 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_high_sum_by_host_ea"
name = "Host Detected with Suspicious Windows Process(es)"
note = """## Triage and analysis

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

### Investigating Host Detected with Suspicious Windows Process(es)

The detection leverages machine learning to identify clusters of Windows processes with high malicious probability scores. Adversaries exploit legitimate tools, known as LOLbins, to evade detection. This rule uses both supervised and unsupervised ML models to flag unusual process clusters on a single host, indicating potential masquerading tactics for defense evasion.

### Possible investigation steps

- Review the host name associated with the suspicious process cluster to determine if it is a critical asset or has a history of similar alerts.
- Examine the specific processes flagged by the ProblemChild supervised ML model to identify any known LOLbins or unusual command-line arguments that may indicate masquerading.
- Check the timeline of the process execution to see if it coincides with any known scheduled tasks or user activity that could explain the anomaly.
- Investigate the parent-child relationship of the processes to identify any unexpected or unauthorized process spawning patterns.
- Correlate the alert with other security events or logs from the same host to identify any additional indicators of compromise or related suspicious activity.
- Assess the network activity associated with the host during the time of the alert to detect any potential data exfiltration or communication with known malicious IP addresses.

### False positive analysis

- Legitimate administrative tools like PowerShell or Windows Management Instrumentation (WMI) may be flagged as suspicious due to their dual-use nature. Users can create exceptions for these tools when used by trusted administrators or during scheduled maintenance.
- Automated scripts or scheduled tasks that perform routine system checks or updates might trigger alerts. Review these processes and whitelist them if they are verified as part of regular operations.
- Software updates or installations that involve multiple processes spawning in a short time frame can be mistaken for malicious clusters. Ensure that these activities are documented and create exceptions for known update processes.
- Development or testing environments where new or experimental software is frequently executed may generate false positives. Consider excluding these environments from monitoring or adjusting the sensitivity of the rule for these specific hosts.
- Frequent use of remote desktop or remote management tools by IT staff can appear suspicious. Implement user-based exceptions for known IT personnel to reduce unnecessary alerts.

### Response and remediation

- Isolate the affected host immediately to prevent further spread of potential malicious activity. Disconnect it from the network to contain the threat.
- Terminate the suspicious processes identified by the alert. Use task management tools or scripts to ensure all instances of the processes are stopped.
- Conduct a thorough review of the host's system logs and process history to identify any additional indicators of compromise or related malicious activity.
- Restore the host from a known good backup if available, ensuring that the backup is free from any signs of compromise.
- Update and patch the host's operating system and all installed software to close any vulnerabilities that may have been exploited.
- Implement application whitelisting to prevent unauthorized or suspicious processes from executing in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional hosts 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 = "bdfebe11-e169-42e3-b344-c5d2015533d3"
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 = [
    "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/"

Kubernetes Creation of a RoleBinding Referencing a ServiceAccount

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

This rule detects the creation of RoleBindings or ClusterRoleBindings that reference a ServiceAccount, which may indicate privilege delegation or potential RBAC misconfiguration leading to elevated access.

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 = """
This rule detects the creation of RoleBindings or ClusterRoleBindings that reference a ServiceAccount,
which may indicate privilege delegation or potential RBAC misconfiguration leading to elevated access.
"""
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Creation of a RoleBinding Referencing a ServiceAccount"
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 Creation of a RoleBinding Referencing a ServiceAccount

This rule detects creation of a RoleBinding or ClusterRoleBinding that grants permissions to a ServiceAccount, a common way to delegate access inside the cluster and a frequent precursor to stealthy privilege escalation or persistence. Attackers who gain the ability to create bindings often attach an over-privileged role (or cluster-wide role) to an existing ServiceAccount used by a workload, then use that workload’s token to operate with elevated rights without creating new user identities.

### Possible investigation steps

- Identify the principal that created the binding (user/service account), along with the source IP, user-agent, and authentication method, to determine whether it originated from an expected controller, CI/CD system, or a suspicious client.
- Review the new RoleBinding/ClusterRoleBinding’s `roleRef` and subjects to determine what permissions were granted, and assess blast radius by inspecting the referenced Role/ClusterRole rules for high-impact verbs/resources (e.g., secrets, pods/exec, nodes, RBAC).
- Determine where the referenced ServiceAccount is used by enumerating pods/deployments in the namespace that run under it, checking whether service account tokens are mounted, and whether this SA is associated with privileged workloads or externally reachable services.
- Correlate nearby audit activity for additional RBAC or identity changes (new roles, bindings, service accounts, token requests) and for follow-on actions performed using the ServiceAccount that indicate attempted privilege escalation or persistence.
- Validate the change against approved deployment/change records and, if unauthorized or overly permissive, remove/roll back the binding and rotate or invalidate the ServiceAccount credentials while tightening RBAC to least privilege.

### False positive analysis

- A cluster administrator or GitOps-driven deployment legitimately creates or updates RoleBindings/ClusterRoleBindings to grant a workload ServiceAccount the minimal permissions required for a new release, namespace onboarding, or routine RBAC refactoring.
- Kubernetes controllers or automation running under authorized identities (e.g., internal operators, admission policies, or namespace provisioning jobs) create bindings for default or system ServiceAccounts as part of standard cluster bootstrap, reconciliation, or multi-tenant namespace setup.

### Response and remediation

- Immediately fetch and snapshot the created RoleBinding/ClusterRoleBinding manifest, its referenced Role/ClusterRole, and recent Kubernetes audit events around the creator and the ServiceAccount to preserve evidence and establish scope.  
- Contain potential misuse by deleting or scaling down workloads that use the referenced ServiceAccount and temporarily revoking the new binding (or applying an emergency deny policy via admission controls) until the change is validated.  
- Eradicate unauthorized privilege delegation by removing the binding, replacing it with a least-privilege Role/RoleBinding scoped to the required namespace/resources, and rotating credentials by recreating the ServiceAccount or forcing token/key rotation for any dependent workloads.  
- Recover safely by redeploying affected applications with the corrected RBAC, validating that required operations succeed without cluster-admin-equivalent rights, and monitoring for repeated binding creation or follow-on access to secrets, pod exec, or node-level resources.  
- Escalate to platform security/incident response immediately if the binding references a high-privilege ClusterRole (e.g., cluster-admin), targets a broadly used ServiceAccount, or is followed by suspicious actions such as secret reads, new token requests, or pod exec sessions from the same identity.  
- Harden by enforcing RBAC guardrails with admission policies that restrict who can create RoleBindings/ClusterRoleBindings and which roles may be referenced, disabling auto-mounting of service account tokens where not needed, and adopting GitOps-only RBAC changes with mandatory review.
"""
references = [
    "https://heilancoos.github.io/research/2025/12/16/kubernetes.html#overly-permissive-role-based-access-control",
]
risk_score = 47
rule_id = "fd00769d-b18d-450a-a844-7a9f9c71995e"
severity = "medium"
tags = [
    "Data Source: Kubernetes",
    "Domain: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: "kubernetes.audit_logs" and kubernetes.audit.requestObject.spec.serviceAccountName:* and
kubernetes.audit.verb:"create" and kubernetes.audit.objectRef.resource:("rolebindings" or "clusterrolebindings") and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow"
'''

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "kubernetes.audit_logs" and kubernetes.audit.requestObject.spec.serviceAccountName:* and
kubernetes.audit.verb:"create" and kubernetes.audit.objectRef.resource:("rolebindings" or "clusterrolebindings") and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow"

Indicators

These rows show field, operator, and value matches.

Linux Powershell Egress Network Connection

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

Detects when Powershell (pwsh) on Linux makes an outbound network connection attempt. Powershell usage on Linux is rare, and leveraging Powershell to connect out to the internet may indicate malicious behavior.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects when Powershell (pwsh) on Linux makes an outbound network connection attempt. Powershell usage on Linux is rare,
and leveraging Powershell to connect out to the internet may indicate malicious behavior.
"""
id = "1471cf36-7e5c-47cc-bf39-2234df0e676a"
license = "Elastic License v2"
name = "Linux Powershell Egress Network Connection"
os_list = ["linux"]
version = "1.0.14"

query = '''
sequence by process.entity_id with maxspan=5s
  [process where event.type == "start" and event.action == "exec" and process.parent.name == "pwsh" and not (
    process.name in ("kubectl", "helm", "pwsh", "yum", "dnf", "dotnet", "ansible-lint") or
    process.executable like (
      "/run/containerd/*python3", "/jenkins-data/docker/*python3", "/tmp/Download-References/DepotDownloader/DepotDownloader",
      "/home/*/.local/bin/az", "/usr/libexec/platform-python*"
    ) or
    process.parent.executable like ("/jenkins-data/docker*", "/var/run/docker/*", "/run/containerd/*") or
    process.command_line == "/usr/bin/gh auth status" or
    (process.name like "python*" and process.args == "azure.cli") or
    process.working_directory like "/opt/azurevstsagent/agent*" or
    process.args == "/bin/dnf" or
    process.args like "/home/*/.local/bin/az"
  )
  ]
  [network where event.type == "start" and event.action == "connection_attempted" and not (
     destination.ip == null or
     destination.ip == "0.0.0.0" or
     cidrmatch(
       destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
       "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
       "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
       "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
       "FF00::/8"
     ) or
     process.name == "ssh"
   )
  ]
'''

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

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

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

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

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



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

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

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

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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.parent.name == "pwsh" and not (
    process.name in ("kubectl", "helm", "pwsh", "yum", "dnf", "dotnet", "ansible-lint") or
    process.executable like (
      "/run/containerd/*python3", "/jenkins-data/docker/*python3", "/tmp/Download-References/DepotDownloader/DepotDownloader",
      "/home/*/.local/bin/az", "/usr/libexec/platform-python*"
    ) or
    process.parent.executable like ("/jenkins-data/docker*", "/var/run/docker/*", "/run/containerd/*") or
    process.command_line == "/usr/bin/gh auth status" or
    (process.name like "python*" and process.args == "azure.cli") or
    process.working_directory like "/opt/azurevstsagent/agent*" or
    process.args == "/bin/dnf" or
    process.args like "/home/*/.local/bin/az"
  )
  ]

Stage 2: network

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

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqazure.cliexcludes:process.args field:"process.args" value:"azure.cli"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.argseq/bin/dnfexcludes:process.args field:"process.args" value:"/bin/dnf"
process.argswildcard/home/*/.local/bin/azexcludes:process.args field:"process.args" value:"/home/*/.local/bin/az"
process.command_lineeq/usr/bin/gh auth statusexcludes:process.command_line field:"process.command_line" value:"/usr/bin/gh auth status"
process.executablewildcard/run/containerd/*python3, /jenkins-data/docker/*python3, /tmp/Download-References/DepotDownloader/DepotDownloader, /home/*/.local/bin/az, /usr/libexec/platform-python*excludes:process.executable
process.nameinansible-lint, dnf, dotnet, helm, kubectl, pwsh, yumexcludes:process.name
process.parent.executablestarts_with/jenkins-data/docker, /var/run/docker/, /run/containerd/excludes:process.parent.executable field:"process.parent.executable" value:"/jenkins-data/docker" field:"process.parent.executable" value:"/var/run/docker/" field:"process.parent.executable" value:"/run/containerd/"
process.working_directorystarts_with/opt/azurevstsagent/agentexcludes:process.working_directory field:"process.working_directory" value:"/opt/azurevstsagent/agent"
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:destination.ip
destination.ipeq0.0.0.0excludes:destination.ip field:"destination.ip" value:"0.0.0.0"
destination.ipis_null(no value, null check)excludes:destination.ip
process.nameeqsshexcludes:process.name field:"process.name" value:"ssh"

Linux User Added to Privileged Group

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

Identifies attempts to add a user to a privileged group. Attackers may add users to a privileged group in order to establish persistence on a system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/02/13"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/06/17"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific User"
query = "SELECT * FROM users WHERE username = {{user.name}}"

[[transform.osquery]]
label = "Osquery - Investigate the Account Authentication Status"
query = "SELECT * FROM logged_in_users WHERE user = {{user.name}}"

[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific Group"
query = "SELECT * FROM groups WHERE groupname = {{group.name}}"

[[transform.osquery]]
label = "Osquery - Retrieve Running Processes by User"
query = "SELECT pid, username, name FROM processes p JOIN users u ON u.uid = p.uid ORDER BY username"

[rule]
author = ["Elastic"]
description = """
Identifies attempts to add a user to a privileged group. Attackers may add users to a privileged group in order to
establish persistence on a system.
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Linux User Added to Privileged Group"
note = """## Triage and analysis

### Investigating Linux User Added to Privileged Group

The `usermod`, `adduser`, and `gpasswd` commands can be used to assign user accounts to new groups in Linux-based operating systems.

Attackers may add users to a privileged group in order to escalate privileges or establish persistence on a system or domain.

This rule identifies the usages of `usermod`, `adduser` and `gpasswd` to assign user accounts to a privileged group.

> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
> This investigation guide uses [placeholder fields](https://www.elastic.co/guide/en/security/current/osquery-placeholder-fields.html) to dynamically pass alert data into Osquery queries. Placeholder fields were introduced in Elastic Stack version 8.7.0. If you're using Elastic Stack version 8.6.0 or earlier, you'll need to manually adjust this investigation guide's queries to ensure they properly run.

#### Possible investigation steps

- Investigate whether the user was successfully added to the privileged group.
  - $osquery_0
- Investigate whether the user is currently logged in and active.
  - $osquery_1
- Retrieve information about the privileged group to which the user was added.
  - $osquery_2
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
  - $osquery_3
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user/host during the past 48 hours.

### False positive analysis

- Adding accounts to a group is a common administrative task, so there is a high chance of the activity being legitimate. Before investigating further, verify that this activity is not benign.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
- Delete the account that seems to be involved in malicious activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://www.elastic.co/security-labs/primer-on-persistence-mechanisms"]
risk_score = 21
rule_id = "43d6ec12-2b1c-47b5-8f35-e9de65551d3b"
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",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Auditd Manager",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.executable != null and process.args in (
  "root", "admin", "wheel", "staff", "sudo","disk", "video", "shadow", "lxc", "lxd"
) and
(
  process.name in ("usermod", "adduser") or
  (process.name == "gpasswd" and process.args in ("-a", "--add", "-M", "--members"))
) and
not (
  ?process.parent.executable like (
    "/usr/lib/google/guest_agent/core_plugin", "/usr/libexec/platform-python*", "/usr/lib/google/guest_agent/GuestAgentCorePlugin/core_plugin",
    "/usr/bin/google_guest_agent"
  ) or
  (
    ?process.entry_leader.executable == "/usr/lib/venv-salt-minion/bin/python.original" and
    ?process.entry_leader.args == "/usr/lib/venv-salt-minion/bin/salt-minion"
  )
)
'''

[[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.007"
name = "Additional Local or Domain Groups"
reference = "https://attack.mitre.org/techniques/T1098/007/"

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.007"
name = "Additional Local or Domain Groups"
reference = "https://attack.mitre.org/techniques/T1098/007/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.executable != null and process.args in (
  "root", "admin", "wheel", "staff", "sudo","disk", "video", "shadow", "lxc", "lxd"
) and
(
  process.name in ("usermod", "adduser") or
  (process.name == "gpasswd" and process.args in ("-a", "--add", "-M", "--members"))
) and
not (
  ?process.parent.executable like (
    "/usr/lib/google/guest_agent/core_plugin", "/usr/libexec/platform-python*", "/usr/lib/google/guest_agent/GuestAgentCorePlugin/core_plugin",
    "/usr/bin/google_guest_agent"
  ) or
  (
    ?process.entry_leader.executable == "/usr/lib/venv-salt-minion/bin/python.original" and
    ?process.entry_leader.args == "/usr/lib/venv-salt-minion/bin/salt-minion"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ProcessRollup2
  • exec
  • exec_event
  • executed
  • process_started
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argsin
  • --add
  • --members
  • -M
  • -a
  • admin
  • disk
  • lxc
  • lxd
  • root
  • shadow
  • staff
  • sudo
  • video
  • wheel
field:"process.args" kind:in
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.nameeq
  • gpasswd
field:"process_basename" kind:eq value:"gpasswd"
process.namein
  • adduser
  • usermod
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.entry_leader.argseq/usr/lib/venv-salt-minion/bin/salt-minionexcludes:process.entry_leader.args field:"process.entry_leader.args" value:"/usr/lib/venv-salt-minion/bin/salt-minion"
process.entry_leader.executableeq/usr/lib/venv-salt-minion/bin/python.originalexcludes:process.entry_leader.executable field:"process.entry_leader.executable" value:"/usr/lib/venv-salt-minion/bin/python.original"
process.parent.executablewildcard/usr/lib/google/guest_agent/core_plugin, /usr/libexec/platform-python*, /usr/lib/google/guest_agent/GuestAgentCorePlugin/core_plugin, /usr/bin/google_guest_agentexcludes:process.parent.executable

M365 Exchange Mail Flow Transport Rule Modified

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

Identifies when a transport rule has been disabled or deleted in Microsoft 365. Mail flow rules (also known as transport rules) are used to identify and take action on messages that flow through your organization. An adversary or insider threat may modify a transport rule to exfiltrate data or evade defenses.

Known False Positives

  • A transport rule may be modified by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment
Exfiltration

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when a transport rule has been disabled or deleted in Microsoft 365. Mail flow rules (also known as transport
rules) are used to identify and take action on messages that flow through your organization. An adversary or insider
threat may modify a transport rule to exfiltrate data or evade defenses.
"""
false_positives = [
    """
    A transport rule may be modified by a system or network administrator. Verify that the configuration change was
    expected. Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Mail Flow Transport Rule Modified"
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 M365 Exchange Mail Flow Transport Rule Modified

Microsoft 365 Exchange transport rules manage email flow by setting conditions and actions for messages. Adversaries may exploit these rules to disable or delete them, facilitating data exfiltration or bypassing security measures. The detection rule monitors audit logs for successful execution of commands that alter these rules, signaling potential misuse and enabling timely investigation.

### Possible investigation steps

- Review the audit logs for the specific event.dataset:o365.audit entries with event.provider:Exchange to confirm the occurrence of the "Remove-TransportRule" or "Disable-TransportRule" actions.
- Identify the user account associated with the event by examining the user information in the audit logs to determine if the action was performed by an authorized individual or a potential adversary.
- Check the event.category:web context to understand if the action was performed through a web interface, which might indicate a compromised account or unauthorized access.
- Investigate the event.outcome:success to ensure that the rule modification was indeed successful and not an attempted action.
- Correlate the timing of the rule modification with other security events or alerts to identify any concurrent suspicious activities that might suggest a broader attack or data exfiltration attempt.
- Assess the impact of the rule modification by reviewing the affected transport rules to determine if they were critical for security or compliance, and evaluate the potential risk to the organization.

### False positive analysis

- Routine administrative changes to transport rules by IT staff can trigger alerts. To manage this, maintain a list of authorized personnel and their expected activities, and create exceptions for these users in the monitoring system.
- Scheduled maintenance or updates to transport rules may result in false positives. Document these activities and adjust the monitoring system to temporarily exclude these events during known maintenance windows.
- Automated scripts or third-party tools that manage transport rules might cause alerts. Identify these tools and their typical behavior, then configure the monitoring system to recognize and exclude these benign actions.
- Changes made as part of compliance audits or security assessments can be mistaken for malicious activity. Coordinate with audit teams to log these activities separately and adjust the monitoring system to account for these legitimate changes.

### Response and remediation

- Immediately disable any compromised accounts identified in the audit logs to prevent further unauthorized modifications to transport rules.
- Revert any unauthorized changes to transport rules by restoring them to their previous configurations using backup data or logs.
- Conduct a thorough review of all transport rules to ensure no additional unauthorized modifications have been made, and confirm that all rules align with organizational security policies.
- Implement additional monitoring on the affected accounts and transport rules to detect any further suspicious activities or attempts to modify rules.
- Escalate the incident to the security operations team for a deeper investigation into potential data exfiltration activities and to assess the scope of the breach.
- Coordinate with legal and compliance teams to determine if any regulatory reporting is required due to potential data exfiltration.
- Enhance security measures by enabling multi-factor authentication (MFA) for all administrative accounts and reviewing access permissions to ensure the principle of least privilege is enforced.

## Setup

The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/powershell/module/exchange/remove-transportrule?view=exchange-ps",
    "https://docs.microsoft.com/en-us/powershell/module/exchange/disable-transportrule?view=exchange-ps",
    "https://docs.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rules",
]
risk_score = 47
rule_id = "272a6484-2663-46db-a532-ef734bf9a796"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Microsoft 365", "Use Case: Configuration Audit", "Tactic: Exfiltration", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:("Remove-TransportRule" or "Disable-TransportRule") and event.outcome:success
'''


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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:("Remove-TransportRule" or "Disable-TransportRule") and event.outcome:success

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • o365.audit corpus 38 (elastic 38)
field:"data_stream.dataset" kind:eq value:"o365.audit"
event.actionin
  • Disable-TransportRule
  • Remove-TransportRule
field:"EventType" kind:in
event.categoryeq
  • web corpus 20 (elastic 20)
field:"event.category" kind:eq value:"web"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • Exchange corpus 16 (elastic 16)
field:"Provider_Name" kind:eq value:"Exchange"

Node Script Execution and Immediate Deletion

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

Detects Node.js executing a JavaScript file followed by immediate deletion of that script. This anti-forensics pattern is used to execute malicious logic and then destroy the evidence, making post-incident inspection difficult. The tight timing window between execution and deletion distinguishes this from normal cleanup or build processes.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects Node.js executing a JavaScript file followed by immediate deletion of that script. This anti-forensics pattern
is used to execute malicious logic and then destroy the evidence, making post-incident inspection difficult. The tight
timing window between execution and deletion distinguishes this from normal cleanup or build processes.
"""
id = "1059825f-8f64-4b69-a398-2a54003d1946"
license = "Elastic License v2"
name = "Node Script Execution and Immediate Deletion"
os_list = ["macos"]
reference = ["https://www.elastic.co/security-labs/axios-supply-chain-compromise-detections"]
version = "1.0.2"

query = '''
sequence by process.entity_id with maxspan=10s
  [process where event.type == "start" and event.action in ("exec", "start") and
    process.name in ("node", "node.exe") and process.args_count <= 2 and
    process.args like~ (
      "/tmp/*.js", "/private/tmp/*.js",
      "/var/tmp/*.js", "/private/var/tmp/*.js",
      "/Users/Shared/*.js",
      "/var/folders/*/T/*.js", "/private/var/folders/*/T/*.js",
      "/Users/*/Library/Caches/*.js",
      "/dev/shm/*.js",
      "?:\\\\Users\\\\*\\\\AppData\\\\Local\\\\Temp\\\\*.js",
      "?:\\\\Windows\\\\Temp\\\\*.js",
      "?:\\\\ProgramData\\\\Temp\\\\*.js"
    )] as event0
  [file where event.action == "deletion" and file.extension : "js" and
   stringcontains~(event0.process.command_line, file.name) and
   not (
     process.executable like "/actions-runner/externals/node24/bin/node" and
     file.path like (
       "/tmp/github-runner-*/index.js",
       "/root/setup-pnpm/node_modules/.pnpm/pnpm@*/node_modules/pnpm/dist/node_modules/env-paths/index.js"
     )
   )]
'''

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

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

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action in ("exec", "start") and
    process.name in ("node", "node.exe") and process.args_count <= 2 and
    process.args like~ (
      "/tmp/*.js", "/private/tmp/*.js",
      "/var/tmp/*.js", "/private/var/tmp/*.js",
      "/Users/Shared/*.js",
      "/var/folders/*/T/*.js", "/private/var/folders/*/T/*.js",
      "/Users/*/Library/Caches/*.js",
      "/dev/shm/*.js",
      "?:\\\\Users\\\\*\\\\AppData\\\\Local\\\\Temp\\\\*.js",
      "?:\\\\Windows\\\\Temp\\\\*.js",
      "?:\\\\ProgramData\\\\Temp\\\\*.js"
    )] as event0

Stage 2: file

[file where event.action == "deletion" and file.extension : "js" and
   stringcontains~(event0.process.command_line, file.name) and
   not (
     process.executable like "/actions-runner/externals/node24/bin/node" and
     file.path like (
       "/tmp/github-runner-*/index.js",
       "/root/setup-pnpm/node_modules/.pnpm/pnpm@*/node_modules/pnpm/dist/node_modules/env-paths/index.js"
     )
   )]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • deletion corpus 13 (elastic 13)
field:"EventType" kind:eq value:"deletion"
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"
event0.process.command_linecontains
  • file.name (field reference)
field:"event0.process.command_line" kind:contains value:"file.name"
file.extensionwildcard
  • js corpus 22 (elastic 22)
field:"file.extension" kind:wildcard value:"js"
process.argswildcard
  • /Users/*/Library/Caches/*.js corpus 2 (elastic 2)
  • /Users/Shared/*.js corpus 2 (elastic 2)
  • /dev/shm/*.js corpus 3 (elastic 3)
  • /private/tmp/*.js corpus 2 (elastic 2)
  • /private/var/folders/*/T/*.js corpus 2 (elastic 2)
  • /private/var/tmp/*.js corpus 2 (elastic 2)
  • /tmp/*.js corpus 3 (elastic 3)
  • /var/folders/*/T/*.js corpus 2 (elastic 2)
  • /var/tmp/*.js corpus 3 (elastic 3)
  • ?:\\ProgramData\\Temp\\*.js corpus 2 (elastic 2)
  • ?:\\Users\\*\\AppData\\Local\\Temp\\*.js corpus 2 (elastic 2)
  • ?:\\Windows\\Temp\\*.js corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.args_countle
  • 2 transforms: number corpus 17 (elastic 17)
field:"process.args_count" kind:le value:"2"
process.namein
  • node corpus 25 (elastic 25)
  • node.exe corpus 6 (elastic 6)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard/tmp/github-runner-*/index.js, /root/setup-pnpm/node_modules/.pnpm/pnpm@*/node_modules/pnpm/dist/node_modules/env-paths/index.jsexcludes:file.path field:"file.path" value:"/tmp/github-runner-*/index.js" field:"file.path" value:"/root/setup-pnpm/node_modules/.pnpm/pnpm@*/node_modules/pnpm/dist/node_modules/env-paths/index.js"
process.executableeq/actions-runner/externals/node24/bin/nodeexcludes:process.executable field:"process.executable" value:"/actions-runner/externals/node24/bin/node"

Potential PackageKit TOCTOU Privilege Escalation via CVE-2026-41651

#
Time window
1m
Source
github.com/elastic/protections-artifacts

Detects execution from a Debian postinst followed by a process whose executable path appears in that earlier command line while effective user ID is root and real user ID is not zero. This matches malicious package post-install dropping a setuid-style binary and aligns with CVE-2026-41651 PackageKit TOCTOU local privilege escalation behavior.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects execution from a Debian postinst followed by a process whose executable path appears in that earlier command
line while effective user ID is root and real user ID is not zero. This matches malicious package post-install dropping
a setuid-style binary and aligns with CVE-2026-41651 PackageKit TOCTOU local privilege escalation behavior.
"""
id = "8f3e1c62-4a8b-4d91-b9e7-ace24165100a"
license = "Elastic License v2"
name = "Potential PackageKit TOCTOU Privilege Escalation via CVE-2026-41651"
os_list = ["linux"]
reference = ["https://github.com/Vozec/CVE-2026-41651", "https://github.com/advisories/GHSA-f55j-vvr9-69xv"]
version = "1.0.1"

query = '''
sequence with maxspan=1m
  [process where event.type == "start" and event.action == "exec" and
   (
     process.parent.executable like "/var/lib/dpkg/info/*.postinst" or
     process.parent.args like "/var/lib/dpkg/info/*.postinst"
   )
  ] as event0
  [process where event.type == "start" and event.action == "exec" and user.id == 0 and
   user.Ext.real.id != 0 and stringcontains~(event0.process.command_line, process.executable)]
'''

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

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

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

[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"



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

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

Stage 1: process

[process where event.type == "start" and event.action == "exec" and
   (
     process.parent.executable like "/var/lib/dpkg/info/*.postinst" or
     process.parent.args like "/var/lib/dpkg/info/*.postinst"
   )
  ] as event0

Stage 2: process

[process where event.type == "start" and event.action == "exec" and user.id == 0 and
   user.Ext.real.id != 0 and stringcontains~(event0.process.command_line, process.executable)]

Indicators

These rows show field, operator, and value matches.

Potential Proxy Execution via Split

#
Source
github.com/elastic/protections-artifacts

This rule detects the execution of a command or binary through the split binary. Attackers may use this technique to execute commands while attempting to evade detection.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the execution of a command or binary through the split binary. Attackers may use this technique to
execute commands while attempting to evade detection.
"""
id = "0c63849b-2e23-4720-9608-0a402d093d3c"
license = "Elastic License v2"
name = "Potential Proxy Execution via Split"
os_list = ["linux"]
reference = ["https://gtfobins.github.io/gtfobins/split/"]
version = "1.0.3"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "split" and
process.args : "--filter=*" and process.args_count >= 3
'''

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

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

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



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


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

[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 == "split" and
process.args : "--filter=*" and process.args_count >= 3

Indicators

These rows show field, operator, and value matches.

PowerShell Obfuscation via Negative Index String Reversal

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

Detects PowerShell scripts that uses negative index ranges (for example, $var[-1..0]) to reverse strings or arrays and rebuild content at runtime. Attackers use index reversal to reconstruct hidden commands or payloads and evade static analysis and AMSI.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/04/14"
integration = ["windows"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Detects PowerShell scripts that uses negative index ranges (for example, $var[-1..0]) to reverse strings or arrays and
rebuild content at runtime. Attackers use index reversal to reconstruct hidden commands or payloads and evade static
analysis and AMSI.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "PowerShell Obfuscation via Negative Index String Reversal"
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 PowerShell Obfuscation via Negative Index String Reversal

This alert flags PowerShell script block content that uses negative index ranges to reverse strings or arrays and rebuild content at runtime. This pattern can be used to hide command text and reduce readability during review, so the primary goal is to recover the reconstructed content and determine what it does in the observed execution context.

#### 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.
- `file.path`, `file.directory`, `file.name`: File-origin context when the script block is sourced from an on-disk file.
- `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.
- `Esql.script_block_tmp`: Transformed script block where detection patterns replace original content with a marker to support scoring/counting and quickly spot match locations.
- `Esql.script_block_pattern_count`: Count of matches for the detection pattern(s) observed in the script block content.
- `powershell.file.script_block_entropy_bits`: Shannon entropy of the script block. Higher values may indicate obfuscation.
- `powershell.file.script_block_surprisal_stdev`: Standard deviation of surprisal across the script block. Low values indicate uniform randomness. High values indicate mixed patterns and variability.
- `powershell.file.script_block_unique_symbols`: Count of distinct characters present in the script block.
- `powershell.file.script_block_length`: Script block length (size) context.

#### Possible investigation steps

- Review `powershell.file.script_block_text` and locate the reversal logic. Use `Esql.script_block_tmp` to quickly find match positions, then identify:
  - The variable or array being reversed
  - The reconstructed output (string, byte array, or command fragment)
  - The sink where the output is used (for example, passed into a dynamic execution routine, used as a URL, or written to disk)
- Reconstruct the final value produced by the reversal. Focus on what the script is trying to rebuild (commands, URLs, file paths, registry paths, encoded blobs, or arguments) and record the recovered strings for scoping.
- If the script block is fragmented, pivot on `powershell.file.script_block_id` and use `powershell.sequence` and `powershell.total` to rebuild the full script in order. Reassess intent based on the complete content rather than a single fragment.
- Use `Esql.script_block_pattern_count` to prioritize reviews:
  - Single-use reversal may be utility logic and requires context to judge
  - Repeated reversal across a long script is more consistent with obfuscation wrappers
- Use script complexity signals to guide triage:
  - High `powershell.file.script_block_entropy_bits` and high `powershell.file.script_block_unique_symbols` can indicate encoded or staged content
  - Compare `powershell.file.script_block_surprisal_stdev` with the script content to determine whether the script mixes readable logic with high-randomness segments
- Validate execution context with `user.name`, `user.domain`, `user.id`, `host.name`, and `host.id`. Prioritize investigation when the user is unexpected for the host, the host is sensitive, or similar activity is new for that account.
- Review `file.path`, `file.directory`, and `file.name` (if present) to understand script origin. Treat unknown locations, new or renamed scripts, and ambiguous naming as higher risk, and check for additional script blocks tied to the same path.
- Scope related activity by searching for additional PowerShell script block events on the same `host.id` and `user.id` around `@timestamp`, and by pivoting on the same `powershell.file.script_block_id`. Look for:
  - Follow-on script blocks with clearer (deobfuscated) commands
  - Repeated use of similar reversal segments or reconstructed indicators
- If other endpoint telemetry is available, correlate activity on the same host and time window to identify what happened next (process launches, network connections, file writes, or other changes) and validate whether outcomes align with the reconstructed content.

### False positive analysis

- Legitimate scripts may reverse arrays or strings for formatting, parsing, or testing. These cases typically remain readable end-to-end and do not rely on multiple layers of reconstruction to produce executable behavior.
- Developer utilities and automation tooling can include dense string manipulation. Validate whether the observed `file.path` and execution context (`user.name`, `host.name`) align with approved workflows and whether the same script content recurs consistently across expected hosts.
- If activity is confirmed benign, prefer context-based tuning using stable attributes visible in the alert (for example, consistent `file.path` and recognizable script content patterns) rather than suppressing the technique broadly.

### Response and remediation

- If the reconstructed content indicates malicious behavior, isolate the affected host to limit further execution and reduce the risk of lateral movement.
- Preserve evidence by retaining the full `powershell.file.script_block_text` and all related fragments grouped by `powershell.file.script_block_id`. Capture the reconstructed strings and relevant metadata (`powershell.sequence`, `powershell.total`, `Esql.script_block_pattern_count`) in case notes.
- Identify and contain the execution source. If an unauthorized on-disk script is referenced by `file.path`, remove or quarantine it and investigate how it was introduced using your standard incident response workflow.
- Investigate the associated account (`user.id`) for signs of compromise. Apply account controls (credential reset, session invalidation, privilege review) based on your procedures and observed scope.
- Hunt for additional exposure by pivoting on recovered indicators and on recurrence of the reversal technique across hosts and users. Remediate any additional impacted endpoints identified during scoping.
- After containment, improve preventative controls appropriate for your environment, such as restricting PowerShell usage to approved users/hosts and enhancing monitoring for obfuscation and dynamic execution patterns.
"""
risk_score = 21
rule_id = "9edd1804-83c7-4e48-b97d-c776b4c97564"
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 = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: PowerShell Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-windows.powershell_operational* metadata _id, _version, _index
| where event.code == "4104"

// Filter out smaller scripts that are unlikely to implement obfuscation using the patterns we are looking for
| eval Esql.script_block_length = length(powershell.file.script_block_text)
| where Esql.script_block_length > 500

// replace the patterns we are looking for with the 🔥 emoji to enable counting them
// The emoji is used because it's unlikely to appear in scripts and has a consistent character length of 1
| eval Esql.script_block_tmp = replace(
    powershell.file.script_block_text,
    """\$\w+\[\-\s?1\.\.""",
    "🔥"
)

// count how many patterns were detected by calculating the number of 🔥 characters inserted
| eval Esql.script_block_pattern_count = length(Esql.script_block_tmp) - length(replace(Esql.script_block_tmp, "🔥", ""))

// keep the fields relevant to the query, although this is not needed as the alert is populated using _id
| keep
    Esql.script_block_pattern_count,
    Esql.script_block_length,
    Esql.script_block_tmp,
    powershell.file.*,
    file.name,
    file.path,
    powershell.sequence,
    powershell.total,
    _id,
    _version,
    _index,
    host.name,
    host.id,
    agent.id,
    user.id

// Filter for scripts that match the pattern at least once
| where Esql.script_block_pattern_count >= 1

// FP Patterns
| where not powershell.file.script_block_text like "*GENESIS-5654*"

| where file.name not like ("PSFzf.psm1", "Tenable_API_AssetLists_IPv6Seeder.ps1", "Utility.ps1")
  // ESQL requires this condition, otherwise it only returns matches where file.name exists.
  or file.name is null
'''


[[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.010"
name = "Command Obfuscation"
reference = "https://attack.mitre.org/techniques/T1027/010/"

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

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

[[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.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: from

from logs-windows.powershell_operational* metadata _id, _version, _index

Stage 2: where

| where event.code == "4104"

Stage 3: eval

| eval Esql.script_block_length = length(powershell.file.script_block_text)

Stage 4: where

| where Esql.script_block_length > 500

Stage 5: eval

| eval Esql.script_block_tmp = replace(
    powershell.file.script_block_text,
    """\$\w+\[\-\s?1\.\.""",
    "🔥"
)

Stage 6: eval

| eval Esql.script_block_pattern_count = length(Esql.script_block_tmp) - length(replace(Esql.script_block_tmp, "🔥", ""))

Stage 7: keep

| keep
    Esql.script_block_pattern_count,
    Esql.script_block_length,
    Esql.script_block_tmp,
    powershell.file.*,
    file.name,
    file.path,
    powershell.sequence,
    powershell.total,
    _id,
    _version,
    _index,
    host.name,
    host.id,
    agent.id,
    user.id

Stage 8: where

| where Esql.script_block_pattern_count >= 1

Stage 9: where

| where not powershell.file.script_block_text like "*GENESIS-5654*"

Stage 10: where

| where file.name not like ("PSFzf.psm1", "Tenable_API_AssetLists_IPv6Seeder.ps1", "Utility.ps1")
  or file.name is null

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
powershell.file.script_block_textmatchGENESIS-5654excludes:powershell.file.script_block_text field:"powershell.file.script_block_text" value:"GENESIS-5654"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.script_block_pattern_countKEEP Esql.script_block_pattern_count
Esql.script_block_lengthKEEP Esql.script_block_length
Esql.script_block_tmpKEEP Esql.script_block_tmp
powershell.file.*KEEP powershell.file.*
file.nameKEEP file.name
file.pathKEEP file.path
powershell.sequenceKEEP powershell.sequence
powershell.totalKEEP powershell.total
_idKEEP _id
_versionKEEP _version
_indexKEEP _index
host.nameKEEP host.name
host.idKEEP host.id
agent.idKEEP agent.id
user.idKEEP user.id

PsExec Network Connection

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

Identifies use of the SysInternals tool PsExec.exe making a network connection. This could be an indication of lateral movement.

Known False Positives

  • PsExec is a dual-use tool that can be used for benign or malicious activity. It's important to baseline your environment to determine the amount of noise to expect from this tool.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies use of the SysInternals tool PsExec.exe making a network connection. This could be an indication of lateral
movement.
"""
false_positives = [
    """
    PsExec is a dual-use tool that can be used for benign or malicious activity. It's important to baseline your
    environment to determine the amount of noise to expect from this tool.
    """,
]
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.network-*",
    "logs-windows.sysmon_operational-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "PsExec Network Connection"
note = """## Triage and analysis

### Investigating PsExec Network Connection

PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. Microsoft develops it as part of the Sysinternals Suite. Although commonly used by administrators, PsExec is frequently used by attackers to enable lateral movement and execute commands as SYSTEM to disable defenses and bypass security protections.

This rule identifies PsExec execution by looking for the creation of `PsExec.exe`, the default name for the utility, followed by a network connection done by the process.

#### Possible investigation steps

- Check if the usage of this tool complies with the organization's administration policy.
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Identify the target computer and its role in the IT environment.
- Investigate what commands were run, and assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.

### False positive analysis

- This mechanism can be used legitimately. As long as the analyst did not identify suspicious activity related to the user or involved hosts, and the tool is allowed by the organization's policy, such alerts can be dismissed.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
  - Prioritize cases involving critical servers and users.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""

setup = """## Setup

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

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

### Additional data sources

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

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

risk_score = 21
rule_id = "55d551c6-333b-4665-ab7e-5d14a59715ce"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Lateral Movement",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
]
type = "eql"

query = '''
sequence by process.entity_id
  [process where host.os.type == "windows" and event.type == "start" and
   (process.name : "PsExec.exe" or ?process.pe.original_file_name : "psexec.c") and

   /* This flag suppresses the display of the license dialog and may
      indicate that psexec executed for the first time in the machine */
   process.args : "-accepteula" and

   not process.executable : ("?:\\ProgramData\\Docusnap\\Discovery\\discovery\\plugins\\17\\Bin\\psexec.exe",
                             "?:\\Docusnap 11\\Bin\\psexec.exe",
                             "?:\\Program Files\\Docusnap X\\Bin\\psexec.exe",
                             "?:\\Program Files\\Docusnap X\\Tools\\dsDNS.exe") and
   not process.parent.executable : "?:\\Program Files (x86)\\Cynet\\Cynet Scanner\\CynetScanner.exe"]
  [network where host.os.type == "windows"]
'''


[[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/"
[[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.technique]]
id = "T1570"
name = "Lateral Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1570/"


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

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "windows" and event.type == "start" and
   (process.name : "PsExec.exe" or ?process.pe.original_file_name : "psexec.c") and

   /* This flag suppresses the display of the license dialog and may
      indicate that psexec executed for the first time in the machine */
   process.args : "-accepteula" and

   not process.executable : ("?:\\ProgramData\\Docusnap\\Discovery\\discovery\\plugins\\17\\Bin\\psexec.exe",
                             "?:\\Docusnap 11\\Bin\\psexec.exe",
                             "?:\\Program Files\\Docusnap X\\Bin\\psexec.exe",
                             "?:\\Program Files\\Docusnap X\\Tools\\dsDNS.exe") and
   not process.parent.executable : "?:\\Program Files (x86)\\Cynet\\Cynet Scanner\\CynetScanner.exe"]

Stage 2: network

[network where host.os.type == "windows"]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\ProgramData\Docusnap\Discovery\discovery\plugins\17\Bin\psexec.exe, ?:\Docusnap 11\Bin\psexec.exe, ?:\Program Files\Docusnap X\Bin\psexec.exe, ?:\Program Files\Docusnap X\Tools\dsDNS.exeexcludes:process.executable
process.parent.executableeq?:\Program Files (x86)\Cynet\Cynet Scanner\CynetScanner.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Cynet\Cynet Scanner\CynetScanner.exe"

Sensitive Hive Access via Registry Backup

#
Source
github.com/elastic/protections-artifacts

Identifies access attempts to sensitive registry hives like the Security Account Manager (SAM) database file from the registry backdup folder. Adversaries may use this option to evade detections looking for registry hive direct access.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies access attempts to sensitive registry hives like the Security Account Manager (SAM) database file from the
registry backdup folder. Adversaries may use this option to evade detections looking for registry hive direct access.
"""
id = "87a465e3-b8a2-4df7-9590-86782aa0546c"
license = "Elastic License v2"
name = "Sensitive Hive Access via Registry Backup"
os_list = ["windows"]
version = "1.0.3"

query = '''
file where event.action == "open" and event.outcome == "success" and
 file.path :
      ("?:\\Windows\\System32\\config\\RegBack\\SAM",
       "?:\\Windows\\System32\\config\\RegBack\\SECURITY",
       "?:\\Windows\\System32\\config\\RegBack\\SYSTEM") and
 user.id != null and process.executable : "?:\\*" and process.pid != 4 and
 not process.executable :
             ("?:\\Windows\\System32\\svchost.exe",
              "?:\\Program Files (x86)\\*",
              "?:\\Program Files\\*",
              "?:\\Windows\\System32\\wuauclt.exe",
              "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe",
              "?:\\Windows\\System32\\vmwp.exe",
              "?:\\Windows\\System32\\Dism.exe",
              "?:\\Windows\\System32\\wbengine.exe",
              "?:\\Windows\\System32\\mmc.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe",
              "?:\\Windows\\System32\\sppsvc.exe",
              "?:\\Windows\\System32\\backgroundTaskHost.exe",
              "?:\\Windows\\System32\\lsass.exe",
              "?:\\Windows\\System32\\taskhostw.exe",
              "?:\\Windows\\System32\\taskhost.exe",
              "?:\\Windows\\System32\\SearchProtocolHost.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*.exe",
              "?:\\Program Files\\Windows Defender Advanced Threat Protection\\*.exe",
              "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\*.exe",
              "?:\\Windows\\System32\\SrTasks.exe",
              "?:\\Windows\\System32\\rstrui.exe",
              "?:\\Windows\\System32\\MRT.exe",
              "?:\\Windows\\System32\\conhost.exe") and

 not (process.code_signature.trusted == true and
      process.code_signature.subject_name :
         ("ESET, spol. s r.o.", "Commvault Systems, Inc.", "Eric R. Zimmerman", "EFOLDER, INC.", "Absolute Software Corp.",
          "Refraction Point, Inc"))
'''

min_endpoint_version = "8.0.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 = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.002"
name = "Security Account Manager"
reference = "https://attack.mitre.org/techniques/T1003/002/"



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

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

Stage 1: file

file where event.action == "open" and event.outcome == "success" and
 file.path :
      ("?:\\Windows\\System32\\config\\RegBack\\SAM",
       "?:\\Windows\\System32\\config\\RegBack\\SECURITY",
       "?:\\Windows\\System32\\config\\RegBack\\SYSTEM") and
 user.id != null and process.executable : "?:\\*" and process.pid != 4 and
 not process.executable :
             ("?:\\Windows\\System32\\svchost.exe",
              "?:\\Program Files (x86)\\*",
              "?:\\Program Files\\*",
              "?:\\Windows\\System32\\wuauclt.exe",
              "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe",
              "?:\\Windows\\System32\\vmwp.exe",
              "?:\\Windows\\System32\\Dism.exe",
              "?:\\Windows\\System32\\wbengine.exe",
              "?:\\Windows\\System32\\mmc.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe",
              "?:\\Windows\\System32\\sppsvc.exe",
              "?:\\Windows\\System32\\backgroundTaskHost.exe",
              "?:\\Windows\\System32\\lsass.exe",
              "?:\\Windows\\System32\\taskhostw.exe",
              "?:\\Windows\\System32\\taskhost.exe",
              "?:\\Windows\\System32\\SearchProtocolHost.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe",
              "?:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*.exe",
              "?:\\Program Files\\Windows Defender Advanced Threat Protection\\*.exe",
              "?:\\Program Files\\Microsoft Monitoring Agent\\Agent\\*.exe",
              "?:\\Windows\\System32\\SrTasks.exe",
              "?:\\Windows\\System32\\rstrui.exe",
              "?:\\Windows\\System32\\MRT.exe",
              "?:\\Windows\\System32\\conhost.exe") and

 not (process.code_signature.trusted == true and
      process.code_signature.subject_name :
         ("ESET, spol. s r.o.", "Commvault Systems, Inc.", "Eric R. Zimmerman", "EFOLDER, INC.", "Absolute Software Corp.",
          "Refraction Point, Inc"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
event.outcomeeq
  • success corpus 82 (elastic 82)
field:"event.outcome" kind:eq value:"success"
file.pathwildcard
  • ?:\Windows\System32\config\RegBack\SAM corpus 2 (elastic 2)
  • ?:\Windows\System32\config\RegBack\SECURITY corpus 2 (elastic 2)
  • ?:\Windows\System32\config\RegBack\SYSTEM corpus 2 (elastic 2)
field:"TargetFilename" kind:wildcard
process.executablewildcard
  • ?:\* corpus 18 (elastic 18)
field:"Image" kind:wildcard value:"?:\*"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
user.idis_not_null
  • (no value, null check)
field:"user.id" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqESET, spol. s r.o., Commvault Systems, Inc., Eric R. Zimmerman, EFOLDER, INC., Absolute Software Corp., Refraction Point, Incexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Windows\System32\svchost.exe, ?:\Program Files (x86)\*, ?:\Program Files\*, ?:\Windows\System32\wuauclt.exe, ?:\$WINDOWS.~BT\Sources\SetupHost.exe, ?:\Windows\System32\vmwp.exe, ?:\Windows\System32\Dism.exe, ?:\Windows\System32\wbengine.exe, ?:\Windows\System32\mmc.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*.exe, ?:\Windows\System32\sppsvc.exe, ?:\Windows\System32\backgroundTaskHost.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\System32\taskhostw.exe, ?:\Windows\System32\taskhost.exe, ?:\Windows\System32\SearchProtocolHost.exe, ?:\ProgramData\Microsoft\Windows Defender\Platform\*.exe, ?:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*.exe, ?:\Program Files\Windows Defender Advanced Threat Protection\*.exe, ?:\Program Files\Microsoft Monitoring Agent\Agent\*.exe, ?:\Windows\System32\SrTasks.exe, ?:\Windows\System32\rstrui.exe, ?:\Windows\System32\MRT.exe, ?:\Windows\System32\conhost.exeexcludes:process.executable

Suspicious Automator Workflows Execution

#
Time window
30s
Source
github.com/elastic/protections-artifacts

Identifies the execution of the Automator Workflows process followed by a network connection from the XPC service. Adversaries may drop a custom workflow template that hosts malicious JavaScript for Automation (JXA) code as an alternative to using osascript.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies the execution of the Automator Workflows process followed by a network connection from the XPC service.
Adversaries may drop a custom workflow template that hosts malicious JavaScript for Automation (JXA) code as an
alternative to using osascript.
"""
id = "e390d36d-c739-43ee-9e3d-5a76fa853bd5"
license = "Elastic License v2"
name = "Suspicious Automator Workflows Execution"
os_list = ["macos"]
reference = ["https://posts.specterops.io/persistent-jxa-66e1c3cd1cf5"]
version = "1.0.31"

query = '''
sequence with maxspan=30s
 [process where event.action == "exec" and process.name == "automator"]
 [network where process.name == "com.apple.automator.runner"]
'''

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

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



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: process

[process where event.action == "exec" and process.name == "automator"]

Stage 2: network

[network where process.name == "com.apple.automator.runner"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
process.nameeq
  • automator
  • com.apple.automator.runner
field:"process_basename" kind:eq

Suspicious Credential Files Creation via Kerberos

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

Identifies network connections to the standard Kerberos or SMB ports from an unusual process followed by the creation of a sensitive file such as kerberos ticket and certificate keys. On Windows, the only native system process that normally performs Kerberos traffic from a domain joined host is lsass.exe and SMB is the System virtual process. This may indicate an ongoing Kerberos attack.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies network connections to the standard Kerberos or SMB ports from an unusual process followed by the creation of
a sensitive file such as kerberos ticket and certificate keys. On Windows, the only native system process that normally
performs Kerberos traffic from a domain joined host is lsass.exe and SMB is the System virtual process. This may
indicate an ongoing Kerberos attack.
"""
id = "ced93ac0-f153-402f-9239-17ae32f304e2"
license = "Elastic License v2"
name = "Suspicious Credential Files Creation via Kerberos"
os_list = ["windows"]
reference = [
    "https://research.ifcr.dk/certipy-2-0-bloodhound-new-escalations-shadow-credentials-golden-certificates-and-more-34d1c26f0dc6",
    "https://posts.specterops.io/certified-pre-owned-d95910965cd2",
]
version = "1.0.30"

query = '''
sequence by process.entity_id with maxspan=1m

 [network where
   destination.port in (88, 445) and source.port >= 49152 and
   network.direction == "egress" and network.transport == "tcp" and
   process.pid != 4 and
   not process.executable :
              ("?:\\Windows\\System32\\lsass.exe",
               "\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
               "?:\\Program Files (x86)\\*.exe",
               "?:\\Program Files\\*.exe")]

 [file where event.action in ("creation", "overwrite") and

   /* dumping PFX, CCACHE or KIRBI via kerberos */
   (file.extension in~ ("ccache", "pfx", "kirbi") or file.Ext.header_bytes : ("0504*", "3082*", "768*")) and
   not (process.name : "powershell.exe" and file.path : "?:\\Windows\\ServiceProfiles\\LocalService\\AppData\\*") and
   not (process.code_signature.trusted == true and process.code_signature.subject_name in ("KASEYA US LLC", "The Apache Software Foundation")) and
   not file.path like "C:\\Users\\*\\AppData\\LocalLow\\Microsoft\\CryptnetUrlCache\\Content\\*"]
'''

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

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

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


[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"



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

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

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

Stage 1: network

[network where
   destination.port in (88, 445) and source.port >= 49152 and
   network.direction == "egress" and network.transport == "tcp" and
   process.pid != 4 and
   not process.executable :
              ("?:\\Windows\\System32\\lsass.exe",
               "\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
               "?:\\Program Files (x86)\\*.exe",
               "?:\\Program Files\\*.exe")]

Stage 2: file

[file where event.action in ("creation", "overwrite") and
   (file.extension in~ ("ccache", "pfx", "kirbi") or file.Ext.header_bytes : ("0504*", "3082*", "768*")) and
   not (process.name : "powershell.exe" and file.path : "?:\\Windows\\ServiceProfiles\\LocalService\\AppData\\*") and
   not (process.code_signature.trusted == true and process.code_signature.subject_name in ("KASEYA US LLC", "The Apache Software Foundation")) and
   not file.path like "C:\\Users\\*\\AppData\\LocalLow\\Microsoft\\CryptnetUrlCache\\Content\\*"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.portin
  • 445 transforms: number
  • 88 transforms: number
field:"DestinationPort" kind:in
event.actionin
  • creation corpus 32 (elastic 32)
  • overwrite corpus 8 (elastic 8)
field:"EventType" kind:in
file.Ext.header_byteswildcard
  • 0504*
  • 3082*
  • 768*
field:"file.Ext.header_bytes" kind:wildcard
file.extensionin
  • ccache
  • kirbi
  • pfx
field:"file.extension" kind:in
network.directioneq
  • egress corpus 13 (elastic 13)
field:"Initiated" kind:eq value:"egress"
network.transporteq
  • tcp corpus 16 (elastic 16)
field:"Protocol" kind:eq value:"tcp"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
source.portge
  • 49152 transforms: number corpus 16 (elastic 16)
field:"SourcePort" kind:ge value:"49152"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Windows\System32\lsass.exe, \Device\HarddiskVolume*\Windows\System32\lsass.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exeexcludes:process.executable
file.pathstarts_with?:\Windows\ServiceProfiles\LocalService\AppData\excludes:file.path field:"file.path" value:"?:\Windows\ServiceProfiles\LocalService\AppData\"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.code_signature.subject_nameinKASEYA US LLC, The Apache Software Foundationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"KASEYA US LLC" field:"process.code_signature.subject_name" value:"The Apache Software Foundation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
file.pathwildcardC:\Users\*\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*excludes:file.path field:"file.path" value:"C:\Users\*\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*"

Suspicious Executable Download via Curl

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

Detects when Curl is executed via Osascript or a shell interpreter and downloads an executable file to a suspicious location. Threat actors will often use Curl to download malicious executables to a temporary location on the system. The use of Curl via Osascript elevates the suspiciousness of the activity as Osascript is a scripting language that can be used to execute AppleScript commands. The combination of these two activities is indicative of a threat actor attempting to download and execute a malicious payload on the system.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when Curl is executed via Osascript or a shell interpreter and downloads an executable file to a suspicious
location. Threat actors will often use Curl to download malicious executables to a temporary location on the system. The
use of Curl via Osascript elevates the suspiciousness of the activity as Osascript is a scripting language that can be
used to execute AppleScript commands. The combination of these two activities is indicative of a threat actor attempting
to download and execute a malicious payload on the system.
"""
id = "845682d9-c4e9-4ae5-a303-3410a3d03824"
license = "Elastic License v2"
name = "Suspicious Executable Download via Curl"
os_list = ["macos"]
reference = ["https://x.com/MsftSecIntel/status/1891410993265123662"]
version = "1.0.6"

query = '''
sequence by process.entity_id with maxspan=30s
[process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and process.parent.name in ("osascript", "bash", "sh", "zsh")]
[file where event.action == "modification" and file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and file.path like ("/tmp/*", "/private/tmp/*", "/Users/Shared/*", "/Library/Caches/*", "/Library/Fonts/*") and Effective_process.name in ("curl", "nscurl")]
'''

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

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



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


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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and process.parent.name in ("osascript", "bash", "sh", "zsh")]

Stage 2: file

[file where event.action == "modification" and file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and file.path like ("/tmp/*", "/private/tmp/*", "/Users/Shared/*", "/Library/Caches/*", "/Library/Fonts/*") and Effective_process.name in ("curl", "nscurl")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Effective_process.namein
  • curl
  • nscurl
field:"Effective_process.name" kind:in
event.actioneq
  • exec corpus 547 (elastic 547)
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
file.Ext.header_byteswildcard
  • cafebabe* corpus 19 (elastic 19)
  • cffaedfe* corpus 19 (elastic 19)
field:"file.Ext.header_bytes" kind:wildcard
file.pathwildcard
  • /Library/Caches/*
  • /Library/Fonts/* corpus 2 (elastic 2)
  • /Users/Shared/* corpus 8 (elastic 8)
  • /private/tmp/* corpus 11 (elastic 11)
  • /tmp/* corpus 15 (elastic 15)
field:"TargetFilename" kind:wildcard
process.namein
  • curl corpus 82 (elastic 82)
  • nscurl corpus 41 (elastic 41)
field:"process_basename" kind:in
process.parent.namein
  • bash corpus 60 (elastic 60)
  • osascript corpus 9 (elastic 9)
  • sh corpus 60 (elastic 60)
  • zsh corpus 60 (elastic 60)
field:"parent_process_basename" kind:in

Suspicious File Rename from Unbacked Memory

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

Identifies a suspicious file rename operation from an unbacked memory region. This may indicate Ransomware behavior from an injected trusted process.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies a suspicious file rename operation from an unbacked memory region. This may indicate Ransomware behavior from
an injected trusted process.
"""
id = "adc08f95-6a12-441a-be30-0443d6ccae52"
license = "Elastic License v2"
name = "Suspicious File Rename from Unbacked Memory"
os_list = ["windows"]
version = "1.0.7"

query = '''
sequence by process.entity_id with maxspan=30s
[file where event.action : "rename" and
  process.code_signature.status : "trusted" and
  not process.code_signature.subject_name :
                          ("LEAP SOFTWARE DEVELOPMENTS PTY. LIMITED", "KASEYA US LLC",
                           "Chocolatey Software, Inc.", "Quadient Industrie France", "ACTIFILE LTD") and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url", "jpg",
                        "bmp", "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx") and
  process.thread.Ext.call_stack_summary :
                     ("ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|kernel32.dll|ntdll.dll",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
                      "ntdll.dll|Unbacked",
                      "Unbacked",
					  "Unknown")]
[file where event.action : "rename" and
  process.code_signature.status : "trusted" and
  not process.code_signature.subject_name : ("LEAP SOFTWARE DEVELOPMENTS PTY. LIMITED", "KASEYA US LLC", "Chocolatey Software, Inc.") and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url", "jpg",
                        "bmp", "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx") and
  process.thread.Ext.call_stack_summary :
                     ("ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|kernel32.dll|ntdll.dll",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
                      "ntdll.dll|Unbacked",
                      "Unbacked",
					  "Unknown")]
'''

min_endpoint_version = "8.7.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 = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"

[[threat.technique]]
id = "T1490"
name = "Inhibit System Recovery"
reference = "https://attack.mitre.org/techniques/T1490/"


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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

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

Stage 1: file

[file where event.action : "rename" and
  process.code_signature.status : "trusted" and
  not process.code_signature.subject_name :
                          ("LEAP SOFTWARE DEVELOPMENTS PTY. LIMITED", "KASEYA US LLC",
                           "Chocolatey Software, Inc.", "Quadient Industrie France", "ACTIFILE LTD") and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url", "jpg",
                        "bmp", "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx") and
  process.thread.Ext.call_stack_summary :
                     ("ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|kernel32.dll|ntdll.dll",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
                      "ntdll.dll|Unbacked",
                      "Unbacked",
					  "Unknown")]

Stage 2: file

[file where event.action : "rename" and
  process.code_signature.status : "trusted" and
  not process.code_signature.subject_name : ("LEAP SOFTWARE DEVELOPMENTS PTY. LIMITED", "KASEYA US LLC", "Chocolatey Software, Inc.") and
  file.extension != null and file.Ext.entropy >= 7 and
  file.Ext.original.name : ("*.jpg", "*.bmp", "*.png", "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.ppt", "*.pptx") and
  not file.extension : ("tmp", "~tmp", "diff", "gz", "download", "bak", "bck", "lnk", "part", "save", "url", "jpg",
                        "bmp", "png", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx") and
  process.thread.Ext.call_stack_summary :
                     ("ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll",
					  "ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|kernel32.dll|ntdll.dll",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",
                      "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll",
                      "ntdll.dll|Unbacked",
                      "Unbacked",
					  "Unknown")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionwildcard
  • rename corpus 10 (elastic 9, sigma 1)
field:"EventType" kind:wildcard value:"rename"
file.Ext.entropyge
  • 7 transforms: number corpus 4 (elastic 4)
field:"file.Ext.entropy" kind:ge value:"7"
file.Ext.original.namewildcard
  • *.bmp corpus 6 (elastic 6)
  • *.doc corpus 6 (elastic 6)
  • *.docx corpus 6 (elastic 6)
  • *.jpg corpus 6 (elastic 6)
  • *.pdf corpus 6 (elastic 6)
  • *.png corpus 6 (elastic 6)
  • *.ppt corpus 6 (elastic 6)
  • *.pptx corpus 6 (elastic 6)
  • *.xls corpus 6 (elastic 6)
  • *.xlsx corpus 6 (elastic 6)
field:"file.Ext.original.name" kind:wildcard
file.extensionis_not_null
  • (no value, null check)
field:"file.extension" kind:is_not_null
process.code_signature.statuswildcard
  • trusted corpus 6 (elastic 6)
field:"SignatureStatus" kind:wildcard value:"trusted"
process.thread.Ext.call_stack_summarywildcard
  • Unbacked
  • Unknown
  • ntdll.dll|Unbacked corpus 6 (elastic 6)
  • ntdll.dll|kernelbase.dll|Unbacked corpus 6 (elastic 6)
  • ntdll.dll|kernelbase.dll|Unknown|kernel32.dll|ntdll.dll
  • ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked corpus 4 (elastic 4)
  • ntdll.dll|kernelbase.dll|kernel32.dll|Unknown|kernel32.dll|ntdll.dll
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked corpus 5 (elastic 5)
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll corpus 4 (elastic 4)
field:"process.thread.Ext.call_stack_summary" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqtmp, ~tmp, diff, gz, download, bak, bck, lnk, part, save, url, jpg, bmp, png, pdf, doc, docx, xls, xlsx, ppt, pptxexcludes:file.extension
process.code_signature.subject_nameeqLEAP SOFTWARE DEVELOPMENTS PTY. LIMITED, KASEYA US LLC, Chocolatey Software, Inc., Quadient Industrie France, ACTIFILE LTDexcludes:process.code_signature.subject_name
process.code_signature.subject_nameeqLEAP SOFTWARE DEVELOPMENTS PTY. LIMITED, KASEYA US LLC, Chocolatey Software, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"LEAP SOFTWARE DEVELOPMENTS PTY. LIMITED" field:"process.code_signature.subject_name" value:"KASEYA US LLC" field:"process.code_signature.subject_name" value:"Chocolatey Software, Inc."

Suspicious Java Execution via a Windows Script

#
Source
github.com/elastic/protections-artifacts

Identifies when a Java archive is executed via a Windows Script. This may indicate an attempt to bypass application whitelisting by delivering malicious JAR file via a malicious Windows Jscript or Vbscript.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies when a Java archive is executed via a Windows Script. This may indicate an attempt to bypass application
whitelisting by delivering malicious JAR file via a malicious Windows Jscript or Vbscript.
"""
id = "15b1d979-5be0-4e7f-9202-0c4cfd76b146"
license = "Elastic License v2"
name = "Suspicious Java Execution via a Windows Script"
os_list = ["windows"]
version = "1.0.30"

query = '''
process where event.action == "start" and
  process.name : "Java*.exe" and process.executable : "?:\\Program Files*\\Java\\jre*\\bin\\java*.exe" and
  process.args : "-jar" and process.parent.name : ("wscript.exe", "cscript.exe") and
  process.command_line : ("*\\AppData\\*", "*\\Public\\*", "*\\ProgramData\\*")
'''

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

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

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.name : "Java*.exe" and process.executable : "?:\\Program Files*\\Java\\jre*\\bin\\java*.exe" and
  process.args : "-jar" and process.parent.name : ("wscript.exe", "cscript.exe") and
  process.command_line : ("*\\AppData\\*", "*\\Public\\*", "*\\ProgramData\\*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • -jar corpus 8 (elastic 8)
field:"process.args" kind:wildcard value:"-jar"
process.command_linewildcard
  • *\AppData\* corpus 11 (sigma 8, elastic 3)
  • *\ProgramData\* corpus 5 (sigma 3, elastic 1, splunk 1)
  • *\Public\*
field:"CommandLine" kind:wildcard
process.executablewildcard
  • ?:\Program Files*\Java\jre*\bin\java*.exe
field:"Image" kind:wildcard value:"?:\Program Files*\Java\jre*\bin\java*.exe"
process.namewildcard
  • Java*.exe corpus 2 (elastic 2)
field:"process_basename" kind:wildcard value:"Java*.exe"
process.parent.namewildcard
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_basename" kind:wildcard

System Path File Creation and Execution Detected via Defend for Containers

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

This rule detects when a process creates a file inside of a system binary location, inside of a running container. The system binary locations are /etc, /root, /bin, /usr/bin, /usr/local/bin, and /entrypoint. Adversaries may use these locations to create files that can be used to execute commands on the underlying host, or to evade detection by security controls.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects when a process creates a file inside of a system binary location, inside of a running
container. The system binary locations are /etc, /root, /bin, /usr/bin, /usr/local/bin, and /entrypoint. Adversaries
may use these locations to create files that can be used to execute commands on the underlying host, or to evade
detection by security controls.
"""
from = "now-6m"
index = ["logs-cloud_defend.file*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "System Path File Creation and Execution Detected via Defend for Containers"
note = """## Triage and analysis

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

### Investigating System Path File Creation and Execution Detected via Defend for Containers

This detects activity in a running Linux container creating new files under system binary paths like /etc, /root, /bin, /usr/bin, /usr/local/bin, or /entrypoint, which often signals an attempt to tamper with execution flow or hide tooling. Attackers commonly gain a shell, then use curl/wget (or a busybox variant) from a writable staging area to drop a new executable into /usr/local/bin or overwrite an entrypoint script to ensure their code runs on start.

### Possible investigation steps

- Capture the created file’s metadata (owner, permissions, timestamps) and contents/hash, then determine whether it is an executable/script or a modification to startup/auth/config behavior.  
- Compare the file and its path against the container image baseline (layer diff) to confirm it was introduced at runtime and identify the interactive command that created it.  
- Review the interactive session context (TTY, user, entry method) and surrounding command activity to assess intent and whether secrets or credentials were accessed.  
- Pivot to related activity from the same session such as outbound connections, additional downloads to writable staging areas, or subsequent execution of the new file to gauge impact and scope.  
- Check for persistence or host-impact setup by inspecting entrypoint/service definitions, PATH hijacks, mounted host paths, and any new cron/systemd/profile changes within the container.

### False positive analysis

- A container administrator troubleshooting interactively may use curl/wget (including via busybox wget) to fetch configuration or helper scripts and write them into /etc, /root, or /entrypoint to quickly test startup or runtime behavior changes.  
- An interactive maintenance session may execute a script staged in /tmp or /dev/shm that drops a small wrapper binary or symlink into /usr/local/bin or /usr/bin to temporarily add debugging utilities or adjust PATH-resolved command behavior during incident response.

### Response and remediation

- Isolate the impacted container by removing it from service and blocking its egress, then preserve the container filesystem (or take a snapshot) so the created artifacts under /etc, /root, /bin, /usr/bin, /usr/local/bin, or /entrypoint can be analyzed.  
- Identify and remove the dropped or modified file(s) and any related persistence (e.g., altered /entrypoint script, PATH-hijacking binaries, modified shell profiles), then stop any processes launched from writable staging paths like /tmp, /dev/shm, /var/tmp, /run, /var/run, or /mnt.  
- Redeploy the workload from a known-good image and verified configuration (including entrypoint and mounted volumes), rotate any secrets or tokens that could have been accessed in the interactive session, and validate the new pod/container does not recreate files in system binary locations.  
- Escalate immediately to the incident response team if the created file is executable, replaces an entrypoint, initiates outbound downloads or connections, or if multiple containers show similar drops in system binary paths suggesting broader compromise.  
- Harden by enforcing non-root, read-only root filesystem, and disallowing interactive exec into production containers, then restrict outbound network access and block write access to system binary locations via security policies and runtime controls."""
risk_score = 47
rule_id = "05a50000-9886-4695-ad33-3f990dc142e2"
severity = "medium"
tags = [
    "Data Source: Elastic Defend for Containers",
    "Domain: Container",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Command and Control",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "creation" and
file.path like (
  "/etc/*", "/root/*", "/bin/*", "/usr/bin/*", "/usr/local/bin/*", "/entrypoint*"
) and (
  process.name like ("wget", "curl") or
  (process.name == "busybox" and process.args == "wget") or
  process.executable like ("/tmp/*", "/dev/shm/*", "/var/tmp/*", "/run/*", "/var/run/*", "/mnt/*")
) and container.id like "?*"
'''

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

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

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

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

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

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.type == "creation" and
file.path like (
  "/etc/*", "/root/*", "/bin/*", "/usr/bin/*", "/usr/local/bin/*", "/entrypoint*"
) and (
  process.name like ("wget", "curl") or
  (process.name == "busybox" and process.args == "wget") or
  process.executable like ("/tmp/*", "/dev/shm/*", "/var/tmp/*", "/run/*", "/var/run/*", "/mnt/*")
) and container.id like "?*"

Indicators

These rows show field, operator, and value matches.

Unusual Executable File Creation by a System Critical Process

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

Identifies an unexpected executable file being created or modified by a Windows system critical process, which may indicate activity related to remote code execution or other forms of exploitation.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/08/19"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/04/30"

[rule]
author = ["Elastic"]
description = """
Identifies an unexpected executable file being created or modified by a Windows system critical process, which may
indicate activity related to remote code execution or other forms of exploitation.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.file-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Unusual Executable File Creation by a System Critical Process"
risk_score = 73
rule_id = "e94262f2-c1e9-4d3f-a907-aeab16712e1a"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Execution",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.type != "deletion" and
  file.extension : ("exe", "dll") and
  process.name : ("smss.exe",
                  "autochk.exe",
                  "csrss.exe",
                  "wininit.exe",
                  "services.exe",
                  "lsass.exe",
                  "winlogon.exe",
                  "userinit.exe",
                  "LogonUI.exe") and
  not (
    process.name : "smss.exe" and
    file.path : (
      "?:\\Windows\\System32\\wpbbin.exe",
      "\\Device\\HarddiskVolume*\\Windows\\System32\\wpbbin.exe"
    )
  ) and
  not (
    process.name : "lsass.exe" and
    file.path : (
      "?:\\Windows\\System32\\eac_usermode_*.dll",
      "\\Device\\HarddiskVolume*\\Windows\\System32\\eac_usermode_*.dll"
    )
  )
'''

note = """## Triage and analysis

### Investigating Unusual Executable File Creation by a System Critical Process

#### Possible investigation steps

- What exact critical-process write did the alert preserve?
  - Focus: `process.name`, `process.executable`, `file.path`, `file.extension`, and `event.action`; writer should match a critical-process name in the query.
  - Implication: escalate faster when it writes an EXE or DLL in user-writable, startup, temp, or other non-servicing paths; lower concern only for protected OS servicing paths or a repaired vendor product tree.
- Is the writer the expected protected Windows binary, not a masquerade or tampered copy?
  - Why: exploitation for defense evasion can preserve a genuine protected-process identity while changing what that process writes.
  - Focus: `process.executable`, `process.code_signature.subject_name`, and `process.code_signature.trusted`; recover `process.hash.sha256` and `process.pe.original_file_name` from matching process-start events on `host.id` and `process.entity_id` when absent. $investigate_1
  - Implication: escalate when path, signer, hash, or original file name conflicts with the expected critical process; if identity is the expected Microsoft binary, continue because exploitation can still force a genuine process to write attacker-controlled content.
- What launch and user context led to the write?
  - Why: client-side or service exploitation often appears as Office, browser, script, archive, or user-profile ancestry before an abnormal critical-process file write.
  - Focus: matching process-start event: `process.command_line`, `process.parent.executable`, `process.parent.command_line`, `process.Ext.ancestry`, and `user.id`.
  - Implication: escalate when the chain traces to Office, browser, script, archive, LOLBin, or user-profile activity before the critical-process write; lower concern only when parentage and user context align with OS servicing or one bounded product repair.
- Does the written artifact look staged or renamed rather than serviced?
  - Focus: `file.path`, `file.Ext.original.path`, `file.Ext.original.extension`, `file.Ext.header_bytes`, and `file.Ext.windows.zone_identifier`. $investigate_2
  - Implication: escalate when content is renamed into an executable extension, lands in a deceptive or writable path, carries internet provenance, or header bytes do not fit the file name.
- Did the written file become an execution target or command-line dependency?
  - Focus: same-writer file activity on `host.id` and `process.entity_id`, plus later process starts from `file.path`. $investigate_0
  - Hint: for EXE reuse, inspect later process starts where `process.executable` equals `file.path`; for DLL writes, search `process.command_line` for the path and treat a quiet result as unresolved, not benign. $investigate_5
  - Implication: escalate when the artifact executes or is referenced by follow-on commands; if the same-process file view is quiet, use the EXE or DLL recovery cue before lowering urgency.
- If local evidence remains suspicious or unresolved, does the artifact pattern recur on this host or other hosts?
  - Focus: related alerts for the same written `file.path`; add writer `process.executable` only after alert or identity confirms it. $investigate_3
  - Hint: compare related alerts for the same `host.id` and `host.name` before broadening to other assets. $investigate_4
  - Implication: broaden scope when the same artifact path, writer identity, or follow-on execution appears on multiple hosts or repeats on the same host; localize when evidence stays limited to one short-lived, well-bounded servicing chain.
- Escalate for abnormal identity, exploit-like lineage, staged content, execution/reference, or recurrence; close only when identity, lineage, artifact, and scope bind one servicing or vendor-maintenance workflow with no contradictions; preserve artifacts and escalate when evidence stays mixed or incomplete.

### False positive analysis

- Windows servicing/component repair or product/security-agent upgrade can replace binaries in protected OS or vendor paths. Confirm writer identity (`process.executable`, `process.code_signature.subject_name`, `process.hash.sha256`, `process.pe.original_file_name`), lineage (`process.parent.executable`, `process.Ext.ancestry`), and `file.path` all match one servicing or product workflow on the same `host.id`; for vendor repair, also require the path to stay inside the vendor directory and no user-writable staging, staged rename, or later execution from that path. If maintenance records are unavailable, use prior alerts from this rule for the same host and require the same protected path pattern without staged rename or later execution.
- Before creating an exception, require recurrence for the same `host.id` plus stable `process.executable`, `process.code_signature.subject_name`, parent context, and protected `file.path` pattern. Avoid exceptions on `process.name`, `file.extension`, or the whole critical-process list alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and document the servicing or vendor-maintenance evidence: writer identity, parent context, written path, content indicators, and host scope. Create an exception only after the bounded pattern recurs.
- If suspicious but unconfirmed, export the alert file event and matching process-start event, preserve a copy of the written file when safe, and record the writer `process.entity_id`, `process.command_line`, `process.parent.executable`, `file.path`, and recovered `process.hash.sha256` before containment. Apply reversible containment first, such as heightened monitoring or temporary host isolation when host criticality allows, and avoid deleting the artifact until scope is clearer.
- If confirmed malicious, isolate the host when writer identity, lineage, artifact, or execution evidence establishes unauthorized activity. Record `process.entity_id`, `process.executable`, `process.command_line`, `file.path`, and recovered hashes before killing processes or deleting files; then terminate the offending process if still active and quarantine only the executable or DLL artifacts identified during investigation.
- Post-incident hardening should verify why a critical process could write executable content, restore affected files from trusted media when replacement occurred, retain process and file telemetry that supported the case, and document artifact-path or lineage variants in the incident record for future triage.
"""

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 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.name",
    "process.executable",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "file.path",
    "file.extension",
    "file.Ext.original.path",
    "file.Ext.header_bytes",
    "file.Ext.windows.zone_identifier",
    "event.action",
]

[transform]

[[transform.investigate]]
label = "Events for the writing process on this host"
description = ""
providers = [
  [
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Process start for the writing process"
description = ""
providers = [
  [
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "File activity for the written path on this host"
description = ""
providers = [
  [
    { excluded = false, field = "file.path", queryType = "phrase", value = "{{file.path}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

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

[[transform.investigate]]
label = "Process starts from the written file path on this host"
description = ""
providers = [
  [
    { excluded = false, field = "process.executable", queryType = "phrase", value = "{{file.path}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" }
  ],
  [
    { excluded = false, field = "process.command_line", queryType = "phrase", value = "{{file.path}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[rule.threat.technique]]
id = "T1211"
name = "Exploitation for Defense Evasion"
reference = "https://attack.mitre.org/techniques/T1211/"

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

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

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

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

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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.type != "deletion" and
  file.extension : ("exe", "dll") and
  process.name : ("smss.exe",
                  "autochk.exe",
                  "csrss.exe",
                  "wininit.exe",
                  "services.exe",
                  "lsass.exe",
                  "winlogon.exe",
                  "userinit.exe",
                  "LogonUI.exe") and
  not (
    process.name : "smss.exe" and
    file.path : (
      "?:\\Windows\\System32\\wpbbin.exe",
      "\\Device\\HarddiskVolume*\\Windows\\System32\\wpbbin.exe"
    )
  ) and
  not (
    process.name : "lsass.exe" and
    file.path : (
      "?:\\Windows\\System32\\eac_usermode_*.dll",
      "\\Device\\HarddiskVolume*\\Windows\\System32\\eac_usermode_*.dll"
    )
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typene
  • deletion corpus 33 (elastic 33)
field:"event.type" kind:ne value:"deletion"
file.extensionwildcard
  • dll corpus 32 (elastic 32)
  • exe corpus 32 (elastic 32)
field:"file.extension" kind:wildcard
process.namewildcard
  • LogonUI.exe corpus 4 (elastic 4)
  • autochk.exe corpus 4 (elastic 4)
  • csrss.exe corpus 5 (elastic 5)
  • lsass.exe corpus 9 (elastic 9)
  • services.exe corpus 7 (elastic 7)
  • smss.exe corpus 4 (elastic 4)
  • userinit.exe corpus 6 (elastic 6)
  • wininit.exe corpus 5 (elastic 5)
  • winlogon.exe corpus 6 (elastic 5, splunk 1)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard?:\Windows\System32\eac_usermode_*.dll, \Device\HarddiskVolume*\Windows\System32\eac_usermode_*.dllexcludes:file.path field:"file.path" value:"?:\Windows\System32\eac_usermode_*.dll" field:"file.path" value:"\Device\HarddiskVolume*\Windows\System32\eac_usermode_*.dll"
process.nameeqlsass.exeexcludes:process.name field:"process.name" value:"lsass.exe"
file.pathwildcard?:\Windows\System32\wpbbin.exe, \Device\HarddiskVolume*\Windows\System32\wpbbin.exeexcludes:file.path field:"file.path" value:"?:\Windows\System32\wpbbin.exe" field:"file.path" value:"\Device\HarddiskVolume*\Windows\System32\wpbbin.exe"
process.nameeqsmss.exeexcludes:process.name field:"process.name" value:"smss.exe"

VirtualProtect from Unusual NTDLL Offset

#
Source
github.com/elastic/protections-artifacts

Identifies calls to Windows memory APIs from unusual NTDLL offsets. This may indicate an attempt to bypass API monitoring using Return Oriented Programming (ROP) assembly gadgets to execute a syscall instruction.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies calls to Windows memory APIs from unusual NTDLL offsets. This may indicate an attempt to bypass API
monitoring using Return Oriented Programming (ROP) assembly gadgets to execute a syscall instruction.
"""
id = "036c0b79-9cba-4f01-a529-e0ef86981bad"
license = "Elastic License v2"
name = "VirtualProtect from Unusual NTDLL Offset"
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.thread.Ext.call_stack_summary like "ntdll.dll|*" and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info: ("?:\\windows\\system32\\ntdll.dll!ZwProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\syswow64\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!LdrLoadDll*",
                                       "?:\\windows\\syswow64\\ntdll.dll!LdrLoadDll*",
                                       "?:\\windows\\syswow64\\kernelbase.dll!VirtualProtect*",
                                       "?:\\windows\\system32\\kernelbase.dll!VirtualProtect*",
                                       "?:\\windows\\system32\\ntdll.dll+0x*",
                                       "?:\\windows\\syswow64\\ntdll.dll+0x*")) and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\windows\\sys?????\\ntdll.dll!*+0x14") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Unknown", "Undetermined", "Kernel|*") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|Unknown|wow64.dll|Unknown|wow64.dll|ntdll.dll|*" and
 not process.thread.Ext.call_stack_final_user_module.path like
                                         ("c:\\windows\\assembly\\nativeimages_*\\system.ni.dll",
                                          "c:\\program files (x86)\\common files\\kaspersky lab\\*\\klhkum.*.dll",
                                          "c:\\program files (x86)\\checkpoint\\endpoint security\\*\\klhkum.*.dll") and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and 
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                             ("0c3b7b36302a1971e87f443e7c32a17facd3581457fd5087ee745806bf630516",
                                              "ed19fae1f5122a66713aac93c24b47584c31c25dc73f076c15d0d3cd298f1338",
                                              "a4934c1c5f5fa0c299427d228aceaadbff5674a3284d93f013d50c76ae382097",
                                              "8d0a251e6641d6460b20535705a60562dc2b3efb5ed1cfc7895c632dd8ee3f0d",
                                              "45baaaa253c6cc6e79e8c54ea9a8b167f0cd237879a74134804a13d4da97592a",
                                              "3c69aef1794392dbcc33e54374e730c415bfdaf042315f2562ec4cb0cbad4d81",
                                              "f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
                                              "0be3da7c113fa1476cb1ef621ff875ed655e63dc7407f3180a8820433d150fd3",
                                              "efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab",
                                              "f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
                                              "0fd78e00c865ee88a2c416d3e32c0271f3490df527870739c35fab4513dc36a2")
'''

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

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

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

Stages and Predicates

Stage 1: api

api where
 process.Ext.api.name == "VirtualProtect" and process.thread.Ext.call_stack_summary like "ntdll.dll|*" and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                  $entry.symbol_info: ("?:\\windows\\system32\\ntdll.dll!ZwProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\syswow64\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!NtProtectVirtualMemory*",
                                       "?:\\windows\\system32\\ntdll.dll!LdrLoadDll*",
                                       "?:\\windows\\syswow64\\ntdll.dll!LdrLoadDll*",
                                       "?:\\windows\\syswow64\\kernelbase.dll!VirtualProtect*",
                                       "?:\\windows\\system32\\kernelbase.dll!VirtualProtect*",
                                       "?:\\windows\\system32\\ntdll.dll+0x*",
                                       "?:\\windows\\syswow64\\ntdll.dll+0x*")) and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\windows\\sys?????\\ntdll.dll!*+0x14") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Unknown", "Undetermined", "Kernel|*") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
 not process.thread.Ext.call_stack_summary like "ntdll.dll|Unknown|wow64.dll|Unknown|wow64.dll|ntdll.dll|*" and
 not process.thread.Ext.call_stack_final_user_module.path like
                                         ("c:\\windows\\assembly\\nativeimages_*\\system.ni.dll",
                                          "c:\\program files (x86)\\common files\\kaspersky lab\\*\\klhkum.*.dll",
                                          "c:\\program files (x86)\\checkpoint\\endpoint security\\*\\klhkum.*.dll") and
 process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and 
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                             ("0c3b7b36302a1971e87f443e7c32a17facd3581457fd5087ee745806bf630516",
                                              "ed19fae1f5122a66713aac93c24b47584c31c25dc73f076c15d0d3cd298f1338",
                                              "a4934c1c5f5fa0c299427d228aceaadbff5674a3284d93f013d50c76ae382097",
                                              "8d0a251e6641d6460b20535705a60562dc2b3efb5ed1cfc7895c632dd8ee3f0d",
                                              "45baaaa253c6cc6e79e8c54ea9a8b167f0cd237879a74134804a13d4da97592a",
                                              "3c69aef1794392dbcc33e54374e730c415bfdaf042315f2562ec4cb0cbad4d81",
                                              "f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
                                              "0be3da7c113fa1476cb1ef621ff875ed655e63dc7407f3180a8820433d150fd3",
                                              "efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab",
                                              "f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
                                              "0fd78e00c865ee88a2c416d3e32c0271f3490df527870739c35fab4513dc36a2")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_final_user_module.hash.sha256in0be3da7c113fa1476cb1ef621ff875ed655e63dc7407f3180a8820433d150fd3, 0c3b7b36302a1971e87f443e7c32a17facd3581457fd5087ee745806bf630516, 0fd78e00c865ee88a2c416d3e32c0271f3490df527870739c35fab4513dc36a2, 3c69aef1794392dbcc33e54374e730c415bfdaf042315f2562ec4cb0cbad4d81, 45baaaa253c6cc6e79e8c54ea9a8b167f0cd237879a74134804a13d4da97592a, 8d0a251e6641d6460b20535705a60562dc2b3efb5ed1cfc7895c632dd8ee3f0d, a4934c1c5f5fa0c299427d228aceaadbff5674a3284d93f013d50c76ae382097, ed19fae1f5122a66713aac93c24b47584c31c25dc73f076c15d0d3cd298f1338, efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab, f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.nameinKernel, Undetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\assembly\nativeimages_*\system.ni.dll, c:\program files (x86)\common files\kaspersky lab\*\klhkum.*.dll, c:\program files (x86)\checkpoint\endpoint security\*\klhkum.*.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\assembly\nativeimages_*\system.ni.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\common files\kaspersky lab\*\klhkum.*.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\checkpoint\endpoint security\*\klhkum.*.dll"
process.thread.Ext.call_stack_final_user_module.protection_provenancewildcardKernel, Unknown, Undetermined, Kernel|*excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance
process.thread.Ext.call_stack_summarystarts_withntdll.dll|Unknown|wow64.dll|Unknown|wow64.dll|ntdll.dll|excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|Unknown|wow64.dll|Unknown|wow64.dll|ntdll.dll|"

Back to all Elastic rules