Detection rules › Elastic

Elastic rules: 20

AWS Backup Resource Enumeration via Long-Term Access Key

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

Detects enumeration of AWS Backup resources using long-term IAM access keys (AKIA* prefix). AWS Backup protects EC2 instances, EBS volumes, RDS databases, DynamoDB tables, EFS file systems, and S3 buckets. An adversary who obtains long-term access keys may enumerate backup vaults, backup plans, and protected resources as a precursor to ransomware. Identifying which resources have recent backups (indicating high-value data) and what vault access policies can be modified to delete or corrupt the backups before encrypting the primary data.

Known False Positives

  • Automated monitoring tools or compliance audit scripts using long-term IAM keys to inventory backup coverage will trigger this rule. Migrate automation to IAM roles with short-lived credentials. Long-term key usage for backup management is a security anti-pattern.

MITRE ATT&CK Coverage

TacticTechniques
Discovery

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects enumeration of AWS Backup resources using long-term IAM access keys (AKIA* prefix).
AWS Backup protects EC2 instances, EBS volumes, RDS databases, DynamoDB tables, EFS file
systems, and S3 buckets. An adversary who obtains long-term access keys may enumerate backup
vaults, backup plans, and protected resources as a precursor to ransomware. Identifying which
resources have recent backups (indicating high-value data) and what vault access policies can
be modified to delete or corrupt the backups before encrypting the primary data.
"""
false_positives = [
    """
    Automated monitoring tools or compliance audit scripts using long-term IAM keys to
    inventory backup coverage will trigger this rule. Migrate automation to IAM roles with
    short-lived credentials. Long-term key usage for backup management is a security anti-pattern.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Backup Resource Enumeration via Long-Term Access Key"
note = """## Triage and analysis

### Investigating AWS Backup Resource Enumeration via Long-Term Access Key

AWS Backup vaults and plans are the last line of recovery for ransomware victims. Adversaries performing ransomware preparation systematically enumerate backup vaults to locate recovery points, assess vault lock configuration, and identify which vaults can be deleted or which backup plans can be disabled before encrypting the primary data stores.

Long-term access keys (AKIA* prefix) are the most commonly exfiltrated credential type, appearing in source code, .env files, and CI/CD configurations. Their use for backup enumeration is particularly suspicious because backup management is almost never performed by individual IAM users with static keys in modern environments.

### Possible investigation steps

- Identify the IAM user from aws.cloudtrail.user_identity.arn and confirm whether this user should have backup management access.
- Review source.ip and source.as.organization.name against known infrastructure. Backup enumeration from an unexpected IP with a long-term key is a high-risk indicator.
- Query for subsequent backup write operations by this key: DeleteBackupVault, DeleteRecoveryPoint, DeleteBackupPlan, UpdateRegionSettings.
- Correlate with other enumeration activity from the same access key: EC2 Describe calls, S3 ListBuckets, RDS DescribeDBInstances — broad enumeration suggests ransomware reconnaissance.
- Determine whether Vault Lock is enabled on critical backup vaults (GetBackupVaultLockConfiguration).

### Response and remediation

- Immediately deactivate the long-term access key.
- Enable Vault Lock (WORM) on critical backup vaults to prevent deletion for a compliance period.
- Review all backup vault access policies for unauthorized modifications.
- Enable AWS Backup audit manager reports to detect future unauthorized backup modifications.
"""
references = [
    "https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupVaults.html",
    "https://hackingthe.cloud/aws/enumeration/enumerate_services_via_aws_backup/",
]
risk_score = 21
rule_id = "e71ae602-bf44-4834-a4ea-b5c87047d426"
setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. AWS Backup management events are logged by default."
severity = "low"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS Backup",
    "Rule Type: Custom Query (KQL)",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "backup.amazonaws.com"
    and event.action: (
        "ListBackupVaults" or
        "ListBackupJobs" or
        "ListBackupPlans" or
        "ListProtectedResources" or
        "ListRecoveryPointsByBackupVault" or
        "GetBackupPlan" or
        "GetBackupVaultAccessPolicy" or
        "DescribeBackupJob" or
        "DescribeRecoveryPoint"
    )
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.access_key_id: AKIA*
'''


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


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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "backup.amazonaws.com"
    and event.action: (
        "ListBackupVaults" or
        "ListBackupJobs" or
        "ListBackupPlans" or
        "ListProtectedResources" or
        "ListRecoveryPointsByBackupVault" or
        "GetBackupPlan" or
        "GetBackupVaultAccessPolicy" or
        "DescribeBackupJob" or
        "DescribeRecoveryPoint"
    )
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.access_key_id: AKIA*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
aws.cloudtrail.user_identity.access_key_idwildcard
  • AKIA* corpus 5 (elastic 5)
field:"aws::userIdentity.accessKeyId" kind:wildcard value:"AKIA*"
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • DescribeBackupJob
  • DescribeRecoveryPoint
  • GetBackupPlan
  • GetBackupVaultAccessPolicy
  • ListBackupJobs
  • ListBackupPlans
  • ListBackupVaults
  • ListProtectedResources
  • ListRecoveryPointsByBackupVault
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • backup.amazonaws.com corpus 3 (elastic 3)
field:"Provider_Name" kind:eq value:"backup.amazonaws.com"

AWS GuardDuty Member Account Manipulation

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

Detects attempts to disassociate or manipulate Amazon GuardDuty member accounts within an AWS organization. In multi-account GuardDuty deployments, a delegated administrator account aggregates findings from member accounts. Adversaries may attempt to disassociate member accounts, delete member relationships, stop monitoring members, or delete pending invitations to break this centralized visibility. These actions can be precursors to or alternatives for deleting GuardDuty detectors entirely, allowing attackers to operate undetected in member accounts while the administrator account loses visibility. This rule identifies successful API calls that manipulate GuardDuty member relationships, which are rare in normal operations and warrant immediate investigation.

Known False Positives

  • GuardDuty member relationships may be modified during legitimate organizational changes such as account migrations, security architecture restructuring, or delegated administrator transitions. Verify whether the user identity and timing align with approved change management processes. If this is expected administrative activity, it can be exempted from the rule.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2026/02/05"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/08"

[rule]
author = ["Elastic"]
description = """
Detects attempts to disassociate or manipulate Amazon GuardDuty member accounts within an AWS organization. In
multi-account GuardDuty deployments, a delegated administrator account aggregates findings from member accounts.
Adversaries may attempt to disassociate member accounts, delete member relationships, stop monitoring members, or delete
pending invitations to break this centralized visibility. These actions can be precursors to or alternatives for
deleting GuardDuty detectors entirely, allowing attackers to operate undetected in member accounts while the
administrator account loses visibility. This rule identifies successful API calls that manipulate GuardDuty member
relationships, which are rare in normal operations and warrant immediate investigation.
"""
false_positives = [
    """
    GuardDuty member relationships may be modified during legitimate organizational changes such as account migrations,
    security architecture restructuring, or delegated administrator transitions. Verify whether the user identity and
    timing align with approved change management processes. If this is expected administrative activity, it can be
    exempted from the rule.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS GuardDuty Member Account Manipulation"
note = """## Triage and analysis

### Investigating AWS GuardDuty Member Account Manipulation

In AWS Organizations with GuardDuty enabled, a delegated administrator account receives and aggregates security findings from all member accounts. This centralized visibility is critical for detecting threats across the organization. Adversaries who compromise a member account may attempt to break this relationship to operate without triggering alerts visible to the security team.

This rule detects several API actions that manipulate GuardDuty member relationships:
- `DisassociateFromMasterAccount` / `DisassociateFromAdministratorAccount`: Member account breaks its connection to the administrator
- `DeleteMembers`: Administrator removes member accounts from GuardDuty
- `StopMonitoringMembers`: Administrator stops monitoring specific member accounts without fully removing them
- `DeleteInvitations`: Member account deletes pending invitations, preventing association

These actions are extremely rare in normal operations and can indicate either a compromised account or an attacker preparing to disable GuardDuty entirely.

### Possible investigation steps

- **Identify the actor**
  - Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.type` to determine who performed the action.
  - Determine whether the action originated from a member account (disassociation) or the administrator account (deletion/stop monitoring).

- **Review request context**
  - Check `aws.cloudtrail.request_parameters` to identify which member accounts were affected.
  - Determine the scope: single account or multiple accounts targeted.

- **Analyze source and access patterns**
  - Review `source.ip` and `user_agent.original` for anomalous access patterns.
  - Check if the action occurred outside normal business hours or maintenance windows.

- **Correlate with related activity**
  - Search for subsequent `DeleteDetector` API calls in the affected member accounts.
  - Look for other defense evasion indicators: CloudTrail modifications, Config rule deletions, Security Hub changes.
  - Check for privilege escalation or credential access events preceding this action.

- **Verify business justification**
  - Confirm with the identified user or team whether there was a legitimate organizational change.
  - Check for related change tickets or migration documentation.

### False positive analysis

- **Organizational restructuring**
  - Member relationships may change during account migrations or delegated administrator transitions.
  - Validate against documented organizational changes.

- **Account decommissioning**
  - Accounts being retired may be removed from GuardDuty before closure.
  - Confirm this aligns with account lifecycle management processes.

### Response and remediation

- **Immediate containment**
  - If unauthorized, immediately re-associate the affected member accounts with the administrator.
  - For `StopMonitoringMembers`, use `StartMonitoringMembers` to restore visibility.

- **Investigation**
  - Audit the affected member accounts for suspicious activity during the visibility gap.
  - Review CloudTrail for any actions taken while GuardDuty monitoring was disrupted.

- **Hardening**
  - Restrict `guardduty:DisassociateFromAdministratorAccount`, `guardduty:DeleteMembers`, and related permissions.
  - Use SCPs to prevent member accounts from disassociating from GuardDuty administrators.
  - Implement Security Hub controls to detect changes to GuardDuty organization configuration.

### Additional information
- **[AWS GuardDuty Multi-Account Documentation](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html)**
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
"""
references = [
    "https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DisassociateFromAdministratorAccount.html",
    "https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DeleteMembers.html",
    "https://docs.aws.amazon.com/guardduty/latest/APIReference/API_StopMonitoringMembers.html",
    "https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html",
    "https://permiso.io/blog/lucr-3-scattered-spider-getting-saas-y-in-the-cloud",
]
risk_score = 73
rule_id = "3c59d2e1-8ca1-4f13-b2ac-f4bb99ff69d7"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS GuardDuty",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "guardduty.amazonaws.com"
    and event.action: (
        "DisassociateFromAdministratorAccount" or
        "DeleteMembers" or
        "StopMonitoringMembers" or
        "DeleteInvitations" or
        "DisassociateMembers"
    )
    and event.outcome: "success"
'''


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



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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "guardduty.amazonaws.com"
    and event.action: (
        "DisassociateFromAdministratorAccount" or
        "DeleteMembers" or
        "StopMonitoringMembers" or
        "DeleteInvitations" or
        "DisassociateMembers"
    )
    and event.outcome: "success"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • DeleteInvitations
  • DeleteMembers
  • DisassociateFromAdministratorAccount
  • DisassociateMembers
  • StopMonitoringMembers
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • guardduty.amazonaws.com corpus 5 (elastic 5)
field:"Provider_Name" kind:eq value:"guardduty.amazonaws.com"

AWS IAM Login Profile Added for Root

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

Identifies creation of a console login profile for the AWS account root user. While CreateLoginProfile normally applies to IAM users, when performed from a temporary root session (e.g., via AssumeRoot) and the userName parameter is omitted, the profile is created for the root principal (self-assigned). Adversaries with temporary root access may add or reset the root login profile to establish persistent console access even if original access keys are rotated or disabled. Correlate with recent AssumeRoot/STS activity and validate intent with the account owner.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies creation of a console login profile for the AWS account root user. While CreateLoginProfile normally applies to IAM users, when performed from a temporary root session (e.g., via AssumeRoot) and the userName parameter is omitted, the profile is created for the root principal (self-assigned). Adversaries with temporary root access may add or reset the root login profile to establish persistent console access even if original access keys are rotated or disabled. Correlate with recent AssumeRoot/STS activity and validate intent with the account owner.

"""
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS IAM Login Profile Added for Root"
note = """## Triage and analysis

### Investigating AWS IAM Login Profile Added for Root

This rule detects when a console login profile is created for the AWS root account.  
A login profile enables password-based console access, and because the root user has unrestricted privileges, creating one is an extremely high-impact event. Adversaries who temporarily gain root-level credentials (for example, through an STS session or credential compromise) may use `CreateLoginProfile` without specifying a `userName` to add a password to the root account. This grants persistent access even if the attacker’s API keys are later rotated or disabled.

### Possible investigation steps

**Assess the timing and context of the event**
- Review the `@timestamp` to determine when the `CreateLoginProfile` call occurred.  
  - Correlate this time window with other root or IAM activity such as `AssumeRoot`, `GetSessionToken`, `ConsoleLogin`, or `CreateAccessKey`.  
  - Check for follow-on activity, especially `ConsoleLogin` events or `UpdateLoginProfile`, which may indicate that the root password was used immediately after creation.

**Investigate event origin and session details**
- Review `source.ip` and `user_agent.original`:
  - Determine if the request originated from an expected network range, VPN endpoint, or geolocation.
  - Identify whether the access was interactive (for example, browser or AWS console) or automated (`aws-cli`, SDK, or API client).
- Examine `aws.cloudtrail.user_identity.access_key_id` and associated STS session context to see if temporary credentials were used.
- Compare this event’s IP and access key to any other recent CloudTrail activity to identify potential lateral movement or multi-account access attempts.

**Analyze the login profile creation**
- Review `aws.cloudtrail.request_parameters` and `aws.cloudtrail.response_elements`:
  - Check whether `passwordResetRequired` was set to `true` or omitted, absence may imply that the attacker created a password they intend to reuse.
- Cross-reference this action with previous failed login attempts, password recovery requests, or `AssumeRoot` behavior.

**Correlate related identity and access behavior**
- Search for additional IAM management activity:
  - `AttachUserPolicy`, `AttachRolePolicy`, or `PutUserPolicy` granting elevated permissions.
  - New `AccessKey` creation or `UpdateAccessKey` events tied to the same session.
- Review GuardDuty findings or any other detections referencing this account or IP around the same time period.
- If available, correlate with CloudTrail to detect if other resource creation or configuration changes followed the login profile addition.

**Validate with account owner or authorized personnel**
- Contact the designated account or root credential owner to confirm whether this action was intentional (for example, during an account recovery).
- Review any internal change-management or service ticketing systems for an approved request matching this activity.

### False positive analysis

Although rare, legitimate scenarios include:
- **Authorized account recovery** : An administrator or AWS Support might temporarily add a root login profile to regain access. Validate against documented recovery workflows.  
- **Controlled testing or sandbox environments** : Certain sandbox accounts may reuse root credentials for automation or demonstration purposes. Tag and exclude these accounts from this rule where appropriate.  
- **Automated provisioning** : Review any account bootstrap or recovery automation scripts that may invoke `CreateLoginProfile` on root credentials.

For any potential false positive, verify that:
- The `source.ip` and `user_agent.original` values align with expected administrative locations and tools.  
- The change was recorded during a maintenance window or known security operation.

### Response and remediation

> Any unapproved creation of a login profile for the root account is a critical security incident requiring immediate containment and credential rotation.

**Containment**
- Delete the newly created root login profile if it was not authorized.  
- Rotate the root account password using AWS’s official password-reset workflow.  
- Revoke any active sessions, temporary credentials, or tokens associated with this event.  
- Verify that multi-factor authentication (MFA) is enabled and functioning on the root account.  
- Check that no root access keys exist — if present, remove them immediately.

**Investigation and scoping**
- Examine CloudTrail logs from 30 minutes before and after this event to identify correlated actions.  
- Capture and securely store these logs in an isolated S3 bucket with Object Lock enabled to preserve forensic integrity.  
- Investigate for additional IAM or STS operations by the same `access_key_id` or IP address that may indicate privilege escalation or persistence attempts.  
- Review whether any new IAM roles, users, or policies were created in proximity to this event.

**Recovery and hardening**
- Reset the root password and distribute the new credentials securely to authorized custodians only.  
- Ensure MFA is enforced for all administrative and root-level access.  
- Audit all IAM policies for least-privilege adherence, focusing on `iam:CreateLoginProfile`, `iam:UpdateLoginProfile`, and `iam:CreateAccessKey` permissions.  
- Enable Cloudtrail, GuardDuty, AWS Config, and Security Hub across all regions for continuous monitoring of root and IAM activity.  
- Review your organization’s playbooks and detection coverage for root-level persistence techniques, and update procedures as needed.

**Post-incident actions**
- Notify AWS account owners and your security operations center of the incident.  
- Conduct a post-mortem to determine the initial vector of compromise (e.g., stolen credentials, misconfigured role chaining, or insufficient MFA).  
- Update alerting thresholds and detection logic to minimize mean time to detect (MTTD) and respond (MTTR).

### Additional information

- **AWS Incident Response Playbooks**  
  - [IRP-CredCompromise](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/IRP-CredCompromise.md) – Containment and recovery for suspected credential abuse.  
- **AWS Customer Playbook Framework**  
  - [Compromised_IAM_Credentials.md](https://github.com/aws-samples/aws-customer-playbook-framework/blob/a8c7b313636b406a375952ac00b2d68e89a991f2/docs/Compromised_IAM_Credentials.md) – Steps to contain, investigate, and recover from credential compromise.  
- **AWS Documentation**  
  - [CreateLoginProfile API Reference](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html)  
  - [Root User Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/root-user-best-practices.html)
"""
risk_score = 73
rule_id = "c04be7e0-b0fc-11ef-a826-f661ea17fbce"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS IAM",
    "Use Case: Identity and Access Audit",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
any where data_stream.dataset == "aws.cloudtrail"
   and event.provider == "iam.amazonaws.com"
   and event.action == "CreateLoginProfile"
   and aws.cloudtrail.user_identity.type == "Root"
   and event.outcome == "success"
   and not stringContains(aws.cloudtrail.request_parameters, "userName=")
'''
[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user_agent.original",
    "source.ip",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.request_parameters",
    "aws.cloudtrail.response_elements"
]

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

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

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

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

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

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

Stages and Predicates

Stage 1: any

any where data_stream.dataset == "aws.cloudtrail"
   and event.provider == "iam.amazonaws.com"
   and event.action == "CreateLoginProfile"
   and aws.cloudtrail.user_identity.type == "Root"
   and event.outcome == "success"
   and not stringContains(aws.cloudtrail.request_parameters, "userName=")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
aws.cloudtrail.request_parameterscontainsuserName=excludes:aws.cloudtrail.request_parameters field:"aws.cloudtrail.request_parameters" value:"userName="

Azure AKS Service Account Token Created via TokenRequest API

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

Detects an identity minting a service account token via the AKS (Azure Kubernetes Service) TokenRequest API (serviceaccounts/token), excluding known AKS control-plane and platform identities. Adversaries request service account tokens from a compromised identity to impersonate a workload, move laterally, or escalate privileges within the cluster. Coverage includes workload service accounts (system:serviceaccount:*), so a compromised in-cluster token minting a token for another service account is not excluded.

Known False Positives

  • Controllers, CI/CD systems, and platform components legitimately request service account tokens. Baseline the requesting identities and exclude verified automation after review.

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 = "2026/07/23"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/23"

[rule]
author = ["Elastic"]
description = """
Detects an identity minting a service account token via the AKS (Azure Kubernetes Service) TokenRequest API
(serviceaccounts/token), excluding known AKS control-plane and platform identities. Adversaries request service account
tokens from a compromised identity to impersonate a workload, move laterally, or escalate privileges within the cluster.
Coverage includes workload service accounts (system:serviceaccount:*), so a compromised in-cluster token minting a token
for another service account is not excluded.
"""
false_positives = [
    """
    Controllers, CI/CD systems, and platform components legitimately request service account tokens. Baseline the
    requesting identities and exclude verified automation after review.
    """,
]
from = "now-9m"
index = ["logs-azure.platformlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure AKS Service Account Token Created via TokenRequest API"
note = """## Triage and analysis

### Investigating Azure AKS Service Account Token Created via TokenRequest API

AKS kube-audit events are carried under the flattened `azure.platformlogs.properties.log.*` subtree and share the ARM
operation `event.action: Microsoft.ContainerService/managedClusters/diagnosticLogs/Read`. The TokenRequest API
(`serviceaccounts/token`) mints a bound service account token. The kubelet (`system:node:*`) and the
kube-controller-manager (`aksService`) mint these tokens continuously for normal pod operation and are excluded; the
signal is a non-platform identity minting one. An attacker with rights over a service account can request a token to act
as that workload identity, reaching resources the compromised principal cannot.

### Possible investigation steps

- Identify the requesting identity in `azure.platformlogs.properties.log.user.username` (and its groups in
  `azure.platformlogs.properties.log.user.groups`) and whether it should mint tokens. A workload service account
  (`system:serviceaccount:<ns>:<sa>`) minting a token, or `masterclient` (the local cluster-admin cert), is the
  higher-concern case.
- Inspect `azure.platformlogs.properties.log.userAgent` to distinguish interactive/expected tooling (`kubectl create
  token`) from custom clients (for example `curl`), which is a stronger indicator of scripted abuse.
- Identify the target service account in `azure.platformlogs.properties.log.objectRef.name` /
  `azure.platformlogs.properties.log.objectRef.namespace` and what RBAC that account holds; minting a token for a
  higher-privileged service account is privilege escalation.
- Evaluate the source in `azure.platformlogs.properties.log.sourceIPs` and pivot on it for follow-on API calls made with
  the minted token, and correlate with recent RBAC changes, secret reads, or exec sessions from the same identity.

### False positive analysis

- Controllers, CI/CD systems, and platform components legitimately request service account tokens (for example the
  kube-controller-manager as `aksService`, which is excluded). Additional automation such as GitOps operators or CI
  running `kubectl create token` may surface; baseline those identities and exclude the specific validated account
  rather than re-broadening to all `system:*`, which would blind the rule to compromised workload service accounts.

### Response and remediation

- If unauthorized, revoke the minted token and the requesting identity's credentials, and review the RBAC that permitted
  token creation.
- Audit actions performed with the target service account's identity after the request.
- Collect kube-audit and identity artifacts per incident response procedures.
"""
references = [
    "https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/",
    "https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
    "https://github.com/inguardians/peirates",
]
risk_score = 47
rule_id = "95db6791-8e88-47d0-81c9-531ff79c0e60"
setup = """
The Azure Fleet integration collecting AKS diagnostic logs forwarded through Event Hub into the `azure.platformlogs`
data stream is required for this rule. Enable either the `kube-audit` or the `kube-audit-admin` log category (Microsoft
recommends `kube-audit-admin` alone to reduce volume, as it only drops read-only get/list events). TokenRequest is a
mutating create recorded in both categories with the same `auditID`, so clusters that enable both categories may
generate two alerts per request.
"""
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: Azure",
    "Data Source: Azure Platform Logs",
    "Data Source: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.platformlogs and
    event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
    azure.platformlogs.category:("kube-audit" or "kube-audit-admin") and
    azure.platformlogs.properties.log.stage:"ResponseComplete" and
    azure.platformlogs.properties.log.objectRef.resource:"serviceaccounts" and
    azure.platformlogs.properties.log.objectRef.subresource:"token" and
    azure.platformlogs.properties.log.verb:"create" and
    azure.platformlogs.properties.log.responseStatus.code:("200" or "201") and
    not azure.platformlogs.properties.log.user.username:(
        system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
        system\:serviceaccount\:kube-system\:*
    )
'''

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "azure.platformlogs.category",
    "azure.platformlogs.properties.log.verb",
    "azure.platformlogs.properties.log.user.username",
    "azure.platformlogs.properties.log.user.groups",
    "azure.platformlogs.properties.log.userAgent",
    "azure.platformlogs.properties.log.sourceIPs",
    "azure.platformlogs.properties.log.objectRef.namespace",
    "azure.platformlogs.properties.log.objectRef.name",
    "azure.platformlogs.properties.log.objectRef.subresource",
    "azure.platformlogs.properties.log.requestURI",
    "azure.platformlogs.properties.log.responseStatus.code",
]

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

[[rule.threat.technique]]
id = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:azure.platformlogs and
    event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
    azure.platformlogs.category:("kube-audit" or "kube-audit-admin") and
    azure.platformlogs.properties.log.stage:"ResponseComplete" and
    azure.platformlogs.properties.log.objectRef.resource:"serviceaccounts" and
    azure.platformlogs.properties.log.objectRef.subresource:"token" and
    azure.platformlogs.properties.log.verb:"create" and
    azure.platformlogs.properties.log.responseStatus.code:("200" or "201") and
    not azure.platformlogs.properties.log.user.username:(
        system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
        system\:serviceaccount\:kube-system\:*
    )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Clearing Windows Event Logs

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

Identifies attempts to clear or disable Windows event log stores using Windows wevetutil command. This is often done by attackers in an attempt to evade detection or destroy forensic evidence on a system.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies attempts to clear or disable Windows event log stores using Windows wevetutil command. This is often done by
attackers in an attempt to evade detection or destroy forensic evidence on a system.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Clearing Windows Event Logs"
note = """## Triage and analysis

### Investigating Clearing Windows Event Logs

Windows event logs are a fundamental data source for security monitoring, forensics, and incident response. Adversaries can tamper, clear, and delete this data to break SIEM detections, cover their tracks, and slow down incident response.

This rule looks for the execution of the `wevtutil.exe` utility or the `Clear-EventLog` cmdlet to clear event logs.

#### Possible investigation steps

- 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.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
  - Verify if any other anti-forensics behaviors were observed.
- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.

### False positive analysis

- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity and there are justifications for this action.
- Analyze whether the cleared event log is pertinent to security and general monitoring. Administrators can clear non-relevant event logs using this mechanism. If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
  - This activity is potentially done after the adversary achieves its objectives on the host. Ensure that previous actions, if any, are investigated accordingly with their response playbooks.
- Isolate the involved host 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.
- 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:

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

references = ["https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine"]
risk_score = 21
rule_id = "d331bbe2-6db4-4941-80a5-8270db72eb61"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
(
  (
    (process.name : "wevtutil.exe" or ?process.pe.original_file_name == "wevtutil.exe") and
    process.args : ("/e:false", "cl", "clear-log")
  ) or
  (
    (
      process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") or
      ?process.pe.original_file_name in ("PowerShell.EXE", "pwsh.dll", "powershell_ise.EXE")
    ) and
    process.args : "Clear-EventLog"
  )
)
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1070.001"
name = "Clear Windows Event Logs"
reference = "https://attack.mitre.org/techniques/T1070/001/"

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

[[rule.threat.technique.subtechnique]]
id = "T1562.002"
name = "Disable Windows Event Logging"
reference = "https://attack.mitre.org/techniques/T1562/002/"

[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 == "windows" and event.type == "start" and
(
  (
    (process.name : "wevtutil.exe" or ?process.pe.original_file_name == "wevtutil.exe") and
    process.args : ("/e:false", "cl", "clear-log")
  ) or
  (
    (
      process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") or
      ?process.pe.original_file_name in ("PowerShell.EXE", "pwsh.dll", "powershell_ise.EXE")
    ) and
    process.args : "Clear-EventLog"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • /e:false
  • Clear-EventLog
  • cl
  • clear-log
field:"process.args" kind:wildcard
process.namewildcard
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • powershell_ise.exe corpus 53 (splunk 29, elastic 24)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
  • wevtutil.exe corpus 10 (elastic 6, splunk 4)
field:"process_basename" kind:wildcard
process.pe.original_file_nameeq
  • wevtutil.exe
field:"OriginalFileName" kind:eq value:"wevtutil.exe"
process.pe.original_file_namein
  • PowerShell.EXE corpus 19 (elastic 19)
  • powershell_ise.EXE corpus 8 (elastic 8)
  • pwsh.dll corpus 8 (elastic 8)
field:"OriginalFileName" kind:in

DNS Request to Crypto/DHT Services

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

This rule detects DNS queries to crypto/DHT services via living-off-the-land executables or executables in world/user-writable directories. Malware authors may use these services to communicate with command and control infrastructure or to exfiltrate data from the target system.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects DNS queries to crypto/DHT services via living-off-the-land executables or executables in
world/user-writable directories. Malware authors may use these services to communicate with command and control
infrastructure or to exfiltrate data from the target system.
"""
id = "fd00d51f-9a22-45e2-9247-69dd34187815"
license = "Elastic License v2"
name = "DNS Request to Crypto/DHT Services"
os_list = ["linux"]
reference = ["https://www.aikido.dev/blog/glassworm-chrome-extension-rat"]
version = "1.0.4"

query = '''
sequence by process.entity_id with maxspan=1m
  [process where event.type == "start" and event.action == "exec" and (
    process.name in (
      "curl", "wget", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox",
      "timeout", "env", "node", "deno", "nodejs"
    ) or
    process.name like ".*" or
    process.executable like (
      "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
      "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/home/*/*", "/root/*",
      /* Enforce Python, Perl, PHP, Ruby, Lua, Node.js paths */
      "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
      "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
      "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
      "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
      "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
      "/bin/node", "/usr/bin/node", "/usr/local/bin/node"
    )
  ) and
  not (
    process.parent.command_line like "*home/*/.claude/shell-snapshots/*" or
    (process.executable like "/usr/bin/python3*" and process.args == "replenisher.py") or
    (process.parent.command_line == "s6-supervise svc-qbittorrent" and process.args == "svc-qbittorrent") or
    process.executable like ("/home/*/Games/WarThunder/launcher", "/home/*/.rbenv/versions/*/bin/ruby", "/home/*/.pyenv/versions/*/bin/python3*") or
    process.parent.executable like ("/usr/lib/systemd/systemd", "/home/*/.local/bin/rtk", "/usr/bin/gnome-shell", "/package/admin/s6-*/command/s6-supervise") or
    (process.name == "curl" and process.parent.args like "read -r RPC;*") or
    (process.executable like "/usr/bin/php*" and process.args in ("/var/tools/koalaping/bin/ping.php", "/var/tools/lean/bin/Lean.php")) or
    (process.executable like "/home/*/.local/share/uv/python/*/bin/python3*" and process.working_directory like "/home/*/shard_campaign_data_collection") or
    (process.executable == "/usr/bin/dash" and process.args == "/usr/bin/firefox")
  )]
  [dns where event.action == "lookup_result" and dns.question.name like~ (
    /* Solana */
    "api.mainnet-beta.solana.com", "solana-mainnet.gateway.tatum.io", "go.getblock.us", "solana-rpc.publicnode.com",
    "api.blockeden.xyz", "solana.drpc.org", "solana.leorpc.com", "solana.api.onfinality.io", "solana.api.pocket.network",

    /* Ethereum */
    "*ethereum.org", "*infura.io", "*alchemy.com", "*alchemyapi.io", "*ankr.com", "*quiknode.pro", "*tatum.io",
    "*thirdweb.com", "*tenderly.co", "*flashbots.net", "*mevblocker.io", "*drpc.org", "*blockpi.network",
    "*llamarpc.com", "*1rpc.io", "*0xrpc.io", "*nodies.app", "*blastapi.io", "*nownodes.io", "*pokt.network",
    "*merkle.io", "*blinklabs.xyz", "*leorpc.com", "*publicnode.com", "*cloudflare-eth.com", "*payload.de",
    "*etherscan.io", "*ethplorer.io", "*blockchair.com", "*pokt.io", "*getblock.io", "*chainstack.com",
    "*moralis.io", "*quicknode.com", "*quiknode.com", "*figment.io", "*nodesmith.io", "*blockdaemon.com",
    "*onfinality.io", "*ankr-rpc.com", "*hardhat.org", "*foundry.paradigm.xyz", "*paradigm.xyz",
    "*ethrpc.com", "*web3api.com", "*.icp0.io",

    /* BNB Smart Chain (UNC5342 (DPRK) reads JADESNOW payloads via Binplorer); */
    "*binplorer.com", "*bscscan.com", "*bnbchain.org",

    /* Polygon (DeadLock ransomware proxy address storage (Group-IB, Jan 2026) */
    "polygon-rpc.com", "*polygonscan.com",

    /* Bitcoin (Glupteba OP_RETURN dead-drop, Akamai cryptominer botnet C2 backup) */
    "*blockchain.info", "*blockchain.com", "*blockstream.info", "*mempool.space", "*blockcypher.com",

    /* Tron (heavy abuse for laundering, dusting attacks, emerging C2) */
    "*trongrid.io", "*tronscan.org",

    /* Crypto */
    "*binance.org", "*ninicoin.io", "*defibit.io",

    /* DHT lookup domains */
    "dht.libtorrent.org", "router.bittorrent.com", "router.utorrent.com"
  ) and
  not dns.question.name == "www.alchemy.com"]
'''

min_endpoint_version = "9.3.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.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 = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[threat.technique.subtechnique]]
id = "T1071.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"


[[threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"


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

[internal]
min_endpoint_version = "9.3.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and (
    process.name in (
      "curl", "wget", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox",
      "timeout", "env", "node", "deno", "nodejs"
    ) or
    process.name like ".*" or
    process.executable like (
      "./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
      "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/home/*/*", "/root/*",
      "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
      "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
      "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
      "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
      "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
      "/bin/node", "/usr/bin/node", "/usr/local/bin/node"
    )
  ) and
  not (
    process.parent.command_line like "*home/*/.claude/shell-snapshots/*" or
    (process.executable like "/usr/bin/python3*" and process.args == "replenisher.py") or
    (process.parent.command_line == "s6-supervise svc-qbittorrent" and process.args == "svc-qbittorrent") or
    process.executable like ("/home/*/Games/WarThunder/launcher", "/home/*/.rbenv/versions/*/bin/ruby", "/home/*/.pyenv/versions/*/bin/python3*") or
    process.parent.executable like ("/usr/lib/systemd/systemd", "/home/*/.local/bin/rtk", "/usr/bin/gnome-shell", "/package/admin/s6-*/command/s6-supervise") or
    (process.name == "curl" and process.parent.args like "read -r RPC;*") or
    (process.executable like "/usr/bin/php*" and process.args in ("/var/tools/koalaping/bin/ping.php", "/var/tools/lean/bin/Lean.php")) or
    (process.executable like "/home/*/.local/share/uv/python/*/bin/python3*" and process.working_directory like "/home/*/shard_campaign_data_collection") or
    (process.executable == "/usr/bin/dash" and process.args == "/usr/bin/firefox")
  )]

Stage 2: dns

[dns where event.action == "lookup_result" and dns.question.name like~ (
    "api.mainnet-beta.solana.com", "solana-mainnet.gateway.tatum.io", "go.getblock.us", "solana-rpc.publicnode.com",
    "api.blockeden.xyz", "solana.drpc.org", "solana.leorpc.com", "solana.api.onfinality.io", "solana.api.pocket.network",
    "*ethereum.org", "*infura.io", "*alchemy.com", "*alchemyapi.io", "*ankr.com", "*quiknode.pro", "*tatum.io",
    "*thirdweb.com", "*tenderly.co", "*flashbots.net", "*mevblocker.io", "*drpc.org", "*blockpi.network",
    "*llamarpc.com", "*1rpc.io", "*0xrpc.io", "*nodies.app", "*blastapi.io", "*nownodes.io", "*pokt.network",
    "*merkle.io", "*blinklabs.xyz", "*leorpc.com", "*publicnode.com", "*cloudflare-eth.com", "*payload.de",
    "*etherscan.io", "*ethplorer.io", "*blockchair.com", "*pokt.io", "*getblock.io", "*chainstack.com",
    "*moralis.io", "*quicknode.com", "*quiknode.com", "*figment.io", "*nodesmith.io", "*blockdaemon.com",
    "*onfinality.io", "*ankr-rpc.com", "*hardhat.org", "*foundry.paradigm.xyz", "*paradigm.xyz",
    "*ethrpc.com", "*web3api.com", "*.icp0.io",
    "*binplorer.com", "*bscscan.com", "*bnbchain.org",
    "polygon-rpc.com", "*polygonscan.com",
    "*blockchain.info", "*blockchain.com", "*blockstream.info", "*mempool.space", "*blockcypher.com",
    "*trongrid.io", "*tronscan.org",
    "*binance.org", "*ninicoin.io", "*defibit.io",
    "dht.libtorrent.org", "router.bittorrent.com", "router.utorrent.com"
  ) and
  not dns.question.name == "www.alchemy.com"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.namewildcard
  • *.icp0.io
  • *0xrpc.io
  • *1rpc.io
  • *alchemy.com
  • *alchemyapi.io
  • *ankr-rpc.com
  • *ankr.com
  • *binance.org
  • *binplorer.com
  • *blastapi.io
  • *blinklabs.xyz
  • *blockchain.com
  • *blockchain.info
  • *blockchair.com
  • *blockcypher.com
  • *blockdaemon.com
  • *blockpi.network
  • *blockstream.info
  • *bnbchain.org
  • *bscscan.com
  • *chainstack.com
  • *cloudflare-eth.com
  • *defibit.io
  • *drpc.org
  • *ethereum.org
  • *etherscan.io
  • *ethplorer.io
  • *ethrpc.com
  • *figment.io
  • *flashbots.net
  • *foundry.paradigm.xyz
  • *getblock.io
  • *hardhat.org
  • *infura.io
  • *leorpc.com
  • *llamarpc.com
  • *mempool.space
  • *merkle.io
  • *mevblocker.io
  • *moralis.io
  • +33 more values (see full rule source)
field:"QueryName" kind:wildcard
event.actioneq
  • exec
  • lookup_result
field:"EventType" kind:eq
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.executablewildcard
  • ./*
  • /bin/lua*
  • /bin/node
  • /bin/perl*
  • /bin/php*
  • /bin/python*
  • /bin/ruby*
  • /boot/*
  • /dev/shm/*
  • /home/*/*
  • /lost+found/*
  • /proc/*
  • /root/*
  • /run/*
  • /sys/*
  • /tmp/*
  • /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*
  • /var/mail/*
  • /var/run/*
  • /var/tmp/*
  • /var/www/*
field:"Image" kind:wildcard
process.namein
  • bash
  • busybox
  • csh
  • curl
  • dash
  • deno
  • env
  • fish
  • ksh
  • node
  • nodejs
  • sh
  • tcsh
  • timeout
  • wget
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
field:"process_basename" kind:wildcard value:".*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq/usr/bin/firefoxexcludes:process.args field:"process.args" value:"/usr/bin/firefox"
process.executableeq/usr/bin/dashexcludes:process.executable field:"process.executable" value:"/usr/bin/dash"
process.argseqreplenisher.pyexcludes:process.args field:"process.args" value:"replenisher.py"
process.executablestarts_with/usr/bin/python3excludes:process.executable field:"process.executable" value:"/usr/bin/python3"
process.argseqsvc-qbittorrentexcludes:process.args field:"process.args" value:"svc-qbittorrent"
process.parent.command_lineeqs6-supervise svc-qbittorrentexcludes:process.parent.command_line field:"process.parent.command_line" value:"s6-supervise svc-qbittorrent"
process.argsin/var/tools/koalaping/bin/ping.php, /var/tools/lean/bin/Lean.phpexcludes:process.args field:"process.args" value:"/var/tools/koalaping/bin/ping.php" field:"process.args" value:"/var/tools/lean/bin/Lean.php"
process.executablestarts_with/usr/bin/phpexcludes:process.executable field:"process.executable" value:"/usr/bin/php"
process.executablewildcard/home/*/.local/share/uv/python/*/bin/python3*excludes:process.executable field:"process.executable" value:"/home/*/.local/share/uv/python/*/bin/python3*"
process.working_directorywildcard/home/*/shard_campaign_data_collectionexcludes:process.working_directory field:"process.working_directory" value:"/home/*/shard_campaign_data_collection"
process.nameeqcurlexcludes:process.name field:"process.name" value:"curl"
process.parent.argsstarts_withread -r RPC;excludes:process.parent.args field:"process.parent.args" value:"read -r RPC;"
process.executablewildcard/home/*/Games/WarThunder/launcher, /home/*/.rbenv/versions/*/bin/ruby, /home/*/.pyenv/versions/*/bin/python3*excludes:process.executable field:"process.executable" value:"/home/*/Games/WarThunder/launcher" field:"process.executable" value:"/home/*/.rbenv/versions/*/bin/ruby" field:"process.executable" value:"/home/*/.pyenv/versions/*/bin/python3*"
process.parent.command_linewildcard*home/*/.claude/shell-snapshots/*excludes:process.parent.command_line field:"process.parent.command_line" value:"*home/*/.claude/shell-snapshots/*"
process.parent.executablewildcard/usr/lib/systemd/systemd, /home/*/.local/bin/rtk, /usr/bin/gnome-shell, /package/admin/s6-*/command/s6-superviseexcludes:process.parent.executable
dns.question.nameeqwww.alchemy.comexcludes:dns.question.name field:"dns.question.name" value:"www.alchemy.com"

Execution of File Written or Modified by Microsoft Equation Editor

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

Identifies the execution of a file written or modified by Microsoft Equation Editor, which is frequently targeted by attackers using weaponized Microsoft Office documents. These files are often written or modified during the exploitation of Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a file written or modified by Microsoft Equation Editor, which is frequently targeted by
attackers using weaponized Microsoft Office documents. These files are often written or modified during the exploitation
of Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.
"""
id = "8bc4f22c-9bb1-4c76-a7b6-195bee3579db"
license = "Elastic License v2"
name = "Execution of File Written or Modified by Microsoft Equation Editor"
os_list = ["windows"]
reference = [
    "https://www.anomali.com/blog/multiple-chinese-threat-groups-exploiting-cve-2018-0798-equation-editor-vulnerability-since-late-2018",
    "https://nvd.nist.gov/vuln/detail/CVE-2017-11882",
    "https://nvd.nist.gov/vuln/detail/CVE-2018-0798",
]
version = "1.0.31"

query = '''
sequence with maxspan=5m
  [file where event.action != "deletion" and process.name : "eqnedt32.exe" and
   (file.extension : ("exe", "com") or file.Ext.header_bytes : "4d5a*")] by file.path
  [process where event.action == "start"] by process.executable
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 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 = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: file

[file where event.action != "deletion" and process.name : "eqnedt32.exe" and
   (file.extension : ("exe", "com") or file.Ext.header_bytes : "4d5a*")] by file.path

Stage 2: process

[process where event.action == "start"] by process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • com corpus 16 (elastic 16)
  • exe corpus 32 (elastic 32)
field:"file.extension" kind:wildcard
process.namewildcard
  • eqnedt32.exe corpus 8 (elastic 8)
field:"process_basename" kind:wildcard value:"eqnedt32.exe"

Ingress DLL Transfer followed by DLL SideLoading

#
Time window
1m
Sequence by
dll.name, file.name
Source
github.com/elastic/protections-artifacts

Identifies the side load of an untrusted DLL by a persistent trusted binary and that was dropped by commonly abused ingress tool transfer binaries. This behavior may indicate an attempt to sideloading a malicious DLL.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the side load of an untrusted DLL by a persistent trusted binary and that was dropped by commonly abused
ingress tool transfer binaries. This behavior may indicate an attempt to sideloading a malicious DLL.
"""
id = "7543f65d-5a1a-4f88-a2d7-ddbc18672217"
license = "Elastic License v2"
name = "Ingress DLL Transfer followed by DLL SideLoading"
os_list = ["windows"]
version = "1.0.5"

query = '''
sequence with maxspan=1m
 [file where event.action != "deletion" and
   file.Ext.header_bytes : "4d5a*" and
   (
    process.name : ("MSHTA.EXE", "CertUtil.exe", "CertReq.exe", "PrintBrm.exe", "curl.exe") or
    process.executable : "?:\\Windows\\sys*\\OpenSSH\\sftp.exe"
   )] by file.name
 [library where
   (dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000 ) and dll.name : "*.dll" and
   process.code_signature.status :"trusted" and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
   dll.hash.sha256 != null and

    /* DLL loaded from the process.executable current directory */
   endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1))) and

   not process.executable :
             ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe", "?:\\Windows\\Explorer.exe", "?:\\Windows\\assembly\\*",
              "?:\\Windows\\SysWOW64\\*", "?:\\Windows\\System32\\*", "?:\\Windows\\splwow64.exe", "?:\\Windows\\Microsoft.NET\\*",
              "?:\\Windows\\Installer\\*")] by dll.name
'''

min_endpoint_version = "8.6.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 = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[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.6.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by dll.name, file.name.

Stage 1: file

[file where event.action != "deletion" and
   file.Ext.header_bytes : "4d5a*" and
   (
    process.name : ("MSHTA.EXE", "CertUtil.exe", "CertReq.exe", "PrintBrm.exe", "curl.exe") or
    process.executable : "?:\\Windows\\sys*\\OpenSSH\\sftp.exe"
   )] by file.name

Stage 2: library

[library where
   (dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000 ) and dll.name : "*.dll" and
   process.code_signature.status :"trusted" and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
   dll.hash.sha256 != null and
   endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1))) and
   not process.executable :
             ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe", "?:\\Windows\\Explorer.exe", "?:\\Windows\\assembly\\*",
              "?:\\Windows\\SysWOW64\\*", "?:\\Windows\\System32\\*", "?:\\Windows\\splwow64.exe", "?:\\Windows\\Microsoft.NET\\*",
              "?:\\Windows\\Installer\\*")] by dll.name

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.relative_file_creation_timelt
  • 5000 transforms: number corpus 6 (elastic 6)
field:"dll.Ext.relative_file_creation_time" kind:lt value:"5000"
dll.Ext.relative_file_name_modify_timelt
  • 5000 transforms: number corpus 6 (elastic 6)
field:"dll.Ext.relative_file_name_modify_time" kind:lt value:"5000"
dll.hash.sha256is_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
dll.namewildcard
  • *.dll corpus 2 (elastic 2)
field:"dll.name" kind:wildcard value:"*.dll"
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
file.Ext.header_byteswildcard
  • 4d5a* corpus 45 (elastic 45)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
process.code_signature.statuswildcard
  • trusted corpus 6 (elastic 6)
field:"SignatureStatus" kind:wildcard value:"trusted"
process.executablewildcard
  • ?:\Windows\sys*\OpenSSH\sftp.exe corpus 3 (elastic 3)
field:"Image" kind:wildcard value:"?:\Windows\sys*\OpenSSH\sftp.exe"
process.namewildcard
  • CertReq.exe corpus 20 (elastic 20)
  • CertUtil.exe corpus 45 (elastic 39, splunk 6)
  • MSHTA.EXE corpus 84 (elastic 80, splunk 4)
  • PrintBrm.exe corpus 4 (elastic 4)
  • curl.exe corpus 34 (elastic 32, splunk 2)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuswildcardtrusted, errorExpired, errorCode_endpoint*excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorExpired" field:"dll.code_signature.status" value:"errorCode_endpoint*"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\Explorer.exe, ?:\Windows\assembly\*, ?:\Windows\SysWOW64\*, ?:\Windows\System32\*, ?:\Windows\splwow64.exe, ?:\Windows\Microsoft.NET\*, ?:\Windows\Installer\*excludes:process.executable

Initial Access via macOS Installer Package

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

Identifies when a macOS installer package is executed followed by the execution of a utility that's commonly used by attackers when downloading a payload, establishing persistence, profiling an endpoint, or decompressing/decoding a file before execution. An attacker may configure an installer package to download an additional payload or malware for execution to gain initial access or establish persistence on an endpoint.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies when a macOS installer package is executed followed by the execution of a utility that's commonly used by
attackers when downloading a payload, establishing persistence, profiling an endpoint, or decompressing/decoding a file
before execution. An attacker may configure an installer package to download an additional payload or malware for
execution to gain initial access or establish persistence on an endpoint.
"""
id = "d40ffcba-b83e-4d0a-8d6d-84385def8e18"
license = "Elastic License v2"
name = "Initial Access via macOS Installer Package"
os_list = ["macos"]
reference = ["https://redcanary.com/blog/clipping-silver-sparrows-wings/", "https://youtu.be/Eow5uNHtmIg"]
version = "1.0.48"

query = '''
sequence with maxspan=1m
  [process where event.action == "exec" and process.name in ("installer", "package_script_service") and not
    process.args like~
                   ("/Library/Application Support/JAMF/Downloads/*",
                    "/tmp/KSInstallAction.*",
                    "/tmp/FLEXnet", 
                    "./Epson Scanner Monitor.pkg",
                    "./Epson Event Manager.pkg",
                    "./Epson Scanner ICA Driver.pkg",
                    "/tmp/PKInstallSandbox.*/Scripts/com.epson.pkg.eventmanager.*/Epson Scanner Monitor.pkg",
                    "/Library/Addigy/ansible/packages/TeamViewer Host */TeamViewer_Host.pkg") and not
    process.parent.executable like~ ("/usr/local/ltechagent/ltupdate",
                                     "/sbin/launchd", 
                                     "/Users/*/Library/Caches/*",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
    process.Ext.effective_parent.executable in ("/usr/local/jamf/bin/jamf",
                                                "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                                "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager")]
  [process where event.action in ("exec", "fork") and

    // Descendant of macOS installer process
    descendant of [
        process where event.action == "exec" and
        process.name in ("Installer", "package_script_service") and not
        process.args like~
                       ("/Library/Application Support/JAMF/Downloads/*",
                        "/tmp/KSInstallAction.*",
                        "/tmp/PKInstallSandbox.*/Scripts/com.epson.pkg.eventmanager.*/Epson Scanner Monitor.pkg",
                        "./Epson Scanner Monitor.pkg",
                        "/tmp/FLEXnet",
                        "/Library/Preferences/com.epson.Epson Scan OCR Component Pro.XmlType.UnInstallList.plist",
                        "./Epson Event Manager.pkg",
                        "./Epson Scanner ICA Driver.pkg",
                        "/Library/Addigy/ansible/packages/TeamViewer Host */TeamViewer_Host.pkg") and not
        process.parent.executable like~
                                    ("/usr/local/ltechagent/ltupdate",
                                     "/sbin/launchd", 
                                     "/Users/*/Library/Caches/*",
                                     "/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
        process.Ext.effective_parent.executable in ("/usr/local/jamf/bin/jamf",
                                                    "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                    "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon", 
                                                    "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                                    "/Volumes/Mac_User_SW/Fiery Master Installer.app/Contents/MacOS/Fiery Master Installer",
                                                    "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager")
        ] and

    (
      // curl scope limited to silver-sparrows to reduce noise
      (process.name in ("curl", "nscurl") and process.command_line : ("*.amazonaws.com*",
                                                         "*.cloudfront.net*", 
                                                         "*raw.githubusercontent.com*")) or
      // No hang up executed with a bash command
      (process.name == "nohup" and process.command_line : "* &") or
      // Open SSL used to encrypt or encode/decode data
      (process.name == "openssl" and process.args : ("-base64", "-enc")) or
      // Base64 used to decode data
      (process.name == "base64" and process.args : "-d") or
      // chmod used to make files readable, writable and executable by all users
      (process.name == "chmod" and process.args : ("+x", "a+x", "0777", "755", "777") and process.args : "/tmp/*" and
	   not process.args : ("/tmp/com.adobe.acrobat.DC", "/tmp/FLEXnet")) or
      // xattr used to change extended attributes for a file
      (process.name == "xattr" and ((process.args : "com.apple.quarantine" and 
        process.args : ("-d", "-w", "-?d", "-?w")) or
        (process.args == "-c")) and process.args : "/tmp/*") or
      (process.name == "touch" and process.args : "/tmp/*") or
      (process.name in ("bash", "sh", "zsh") and process.args == "-c" and process.args : ("*/bin/curl*.amazonaws.com*",
                                                                                        "*/bin/curl*.cloudfront.net*",
                                                                                        "*/bin/curl*raw.githubusercontent.com*",
                                                                                        "*/bin/osascript*",
                                                                                        "*/bin/wget*", 
                                                                                        "*/bin/chmod +x*", 
                                                                                        "*/bin/plutil*-convert*", 
                                                                                        "*/bin/openssl*-enc*",
                                                                                        "*/bin/openssl*-base64*",  
                                                                                        "*/bin/base64*-d*", 
                                                                                        "*/bin/xattr*com.apple.quarantine*",
                                                                                        "*/bin/touch /tmp/*"))
    ) and
    not process.parent.executable : ("/sbin/launchd", 
                                     "/Users/*/Library/Caches/*",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
    process.Ext.effective_parent.executable in ("/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                               "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                               "/Volumes/Mac_User_SW/Fiery Master Installer.app/Contents/MacOS/Fiery Master Installer",
                                               "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                               "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager",
                                               "/usr/local/jamf/bin/jamf")]
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[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]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"


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



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.001"
name = "Launch Agent"
reference = "https://attack.mitre.org/techniques/T1543/001/"


[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"


[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1647"
name = "Plist File Modification"
reference = "https://attack.mitre.org/techniques/T1647/"


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


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

Stages and Predicates

Stage 1: process

[process where event.action == "exec" and process.name in ("installer", "package_script_service") and not
    process.args like~
                   ("/Library/Application Support/JAMF/Downloads/*",
                    "/tmp/KSInstallAction.*",
                    "/tmp/FLEXnet", 
                    "./Epson Scanner Monitor.pkg",
                    "./Epson Event Manager.pkg",
                    "./Epson Scanner ICA Driver.pkg",
                    "/tmp/PKInstallSandbox.*/Scripts/com.epson.pkg.eventmanager.*/Epson Scanner Monitor.pkg",
                    "/Library/Addigy/ansible/packages/TeamViewer Host */TeamViewer_Host.pkg") and not
    process.parent.executable like~ ("/usr/local/ltechagent/ltupdate",
                                     "/sbin/launchd", 
                                     "/Users/*/Library/Caches/*",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
    process.Ext.effective_parent.executable in ("/usr/local/jamf/bin/jamf",
                                                "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                                "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager")]

Stage 2: process

[process where event.action in ("exec", "fork") and
    descendant of [
        process where event.action == "exec" and
        process.name in ("Installer", "package_script_service") and not
        process.args like~
                       ("/Library/Application Support/JAMF/Downloads/*",
                        "/tmp/KSInstallAction.*",
                        "/tmp/PKInstallSandbox.*/Scripts/com.epson.pkg.eventmanager.*/Epson Scanner Monitor.pkg",
                        "./Epson Scanner Monitor.pkg",
                        "/tmp/FLEXnet",
                        "/Library/Preferences/com.epson.Epson Scan OCR Component Pro.XmlType.UnInstallList.plist",
                        "./Epson Event Manager.pkg",
                        "./Epson Scanner ICA Driver.pkg",
                        "/Library/Addigy/ansible/packages/TeamViewer Host */TeamViewer_Host.pkg") and not
        process.parent.executable like~
                                    ("/usr/local/ltechagent/ltupdate",
                                     "/sbin/launchd",
                                     "/Users/*/Library/Caches/*",
                                     "/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
        process.Ext.effective_parent.executable in ("/usr/local/jamf/bin/jamf",
                                                    "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
                                                    "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                    "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                                    "/Volumes/Mac_User_SW/Fiery Master Installer.app/Contents/MacOS/Fiery Master Installer",
                                                    "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager")
        ] and
    (
      (process.name in ("curl", "nscurl") and process.command_line : ("*.amazonaws.com*",
                                                         "*.cloudfront.net*",
                                                         "*raw.githubusercontent.com*")) or
      (process.name == "nohup" and process.command_line : "* &") or
      (process.name == "openssl" and process.args : ("-base64", "-enc")) or
      (process.name == "base64" and process.args : "-d") or
      (process.name == "chmod" and process.args : ("+x", "a+x", "0777", "755", "777") and process.args : "/tmp/*" and
	   not process.args : ("/tmp/com.adobe.acrobat.DC", "/tmp/FLEXnet")) or
      (process.name == "xattr" and ((process.args : "com.apple.quarantine" and
        process.args : ("-d", "-w", "-?d", "-?w")) or
        (process.args == "-c")) and process.args : "/tmp/*") or
      (process.name == "touch" and process.args : "/tmp/*") or
      (process.name in ("bash", "sh", "zsh") and process.args == "-c" and process.args : ("*/bin/curl*.amazonaws.com*",
                                                                                        "*/bin/curl*.cloudfront.net*",
                                                                                        "*/bin/curl*raw.githubusercontent.com*",
                                                                                        "*/bin/osascript*",
                                                                                        "*/bin/wget*",
                                                                                        "*/bin/chmod +x*",
                                                                                        "*/bin/plutil*-convert*",
                                                                                        "*/bin/openssl*-enc*",
                                                                                        "*/bin/openssl*-base64*",
                                                                                        "*/bin/base64*-d*",
                                                                                        "*/bin/xattr*com.apple.quarantine*",
                                                                                        "*/bin/touch /tmp/*"))
    ) and
    not process.parent.executable : ("/sbin/launchd",
                                     "/Users/*/Library/Caches/*",
                                     "/Library/PrivilegedHelperTools/*",
                                     "/private/var/folders/*/download/ARMDCHammer") and not
    process.Ext.effective_parent.executable in ("/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater",
                                               "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                               "/Volumes/Mac_User_SW/Fiery Master Installer.app/Contents/MacOS/Fiery Master Installer",
                                               "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
                                               "/Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager",
                                               "/usr/local/jamf/bin/jamf")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.actionin
  • exec corpus 180 (elastic 180)
  • fork corpus 6 (elastic 6)
field:"EventType" kind:in
process.argseq
  • -c corpus 91 (elastic 91)
field:"process.args" kind:eq value:"-c"
process.argswildcard
  • */bin/base64*-d*
  • */bin/chmod +x*
  • */bin/curl*.amazonaws.com*
  • */bin/curl*.cloudfront.net*
  • */bin/curl*raw.githubusercontent.com*
  • */bin/openssl*-base64*
  • */bin/openssl*-enc*
  • */bin/osascript*
  • */bin/plutil*-convert*
  • */bin/touch /tmp/*
  • */bin/wget*
  • */bin/xattr*com.apple.quarantine*
  • +x
  • -?d corpus 2 (elastic 2)
  • -?w corpus 2 (elastic 2)
  • -base64 corpus 2 (elastic 2)
  • -d corpus 4 (elastic 4)
  • -enc corpus 2 (elastic 2)
  • -w corpus 2 (elastic 2)
  • /tmp/* corpus 7 (elastic 7)
  • 0777
  • 755
  • 777
  • a+x
  • com.apple.quarantine
field:"process.args" kind:wildcard
process.command_linewildcard
  • * &
  • *.amazonaws.com*
  • *.cloudfront.net*
  • *raw.githubusercontent.com*
field:"CommandLine" kind:wildcard
process.nameeq
  • base64 corpus 6 (elastic 6)
  • chmod corpus 10 (elastic 10)
  • nohup corpus 3 (elastic 3)
  • openssl corpus 24 (elastic 24)
  • touch corpus 5 (elastic 5)
  • xattr corpus 2 (elastic 2)
field:"process_basename" kind:eq
process.namein
  • bash corpus 181 (elastic 181)
  • curl corpus 82 (elastic 82)
  • installer
  • nscurl corpus 41 (elastic 41)
  • package_script_service
  • sh corpus 180 (elastic 180)
  • zsh corpus 180 (elastic 180)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.effective_parent.executablein/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService, /Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon, /Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager, /usr/local/jamf/bin/jamfexcludes:process.Ext.effective_parent.executable
process.argswildcard/Library/Application Support/JAMF/Downloads/*, /tmp/KSInstallAction.*, /tmp/FLEXnet, ./Epson Scanner Monitor.pkg, ./Epson Event Manager.pkg, ./Epson Scanner ICA Driver.pkg, /tmp/PKInstallSandbox.*/Scripts/com.epson.pkg.eventmanager.*/Epson Scanner Monitor.pkg, /Library/Addigy/ansible/packages/TeamViewer Host */TeamViewer_Host.pkgexcludes:process.args
process.parent.executablewildcard/usr/local/ltechagent/ltupdate, /sbin/launchd, /Users/*/Library/Caches/*, /Library/PrivilegedHelperTools/*, /Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater, /private/var/folders/*/download/ARMDCHammerexcludes:process.parent.executable
process.Ext.effective_parent.executablein/Applications/Epson Software/EPSON Software Updater.app/Contents/MacOS/EPSON Software Updater, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService, /Volumes/Fiery Software Manager/Fiery Software Manager.app/Contents/MacOS/Fiery Software Manager, /Volumes/Mac_User_SW/Fiery Master Installer.app/Contents/MacOS/Fiery Master Installer, /usr/local/jamf/bin/jamfexcludes:process.Ext.effective_parent.executable
process.parent.executablewildcard/sbin/launchd, /Users/*/Library/Caches/*, /Library/PrivilegedHelperTools/*, /private/var/folders/*/download/ARMDCHammerexcludes:process.parent.executable

Javascript Reverse Shell via Node.js

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

This rule detects the creation of a Javascript reverse shell through Node.js. Attackers may spawn reverse shells to establish persistence onto a target system. By using Node.js, attackers may attempt to evade detection and leverage the platform's capabilities for various malicious purposes, such as downloading and executing payloads, establishing persistence, or exfiltrating data.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the creation of a Javascript reverse shell through Node.js. Attackers may spawn reverse shells to
establish persistence onto a target system. By using Node.js, attackers may attempt to evade detection and leverage the
platform's capabilities for various malicious purposes, such as downloading and executing payloads, establishing
persistence, or exfiltrating data.
"""
id = "88c1728e-2d2e-48ff-9c77-a084efdd4498"
license = "Elastic License v2"
name = "Javascript Reverse Shell via Node.js"
os_list = ["linux"]
version = "1.0.5"

query = '''
sequence by process.entity_id with maxspan=10s
  [process where event.type == "start" and event.action == "exec" and process.name == "node" and 
   process.args == "node" and process.args_count == 2 and process.args : (
     "/tmp/*.js", "/var/tmp/*.js", "/dev/shm/*.js", "/tmp/*.mjs", "/var/tmp/*.mjs", "/dev/shm/*.mjs"
   )]
  [network where event.type == "start" and event.action == "connection_attempted" and not (
    destination.port == 53 or
    cidrmatch(
     destination.ip, "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4", "198.19.0.0/16", "192.18.0.0/15", 
      "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "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",  "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", "::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

[[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.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 = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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 == "exec" and process.name == "node" and 
   process.args == "node" and process.args_count == 2 and process.args : (
     "/tmp/*.js", "/var/tmp/*.js", "/dev/shm/*.js", "/tmp/*.mjs", "/var/tmp/*.mjs", "/dev/shm/*.mjs"
   )]

Stage 2: network

[network where event.type == "start" and event.action == "connection_attempted" and not (
    destination.port == 53 or
    cidrmatch(
     destination.ip, "240.0.0.0/4", "233.252.0.0/24", "224.0.0.0/4", "198.19.0.0/16", "192.18.0.0/15", 
      "192.0.0.0/24", "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "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",  "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", "::1", "FE80::/10",
      "FF00::/8"
    )
   )
  ]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match240.0.0.0/4, 233.252.0.0/24, 224.0.0.0/4, 198.19.0.0/16, 192.18.0.0/15, 192.0.0.0/24, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 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, 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, ::1, FE80::/10, FF00::/8excludes:destination.ip
destination.porteq53excludes:destination.port field:"destination.port" value:"53"

LSASS Memory Dump Handle Access

#
Status
production
Severity
medium
Time window
9m
Group by
winlog.event_data.ProcessName, winlog.event_data.SubjectUserName
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies handle requests for the Local Security Authority Subsystem Service (LSASS) object access with specific access masks that many tools with a capability to dump memory to disk use (0x1fffff, 0x1010, 0x120089). This rule is tool agnostic as it has been validated against a host of various LSASS dump tools such as SharpDump, Procdump, Mimikatz, Comsvcs etc. It detects this behavior at a low level and does not depend on a specific tool or dump file name.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2022/02/16"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/12"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"

[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"

[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""

[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""


[rule]
author = ["Elastic"]
description = """
Identifies handle requests for the Local Security Authority Subsystem Service (LSASS) object access with specific access
masks that many tools with a capability to dump memory to disk use (0x1fffff, 0x1010, 0x120089). This rule is tool
agnostic as it has been validated against a host of various LSASS dump tools such as SharpDump, Procdump, Mimikatz,
Comsvcs etc. It detects this behavior at a low level and does not depend on a specific tool or dump file name.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "LSASS Memory Dump Handle Access"
note = """## Triage and analysis

### Investigating LSASS Memory Dump Handle Access

Local Security Authority Server Service (LSASS) is a process in Microsoft Windows operating systems that is responsible for enforcing security policy on the system. It verifies users logging on to a Windows computer or server, handles password changes, and creates access tokens.

Adversaries may attempt to access credential material stored in LSASS process memory. After a user logs on, the system generates and stores a variety of credential materials in LSASS process memory. This is meant to facilitate single sign-on (SSO) ensuring a user isn’t prompted each time resource access is requested. These credential materials can be harvested by an adversary using administrative user or SYSTEM privileges to conduct lateral movement using [alternate authentication material](https://attack.mitre.org/techniques/T1550/).

> **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.

#### Possible investigation steps

- 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.
- Examine the host for derived artifacts that indicate suspicious activities:
  - Analyze the process executable using a private sandboxed analysis system.
  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
    - Attempts to contact external domains and addresses.
      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
      - Examine the DNS cache for suspicious or anomalous entries.
        - $osquery_0
    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
    - Examine the host services for suspicious or anomalous entries.
      - $osquery_1
      - $osquery_2
      - $osquery_3
  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.


### False positive analysis

- There should be very few or no false positives for this rule. If this activity is expected or noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.
- If the process is related to antivirus or endpoint detection and response solutions, validate that it is installed on the correct path and signed with the company's valid digital signature.

### 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.
- Scope compromised credentials and disable the accounts.
- 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.
- Remove and block malicious artifacts identified during triage.
- 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.
- 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://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4656",
    "https://twitter.com/jsecurity101/status/1227987828534956033?s=20",
    "https://attack.mitre.org/techniques/T1003/001/",
    "https://threathunterplaybook.com/notebooks/windows/06_credential_access/WIN-170105221010.html",
    "http://findingbad.blogspot.com/2017/",
    "https://www.elastic.co/security-labs/detect-credential-access",
]
risk_score = 47
rule_id = "208dbe77-01ed-4954-8d44-1e5751cb20de"
setup = """## Setup

Audit Handle Manipulation must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-handle-manipulation
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:"windows" and event.code:"4656" and
  (
    winlog.event_data.AccessMask : ("0x1fffff" or "0x1010" or "0x120089" or "0x1F3FFF") or
    winlog.event_data.AccessMaskDescription : ("READ_CONTROL" or "Read from process memory")
  ) and
  winlog.event_data.ObjectType : "Process" and 
  winlog.event_data.ObjectName : *\\Windows\\System32\\lsass.exe and
  not winlog.event_data.ProcessName : (
      "C:\Windows\System32\wbem\WmiPrvSE.exe" or
      "C:\Windows\SysWOW64\wbem\WmiPrvSE.exe" or
      "C:\Windows\System32\dllhost.exe" or
      "C:\Windows\System32\svchost.exe" or
      "C:\Windows\System32\msiexec.exe" or
      "C:\Windows\explorer.exe" or 
      "C:\\Windows\\Sysmon64.exe" or 
      "C:\\Windows\\BTPass\\x64\\BTPassSvc.exe" or 
      "C:\\Windows\\Sysmon.exe" or 
      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
       C\:\\Windows\\System32\\DriverStore\\FileRepository\\fn.inf_amd64_*\\driver\\tphkload.exe
  )
'''

[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
case_insensitive = true
value = "C:\\\\Program Files (x86)\\\\*.exe"

[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
case_insensitive = true
value = "C:\\\\Program Files\\\\*.exe"

[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
case_insensitive = true
value = "?:\\\\ProgramData\\\\Microsoft\\\\Windows Defender\\\\*.exe"

[[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.new_terms]
field = "new_terms_fields"
value = ["winlog.event_data.ProcessName", "winlog.event_data.SubjectUserName"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-1d"

Stages and Predicates

Stage 1: new_terms

host.os.type:"windows" and event.code:"4656" and
  (
    winlog.event_data.AccessMask : ("0x1fffff" or "0x1010" or "0x120089" or "0x1F3FFF") or
    winlog.event_data.AccessMaskDescription : ("READ_CONTROL" or "Read from process memory")
  ) and
  winlog.event_data.ObjectType : "Process" and 
  winlog.event_data.ObjectName : *\\Windows\\System32\\lsass.exe and
  not winlog.event_data.ProcessName : (
      "C:\Windows\System32\wbem\WmiPrvSE.exe" or
      "C:\Windows\SysWOW64\wbem\WmiPrvSE.exe" or
      "C:\Windows\System32\dllhost.exe" or
      "C:\Windows\System32\svchost.exe" or
      "C:\Windows\System32\msiexec.exe" or
      "C:\Windows\explorer.exe" or 
      "C:\\Windows\\Sysmon64.exe" or 
      "C:\\Windows\\BTPass\\x64\\BTPassSvc.exe" or 
      "C:\\Windows\\Sysmon.exe" or 
      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
       C\:\\Windows\\System32\\DriverStore\\FileRepository\\fn.inf_amd64_*\\driver\\tphkload.exe
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
winlog.event_data.ProcessNameeqC:\Windows\BTPass\x64\BTPassSvc.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\BTPass\x64\BTPassSvc.exe"
winlog.event_data.ProcessNameeqC:\Windows\SysWOW64\wbem\WmiPrvSE.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\SysWOW64\wbem\WmiPrvSE.exe"
winlog.event_data.ProcessNameeqC:\Windows\Sysmon.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\Sysmon.exe"
winlog.event_data.ProcessNameeqC:\Windows\Sysmon64.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\Sysmon64.exe"
winlog.event_data.ProcessNameeqC:\Windows\System32\RtkAudUService64.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\RtkAudUService64.exe"
winlog.event_data.ProcessNameeqC:\Windows\System32\dllhost.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\dllhost.exe"
winlog.event_data.ProcessNameeqC:\Windows\System32\msiexec.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\msiexec.exe"
winlog.event_data.ProcessNameeqC:\Windows\System32\svchost.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\svchost.exe"
winlog.event_data.ProcessNameeqC:\Windows\System32\wbem\WmiPrvSE.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\wbem\WmiPrvSE.exe"
winlog.event_data.ProcessNameeqC:\Windows\explorer.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\explorer.exe"
winlog.event_data.ProcessNamewildcardC:\Windows\System32\DriverStore\FileRepository\fn.inf_amd64_*\driver\tphkload.exeexcludes:winlog.event_data.ProcessName field:"winlog.event_data.ProcessName" value:"C:\Windows\System32\DriverStore\FileRepository\fn.inf_amd64_*\driver\tphkload.exe"

M365 AIR Investigation Signal

#
Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies Microsoft 365 Automated Investigation and Response (AIR) events including automated investigations, manual investigations, and admin-initiated actions. These events track Microsoft's automated threat response activities and can indicate active threats being remediated. This building block rule generates security events for correlation, threat hunting, and telemetry collection to provide visibility into automated response actions.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access
Execution

Telemetry Coverage

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2026/02/20"
integration = ["o365"]
maturity = "production"
updated_date = "2026/02/20"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies Microsoft 365 Automated Investigation and Response (AIR) events including automated investigations,
manual investigations, and admin-initiated actions. These events track Microsoft's automated threat response
activities and can indicate active threats being remediated. This building block rule generates security events
for correlation, threat hunting, and telemetry collection to provide visibility into automated response actions.
"""
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 AIR Investigation Signal"
references = [
    "https://learn.microsoft.com/en-us/defender-office-365/air-about",
    "https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema#enum-auditlogrecordtype---type-edmint32",
]
risk_score = 21
rule_id = "7ab5b02c-0026-4c71-b523-dd1e97e15477"
setup = """### Additional notes

For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "low"
tags = [
    "Domain: Cloud",
    "Domain: SaaS",
    "Data Source: Microsoft 365",
    "Data Source: Microsoft 365 Audit Logs",
    "Data Source: Microsoft Defender for Office 365",
    "Use Case: Threat Detection",
    "Use Case: Automated Response Tracking",
    "Tactic: Initial Access",
    "Tactic: Execution",
    "Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.dataset:o365.audit and
    event.code:(AirInvestigation or AirManualInvestigation or AirAdminActionInvestigation)
'''


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


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


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

Stages and Predicates

Stage 1: query

event.dataset:o365.audit and
    event.code:(AirInvestigation or AirManualInvestigation or AirAdminActionInvestigation)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.codein
  • AirAdminActionInvestigation
  • AirInvestigation
  • AirManualInvestigation
field:"EventID" kind:in
event.dataseteq
  • o365.audit corpus 11 (elastic 11)
field:"event.dataset" kind:eq value:"o365.audit"

New System Kext File and Immediate Load via KextLoad

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

Detects the use of the cp or mv binaries to add a kext file in the System extensions directory and then immediately load it via the kextload utility. Threat actors have created malicious kernel extensions and attempted to load them on compromised systems in order to bypass defences and manipulate their presence on the machine.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the use of the cp or mv binaries to add a kext file in the System extensions directory and then immediately load
it via the kextload utility. Threat actors have created malicious kernel extensions and attempted to load them on
compromised systems in order to bypass defences and manipulate their presence on the machine.
"""
id = "de869aa1-c63a-451e-a953-7069ec39ba60"
license = "Elastic License v2"
name = "New System Kext File and Immediate Load via KextLoad"
os_list = ["macos"]
version = "1.0.19"

query = '''
sequence by process.parent.pid with maxspan=20s
[process where event.type == "start" and event.action == "exec" and 
    process.name in ("mv", "cp") and
    process.args like "/System/Library/Extensions/*.kext"]
[process where event.type == "start" and event.action == "exec" and 
    process.name == "kextload"]
'''

min_endpoint_version = "8.10.2"
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 = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"



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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and 
    process.name in ("mv", "cp") and
    process.args like "/System/Library/Extensions/*.kext"]

Stage 2: process

[process where event.type == "start" and event.action == "exec" and 
    process.name == "kextload"]

Indicators

These rows show field, operator, and value matches.

Potential Image Hollowing via Mapping

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to map the whole content of a file in a memory region with RWX permissions. This may indicate an attempt to perform module hollowing.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attempts to map the whole content of a file in a memory region with RWX permissions. This may indicate an
attempt to perform module hollowing.
"""
id = "5cb45f1b-9061-4bdd-8e45-3cbef2dbf465"
license = "Elastic License v2"
name = "Potential Image Hollowing via Mapping"
os_list = ["windows"]
reference = [
    "https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffile2",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
    "https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
]
version = "1.0.3"

query = '''
api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and
 /* map the whole file to an executable memory region */
 process.Ext.api.parameters.size == 0 and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.metadata.target_address_path like ("c:\\*.dll", "c:\\*.exe") and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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 in ("MapViewOfFile", "MapViewOfFile2") and
 process.Ext.api.parameters.size == 0 and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.metadata.target_address_path like ("c:\\*.dll", "c:\\*.exe") and
 _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
 not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Potential Internal Linux SSH Brute Force Detected

#
Status
production
Severity
medium
Time window
30s
Group by
host.id, source.ip, user.name
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies multiple internal consecutive login failures targeting a user account from the same source address within a short time interval. Adversaries will often brute force login attempts across multiple users with a common or known password, in an attempt to gain access to these accounts.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/02/21"
integration = ["system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies multiple internal consecutive login failures targeting a user account from the same source address within a
short time interval. Adversaries will often brute force login attempts across multiple users with a common or known
password, in an attempt to gain access to these accounts.
"""
from = "now-9m"
index = ["filebeat-*", "logs-system.auth-*"]
language = "eql"
license = "Elastic License v2"
max_signals = 5
name = "Potential Internal Linux SSH Brute Force Detected"
note = """## Triage and analysis

### Investigating Potential Internal Linux SSH Brute Force Detected

The rule identifies consecutive internal SSH login failures targeting a user account from the same source IP address to the same target host indicating brute force login attempts.

#### Possible investigation steps

- Investigate the login failure user name(s).
- Investigate the source IP address of the failed ssh login attempt(s).
- Investigate other alerts associated with the user/host during the past 48 hours.
- Identify the source and the target computer and their roles in the IT environment.

### False positive analysis

- Authentication misconfiguration or obsolete credentials.
- Service account password expired.
- Infrastructure or availability issue.

### Related Rules

- Potential External Linux SSH Brute Force Detected - fa210b61-b627-4e5e-86f4-17e8270656ab
- Potential SSH Password Guessing - 8cb84371-d053-4f4f-bce0-c74990e28f28

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- 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.
- 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).
"""
risk_score = 47
rule_id = "1c27fa22-7727-4dd3-81c0-de6da5555feb"
setup = """## Setup

This rule requires data coming in from Filebeat.

### Filebeat Setup
Filebeat is a lightweight shipper for forwarding and centralizing log data. Installed as an agent on your servers, Filebeat monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or Logstash for indexing.

#### The following steps should be executed in order to add the Filebeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setup-repositories.html).
- To run Filebeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html).
- To run Filebeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html).
- For quick start information for Filebeat refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/8.11/filebeat-installation-configuration.html).
- For complete “Setup and Run Filebeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setting-up-and-running.html).

#### Rule Specific Setup Note
- This rule requires the “Filebeat System Module” to be enabled.
- The system module collects and parses logs created by the system logging service of common Unix/Linux based distributions.
- To run the system module of Filebeat on Linux follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-system.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence by host.id, source.ip, user.name with maxspan=30s
  [ authentication where host.os.type == "linux" and 
   event.action in ("ssh_login", "user_login") and event.outcome == "failure" and
   cidrmatch(source.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") ] with runs = 60
'''

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

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

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

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

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

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

Stages and Predicates

Stage 1: authentication ×60

[ authentication where host.os.type == "linux" and 
   event.action in ("ssh_login", "user_login") and event.outcome == "failure" and
   cidrmatch(source.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") ] with runs = 60

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ssh_login
  • user_login
field:"EventType" kind:in
event.outcomeeq
  • failure
field:"event.outcome" kind:eq value:"failure"
source.ipcidr_match
  • 10.0.0.0/8
  • 100.64.0.0/10
  • 127.0.0.0/8
  • 169.254.0.0/16
  • 172.16.0.0/12
  • 192.0.0.0/24
  • 192.0.0.0/29
  • 192.0.0.10/32
  • 192.0.0.170/32
  • 192.0.0.171/32
  • 192.0.0.8/32
  • 192.0.0.9/32
  • 192.0.2.0/24
  • 192.168.0.0/16
  • 192.175.48.0/24
  • 192.31.196.0/24
  • 192.52.193.0/24
  • 192.88.99.0/24
  • 198.18.0.0/15
  • 198.51.100.0/24
  • 203.0.113.0/24
  • 224.0.0.0/4
  • 240.0.0.0/4
  • ::1
  • FE80::/10
  • FF00::/8
field:"src_ip" kind:cidr_match

Potential Library Load via ROP Gadgets

#
Source
github.com/elastic/protections-artifacts

Identifies the load of a library from unusual modules or 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

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the load of a library from unusual modules or NTDLL offsets. This may indicate an attempt to bypass API
monitoring using Return Oriented Programming (ROP) assembly gadgets to execute a syscall instruction.
"""
id = "415c647f-ebb1-474d-b621-192d6f64c01d"
license = "Elastic License v2"
name = "Potential Library Load via ROP Gadgets"
os_list = ["windows"]
version = "1.0.33"

query = '''
library where process.pid != 4 and
 process.executable != null and dll.name != null and
 not startswith~(dll.name, process.name) and not dll.name : "ntdll.dll" and
 process.thread.Ext.call_stack_summary : ("ntdll.dll|*", "win32u.dll|*") and
 dll.name : ("ws2_32.dll", "wininet.dll", "winhttp.dll", "amsi.dll",  "ntdll.dll", "dnsapi.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, 
                  $entry.symbol_info: ("*ntdll.dll*!Ldr*", "*ntdll.dll!LdrLoadDll*", "*KernelBase.dll*!LoadLibrary*", "*ntdll.dll*!*MapViewOfSection*",
                                       "*wow64win.dll+0x*", "*ntdll.dll!NtMapViewOfSection*",
                                       "*\\KernelBase.dll!KernelbasePostInit*", "*\\ntdll.dll!RtlCaptureStackBackTrace*", "*ntdll.dll!NtQueryVirtualMemory*",
                                       "*ntdll.dll!ZwQueryVirtualMemory*", "*ntdll.dll!ZwMapViewOfSection*", "*ntdll.dll!ZwReadFile*",
                                      "*ntdll.dll*!*OpenThreadTokenEx*", "*ntdll.dll*!*DeviceIoControlFile*", "*ntdll.dll*!NtOpenProcess*",
                                      "*ntdll.dll*!*CreateUserProcess*", "*ntdll.dll*!NtTerminateProcess*", "*ntdll.dll*!NtAlpcOpenSenderProcess*",
                                      "*ntdll.dll*!*ReplyWaitReceivePortEx*", "*ntdll.dll*!NtSetInformationFile*", "*ntdll.dll!ZwSetInformationFile*", "*ntdll.dll!TpAllocPool*",
                                      "*ntdll.dll!RtlUnhandledExceptionFilter*", "*ntdll.dll*!*AlpcOpenSenderProcess*", "*ntdll.dll!KiUserApcDispatcher*", 
                                      "*ntdll.dll!TpCallbackIndependent*", "*win32u.dll!NtGdiDdDDIQueryAdapterInfo*", "*ntdll.dll!*DuplicateObject*",
                                      "*kernel32.dll!CreateThread*", "*KernelBase.dll!CreateRemoteThread*", "*ntdll.dll!*SetInformationWorkerFactory*", "*ntdll.dll!TpReleaseCleanupGroupMembers*",
                                      "*ntdll.dll!NtReleaseWorkerFactoryWorker+*", "*ntdll.dll!ZwWaitForWorkViaWorkerFactory*",
                                      "*KernelBase.dll!MapViewOfFileEx*", "*ntdll.dll!NtdllDialogWndProc*", "*ntdll.dll!EtwRegisterSecurityProvider*",
                                      "*ntdll.dll!NtMapUserPhysicalPagesScatter*", "?:\\Windows\\System32\\cyinjct.dll!CyProcessPreinitThunk*",
                                      "*\\ntdll.dll!ZwAlpcDeleteSecurityContext*", "*\\ntdll.dll!ZwAccessCheckAndAuditAlarm*",
                                      "*\\win32u.dll!NtGdiDdDDIQueryAdapterInfo*", "*\\ntdll.dll!NtdllDefWindowProc_W*",
                                      "C:\\Windows\\System32\\ntdll.dll!TpCallbackMayRunLong*", "C:\\Windows\\System32\\KernelBase.dll!GlobalUnlock+*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtGetTickCount*", "C:\\Windows\\System32\\ntdll.dll!NtSetDebugFilterState*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtWaitForDebugEvent*", "C:\\Windows\\System32\\ntdll.dll!RtlEncodeRemotePointer*",
                                      "C:\\Windows\\System32\\ntdll.dll!SbExecuteProcedure*", "C:\\Windows\\System32\\ntdll.dll!MD4Init*", "*ntdll.dll!*CallbackReturn*",
                                      "C:\\Windows\\System32\\ntdll.dll!ZwWaitForDebugEvent+*", "*ntdll.dll!RtlReAllocateHeap*", "*ntdll.dll!RtlAllocateHeap*",
                                      "*ntdll.dll!NtReplyPort*", "*ntdll.dll!ZwCallbackReturn*", "*ntdll.dll!NtCreateWnfStateName*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtRequestWaitReplyPort*", "C:\\Windows\\System32\\ntdll.dll!NtAlpcImpersonateClientOfPort*",
                                      "C:\\Windows\\System32\\ntdll.dll!RtlInsertElementGenericTableFullAvl*", "C:\\Windows\\System32\\ntdll.dll!RtlLookupElementGenericTableAvl*",
                                      "C:\\Windows\\System32\\ntdll.dll!RtlCloneUserProcess*", "*ntdll.dll!RtlSetThreadSubProcessTag*",
                                      /* Win11 24H2/25H2 (builds 26100/26200) moved ntdll loader internals away from their classic exports,
                                         nearest-export symbolication resolves Ldrp* frames to these unrelated exports */
                                      "*ntdll.dll!RtlGetSuiteMask+*", "*ntdll.dll!RtlLocateExtendedFeature+*", "*ntdll.dll!NtInitiatePowerAction+*")) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*ntdll.dll*" and $entry.allocation_private_bytes > 0) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*ntdll.dll+0x*") and
 /* trusted-signed process whose stack resolves back into its own main image contradicts the hidden-caller
    premise; covers Go runtimes (e.g. Elastic Agent) whose symbol-less binaries cannot rescue attribution */
 not (process.code_signature.trusted == true and stringcontains~(process.thread.Ext.call_stack_summary, process.name)) and
 /* fully module-backed stack in a trusted-signed process contradicts the hidden-caller premise: ROP payloads live in
    unbacked memory, which surfaces as Unbacked/Unknown segments in the stack summary. Each monthly 26100/26200 build
    reshuffles the nearest-export misattributions (26200.8457 resolves loader internals to RtlGetSuiteMask and
    RtlLocateExtendedFeature, 26200.8875 to RtlDecodeSystemPointer, wcsnlen and TpCaptureCaller), so symbol
    allowlisting alone cannot keep up */
 not (process.code_signature.trusted == true and
      not stringcontains~(process.thread.Ext.call_stack_summary, "unbacked") and
      not stringcontains~(process.thread.Ext.call_stack_summary, "unknown")) and
 /* CLR frame in a trusted-signed process identifies the caller as the .NET runtime (P/Invoke or runtime-internal
    LoadLibrary), contradicting the hidden-caller premise; covers JIT-compiled callers whose stacks do contain
    unbacked regions but cannot rescue attribution when nearest-export drift hides the Ldrp and LoadLibrary frames */
 not (process.code_signature.trusted == true and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*\\clr.dll*", "*\\coreclr.dll*"))) and
 not process.thread.Ext.call_stack_summary like ("ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|*",
                                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|combase.dll|wbemprox.dll|wbemdisp.dll|oleaut32.dll|wbemdisp.dll|oleaut32.dll|rpcrt4.dll|combase.dll|oleaut32.dll|combase.dll|user32.dll") and
 not (process.executable : "C:\\Program Files\\Tenable\\Nessus Agent\\nessus*.exe" and process.code_signature.subject_name == "TENABLE, INC." and process.code_signature.trusted == true)
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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: library

library where process.pid != 4 and
 process.executable != null and dll.name != null and
 not startswith~(dll.name, process.name) and not dll.name : "ntdll.dll" and
 process.thread.Ext.call_stack_summary : ("ntdll.dll|*", "win32u.dll|*") and
 dll.name : ("ws2_32.dll", "wininet.dll", "winhttp.dll", "amsi.dll",  "ntdll.dll", "dnsapi.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, 
                  $entry.symbol_info: ("*ntdll.dll*!Ldr*", "*ntdll.dll!LdrLoadDll*", "*KernelBase.dll*!LoadLibrary*", "*ntdll.dll*!*MapViewOfSection*",
                                       "*wow64win.dll+0x*", "*ntdll.dll!NtMapViewOfSection*",
                                       "*\\KernelBase.dll!KernelbasePostInit*", "*\\ntdll.dll!RtlCaptureStackBackTrace*", "*ntdll.dll!NtQueryVirtualMemory*",
                                       "*ntdll.dll!ZwQueryVirtualMemory*", "*ntdll.dll!ZwMapViewOfSection*", "*ntdll.dll!ZwReadFile*",
                                      "*ntdll.dll*!*OpenThreadTokenEx*", "*ntdll.dll*!*DeviceIoControlFile*", "*ntdll.dll*!NtOpenProcess*",
                                      "*ntdll.dll*!*CreateUserProcess*", "*ntdll.dll*!NtTerminateProcess*", "*ntdll.dll*!NtAlpcOpenSenderProcess*",
                                      "*ntdll.dll*!*ReplyWaitReceivePortEx*", "*ntdll.dll*!NtSetInformationFile*", "*ntdll.dll!ZwSetInformationFile*", "*ntdll.dll!TpAllocPool*",
                                      "*ntdll.dll!RtlUnhandledExceptionFilter*", "*ntdll.dll*!*AlpcOpenSenderProcess*", "*ntdll.dll!KiUserApcDispatcher*", 
                                      "*ntdll.dll!TpCallbackIndependent*", "*win32u.dll!NtGdiDdDDIQueryAdapterInfo*", "*ntdll.dll!*DuplicateObject*",
                                      "*kernel32.dll!CreateThread*", "*KernelBase.dll!CreateRemoteThread*", "*ntdll.dll!*SetInformationWorkerFactory*", "*ntdll.dll!TpReleaseCleanupGroupMembers*",
                                      "*ntdll.dll!NtReleaseWorkerFactoryWorker+*", "*ntdll.dll!ZwWaitForWorkViaWorkerFactory*",
                                      "*KernelBase.dll!MapViewOfFileEx*", "*ntdll.dll!NtdllDialogWndProc*", "*ntdll.dll!EtwRegisterSecurityProvider*",
                                      "*ntdll.dll!NtMapUserPhysicalPagesScatter*", "?:\\Windows\\System32\\cyinjct.dll!CyProcessPreinitThunk*",
                                      "*\\ntdll.dll!ZwAlpcDeleteSecurityContext*", "*\\ntdll.dll!ZwAccessCheckAndAuditAlarm*",
                                      "*\\win32u.dll!NtGdiDdDDIQueryAdapterInfo*", "*\\ntdll.dll!NtdllDefWindowProc_W*",
                                      "C:\\Windows\\System32\\ntdll.dll!TpCallbackMayRunLong*", "C:\\Windows\\System32\\KernelBase.dll!GlobalUnlock+*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtGetTickCount*", "C:\\Windows\\System32\\ntdll.dll!NtSetDebugFilterState*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtWaitForDebugEvent*", "C:\\Windows\\System32\\ntdll.dll!RtlEncodeRemotePointer*",
                                      "C:\\Windows\\System32\\ntdll.dll!SbExecuteProcedure*", "C:\\Windows\\System32\\ntdll.dll!MD4Init*", "*ntdll.dll!*CallbackReturn*",
                                      "C:\\Windows\\System32\\ntdll.dll!ZwWaitForDebugEvent+*", "*ntdll.dll!RtlReAllocateHeap*", "*ntdll.dll!RtlAllocateHeap*",
                                      "*ntdll.dll!NtReplyPort*", "*ntdll.dll!ZwCallbackReturn*", "*ntdll.dll!NtCreateWnfStateName*",
                                      "C:\\Windows\\System32\\ntdll.dll!NtRequestWaitReplyPort*", "C:\\Windows\\System32\\ntdll.dll!NtAlpcImpersonateClientOfPort*",
                                      "C:\\Windows\\System32\\ntdll.dll!RtlInsertElementGenericTableFullAvl*", "C:\\Windows\\System32\\ntdll.dll!RtlLookupElementGenericTableAvl*",
                                      "C:\\Windows\\System32\\ntdll.dll!RtlCloneUserProcess*", "*ntdll.dll!RtlSetThreadSubProcessTag*",
                                      /* Win11 24H2/25H2 (builds 26100/26200) moved ntdll loader internals away from their classic exports,
                                         nearest-export symbolication resolves Ldrp* frames to these unrelated exports */
                                      "*ntdll.dll!RtlGetSuiteMask+*", "*ntdll.dll!RtlLocateExtendedFeature+*", "*ntdll.dll!NtInitiatePowerAction+*")) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*ntdll.dll*" and $entry.allocation_private_bytes > 0) and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*ntdll.dll+0x*") and
 /* trusted-signed process whose stack resolves back into its own main image contradicts the hidden-caller
    premise; covers Go runtimes (e.g. Elastic Agent) whose symbol-less binaries cannot rescue attribution */
 not (process.code_signature.trusted == true and stringcontains~(process.thread.Ext.call_stack_summary, process.name)) and
 /* fully module-backed stack in a trusted-signed process contradicts the hidden-caller premise: ROP payloads live in
    unbacked memory, which surfaces as Unbacked/Unknown segments in the stack summary. Each monthly 26100/26200 build
    reshuffles the nearest-export misattributions (26200.8457 resolves loader internals to RtlGetSuiteMask and
    RtlLocateExtendedFeature, 26200.8875 to RtlDecodeSystemPointer, wcsnlen and TpCaptureCaller), so symbol
    allowlisting alone cannot keep up */
 not (process.code_signature.trusted == true and
      not stringcontains~(process.thread.Ext.call_stack_summary, "unbacked") and
      not stringcontains~(process.thread.Ext.call_stack_summary, "unknown")) and
 /* CLR frame in a trusted-signed process identifies the caller as the .NET runtime (P/Invoke or runtime-internal
    LoadLibrary), contradicting the hidden-caller premise; covers JIT-compiled callers whose stacks do contain
    unbacked regions but cannot rescue attribution when nearest-export drift hides the Ldrp and LoadLibrary frames */
 not (process.code_signature.trusted == true and
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*\\clr.dll*", "*\\coreclr.dll*"))) and
 not process.thread.Ext.call_stack_summary like ("ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|*",
                                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|combase.dll|wbemprox.dll|wbemdisp.dll|oleaut32.dll|wbemdisp.dll|oleaut32.dll|rpcrt4.dll|combase.dll|oleaut32.dll|combase.dll|user32.dll") and
 not (process.executable : "C:\\Program Files\\Tenable\\Nessus Agent\\nessus*.exe" and process.code_signature.subject_name == "TENABLE, INC." and process.code_signature.trusted == true)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.nameis_not_null
  • (no value, null check)
field:"dll.name" kind:is_not_null
dll.namewildcard
  • amsi.dll corpus 5 (elastic 5)
  • dnsapi.dll corpus 7 (elastic 7)
  • ntdll.dll corpus 6 (elastic 6)
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
process.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_summarycontains
  • unbacked
  • unknown
field:"process.thread.Ext.call_stack_summary" kind:contains
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|* corpus 2 (elastic 2)
  • win32u.dll|*
field:"process.thread.Ext.call_stack_summary" kind:wildcard

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.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.thread.Ext.call_stack_summarycontainsunbackedexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"unbacked"
process.thread.Ext.call_stack_summarycontainsunknownexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"unknown"
process.code_signature.subject_nameeqTENABLE, INC.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"TENABLE, INC."
process.executablewildcardC:\Program Files\Tenable\Nessus Agent\nessus*.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\Tenable\Nessus Agent\nessus*.exe"
process.thread.Ext.call_stack_summarycontainsprocess.nameexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"process.name"
dll.nameeqntdll.dllexcludes:dll.name field:"dll.name" value:"ntdll.dll"
dll.namestarts_withprocess.nameexcludes:dll.name field:"dll.name" value:"process.name"
process.thread.Ext.call_stack_summarywildcardntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|*, ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|combase.dll|wbemprox.dll|wbemdisp.dll|oleaut32.dll|wbemdisp.dll|oleaut32.dll|rpcrt4.dll|combase.dll|oleaut32.dll|combase.dll|user32.dllexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|*" field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|fastprox.dll|combase.dll|rpcrt4.dll|combase.dll|wbemprox.dll|wbemdisp.dll|oleaut32.dll|wbemdisp.dll|oleaut32.dll|rpcrt4.dll|combase.dll|oleaut32.dll|combase.dll|user32.dll"

Potential Reverse Shell Activity via Terminal

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of a shell process with suspicious arguments which may be indicative of reverse shell activity.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = "Identifies the execution of a shell process with suspicious arguments which may be indicative of reverse shell activity."
id = "d0e45f6c-1f83-4d97-a8d9-c8f9eb61c15c"
license = "Elastic License v2"
name = "Potential Reverse Shell Activity via Terminal"
os_list = ["macos"]
reference = [
    "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md",
    "https://github.com/WangYihang/Reverse-Shell-Manager",
    "https://www.netsparker.com/blog/web-security/understanding-reverse-shells/",
]
version = "1.0.47"

query = '''
process where event.action == "exec" and process.name in ("sh", "bash", "zsh", "dash", "zmodload") and
process.command_line like~ ("*/dev/tcp/*", "*/dev/udp/*", "*zsh/net/tcp*", "*zsh/net/udp*") and 
process.parent.executable != null and 
not (
  process.parent.name == "timeout" or
  process.command_line like~ (
    "*/dev/tcp/sirh_db/*", "*/dev/tcp/itom-vault/8200*", "*/dev/tcp/remoteiot.com/*", "*dev/tcp/elk.stag.one/*",
    "*dev/tcp/kafka/*", "*/dev/tcp/$0/$1*", "*/dev/tcp/::1/*", "*/dev/tcp/livelog.default.svc.cluster.local*",
    "*/dev/tcp/db.default.svc.cluster.local*", "*/dev/tcp/127.*", "*/dev/udp/127.*", "*/dev/tcp/localhost/*",
    "*/dev/tcp/splunk*telconet.net/*",
    "bash -c timeout 2 bash -c 'echo > /dev/tcp/kafka*' 2>/dev/null && echo 'Connected' || echo 'Failed'", 
    "*/dev/tcp/*echo*", "*.claude/shell-snapshots/*echo*"
  ) or
  process.parent.command_line in ("runc init", "/usr/bin/python /opt/oracle/dcs/exacd_netchk/exacd_netchk.py") or
  process.parent.args in ("/usr/local/bin/runc", "/opt/bitnami/scripts/keycloak/setup.sh", "/usr/bin/testssl.sh") or
  process.working_directory == "/opt/rapid7/ir_agent/components/endpoint_broker/common" or
  process.parent.executable like (
    "/opt/cdf/data/containerd/*", "/usr/bin/consul", "/usr/sbin/sshd", "/usr/bin/runc", "/usr/share/cursor/cursor", 
    "/home/*/.nvm/versions/node/*/bin/node", "/home/*/t38-k8s/*/k8sts", "/home/*/.opencode/bin/opencode",
    "/usr/bin/gnome-shell", "/usr/bin/coreutils", "/home/*/.local/bin/kiro-cli-chat",
    "/opt/Tychon/Endpoint/bin/TychonCoreService", "/usr/local/bin/teleport", "/opt/teleport/system/bin/teleport",
    "/usr/bin/claude-bin", "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode",
    "/home/*/.local/share/claude/versions/*", "/home/linuxbrew/.linuxbrew/Caskroom/codex/*/codex-x86_64-unknown-linux-musl",
    "/opt/homebrew/Cellar/coreutils/*/bin/gtimeout", "/usr/local/Cellar/coreutils/*/bin/gtimeout"
  ) or
  (process.parent.name == "sudo" and process.parent.command_line like "*teleport-installer*") or
  (
    process.args like "/dev/tcp/nomzk-client-svc/*" and
    process.executable like "/opt/cdf/data/containerd/state/io.containerd.runtime.v2.task/k8s.io/*/rootfs/usr/bin/bash"
  ) or
  (process.args like "-l source*/tmp/claude*" and process.parent.name == "node") or
  (process.working_directory == "/opt/Tychon/Endpoint/bin" and process.parent.command_line == "/usr/bin/bash -s") or
  (process.command_line like "*claude*" and process.parent.command_line == "claude")
)
'''

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.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.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "exec" and process.name in ("sh", "bash", "zsh", "dash", "zmodload") and
process.command_line like~ ("*/dev/tcp/*", "*/dev/udp/*", "*zsh/net/tcp*", "*zsh/net/udp*") and 
process.parent.executable != null and 
not (
  process.parent.name == "timeout" or
  process.command_line like~ (
    "*/dev/tcp/sirh_db/*", "*/dev/tcp/itom-vault/8200*", "*/dev/tcp/remoteiot.com/*", "*dev/tcp/elk.stag.one/*",
    "*dev/tcp/kafka/*", "*/dev/tcp/$0/$1*", "*/dev/tcp/::1/*", "*/dev/tcp/livelog.default.svc.cluster.local*",
    "*/dev/tcp/db.default.svc.cluster.local*", "*/dev/tcp/127.*", "*/dev/udp/127.*", "*/dev/tcp/localhost/*",
    "*/dev/tcp/splunk*telconet.net/*",
    "bash -c timeout 2 bash -c 'echo > /dev/tcp/kafka*' 2>/dev/null && echo 'Connected' || echo 'Failed'", 
    "*/dev/tcp/*echo*", "*.claude/shell-snapshots/*echo*"
  ) or
  process.parent.command_line in ("runc init", "/usr/bin/python /opt/oracle/dcs/exacd_netchk/exacd_netchk.py") or
  process.parent.args in ("/usr/local/bin/runc", "/opt/bitnami/scripts/keycloak/setup.sh", "/usr/bin/testssl.sh") or
  process.working_directory == "/opt/rapid7/ir_agent/components/endpoint_broker/common" or
  process.parent.executable like (
    "/opt/cdf/data/containerd/*", "/usr/bin/consul", "/usr/sbin/sshd", "/usr/bin/runc", "/usr/share/cursor/cursor", 
    "/home/*/.nvm/versions/node/*/bin/node", "/home/*/t38-k8s/*/k8sts", "/home/*/.opencode/bin/opencode",
    "/usr/bin/gnome-shell", "/usr/bin/coreutils", "/home/*/.local/bin/kiro-cli-chat",
    "/opt/Tychon/Endpoint/bin/TychonCoreService", "/usr/local/bin/teleport", "/opt/teleport/system/bin/teleport",
    "/usr/bin/claude-bin", "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode",
    "/home/*/.local/share/claude/versions/*", "/home/linuxbrew/.linuxbrew/Caskroom/codex/*/codex-x86_64-unknown-linux-musl",
    "/opt/homebrew/Cellar/coreutils/*/bin/gtimeout", "/usr/local/Cellar/coreutils/*/bin/gtimeout"
  ) or
  (process.parent.name == "sudo" and process.parent.command_line like "*teleport-installer*") or
  (
    process.args like "/dev/tcp/nomzk-client-svc/*" and
    process.executable like "/opt/cdf/data/containerd/state/io.containerd.runtime.v2.task/k8s.io/*/rootfs/usr/bin/bash"
  ) or
  (process.args like "-l source*/tmp/claude*" and process.parent.name == "node") or
  (process.working_directory == "/opt/Tychon/Endpoint/bin" and process.parent.command_line == "/usr/bin/bash -s") or
  (process.command_line like "*claude*" and process.parent.command_line == "claude")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
process.command_linewildcard
  • */dev/tcp/* corpus 3 (elastic 2, sigma 1)
  • */dev/udp/* corpus 2 (sigma 1, elastic 1)
  • *zsh/net/tcp*
  • *zsh/net/udp*
field:"CommandLine" kind:wildcard
process.namein
  • bash corpus 181 (elastic 181)
  • dash corpus 150 (elastic 150)
  • sh corpus 180 (elastic 180)
  • zmodload corpus 3 (elastic 3)
  • zsh corpus 180 (elastic 180)
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.argsstarts_with/dev/tcp/nomzk-client-svc/excludes:process.args field:"process.args" value:"/dev/tcp/nomzk-client-svc/"
process.executablewildcard/opt/cdf/data/containerd/state/io.containerd.runtime.v2.task/k8s.io/*/rootfs/usr/bin/bashexcludes:process.executable field:"process.executable" value:"/opt/cdf/data/containerd/state/io.containerd.runtime.v2.task/k8s.io/*/rootfs/usr/bin/bash"
process.argswildcard-l source*/tmp/claude*excludes:process.args field:"process.args" value:"-l source*/tmp/claude*"
process.parent.nameeqnodeexcludes:process.parent.name field:"process.parent.name" value:"node"
process.command_linematchclaudeexcludes:process.command_line field:"process.command_line" value:"claude"
process.parent.command_lineeqclaudeexcludes:process.parent.command_line field:"process.parent.command_line" value:"claude"
process.parent.command_lineeq/usr/bin/bash -sexcludes:process.parent.command_line field:"process.parent.command_line" value:"/usr/bin/bash -s"
process.working_directoryeq/opt/Tychon/Endpoint/binexcludes:process.working_directory field:"process.working_directory" value:"/opt/Tychon/Endpoint/bin"
process.parent.command_linematchteleport-installerexcludes:process.parent.command_line field:"process.parent.command_line" value:"teleport-installer"
process.parent.nameeqsudoexcludes:process.parent.name field:"process.parent.name" value:"sudo"
process.command_linewildcard*/dev/tcp/sirh_db/*, */dev/tcp/itom-vault/8200*, */dev/tcp/remoteiot.com/*, *dev/tcp/elk.stag.one/*, *dev/tcp/kafka/*, */dev/tcp/$0/$1*, */dev/tcp/::1/*, */dev/tcp/livelog.default.svc.cluster.local*, */dev/tcp/db.default.svc.cluster.local*, */dev/tcp/127.*, */dev/udp/127.*, */dev/tcp/localhost/*, */dev/tcp/splunk*telconet.net/*, bash -c timeout 2 bash -c 'echo > /dev/tcp/kafka*' 2>/dev/null && echo 'Connected' || echo 'Failed', */dev/tcp/*echo*, *.claude/shell-snapshots/*echo*excludes:process.command_line
process.parent.argsin/opt/bitnami/scripts/keycloak/setup.sh, /usr/bin/testssl.sh, /usr/local/bin/runcexcludes:process.parent.args field:"process.parent.args" value:"/opt/bitnami/scripts/keycloak/setup.sh" field:"process.parent.args" value:"/usr/bin/testssl.sh" field:"process.parent.args" value:"/usr/local/bin/runc"
process.parent.command_linein/usr/bin/python /opt/oracle/dcs/exacd_netchk/exacd_netchk.py, runc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"/usr/bin/python /opt/oracle/dcs/exacd_netchk/exacd_netchk.py" field:"process.parent.command_line" value:"runc init"
process.parent.executablewildcard/opt/cdf/data/containerd/*, /usr/bin/consul, /usr/sbin/sshd, /usr/bin/runc, /usr/share/cursor/cursor, /home/*/.nvm/versions/node/*/bin/node, /home/*/t38-k8s/*/k8sts, /home/*/.opencode/bin/opencode, /usr/bin/gnome-shell, /usr/bin/coreutils, /home/*/.local/bin/kiro-cli-chat, /opt/Tychon/Endpoint/bin/TychonCoreService, /usr/local/bin/teleport, /opt/teleport/system/bin/teleport, /usr/bin/claude-bin, /usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode, /home/*/.local/share/claude/versions/*, /home/linuxbrew/.linuxbrew/Caskroom/codex/*/codex-x86_64-unknown-linux-musl, /opt/homebrew/Cellar/coreutils/*/bin/gtimeout, /usr/local/Cellar/coreutils/*/bin/gtimeoutexcludes:process.parent.executable
process.parent.nameeqtimeoutexcludes:process.parent.name field:"process.parent.name" value:"timeout"
process.working_directoryeq/opt/rapid7/ir_agent/components/endpoint_broker/commonexcludes:process.working_directory field:"process.working_directory" value:"/opt/rapid7/ir_agent/components/endpoint_broker/common"

Potential WebShell via ScreenConnect Server

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious processes being spawned by the ScreenConnect server process (ScreenConnect.Service.exe). This activity may indicate exploitation activity or access to an existing web shell backdoor.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies suspicious processes being spawned by the ScreenConnect server process (ScreenConnect.Service.exe). This
activity may indicate exploitation activity or access to an existing web shell backdoor.
"""
id = "10265eab-b3b0-4ecb-bed2-5b4f4a5a4e28"
license = "Elastic License v2"
name = "Potential WebShell via ScreenConnect Server"
os_list = ["windows"]
version = "1.0.2"

query = '''
process where event.action == "start" and
  process.parent.name : "ScreenConnect.Service.exe" and
  process.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe", "csc.exe") and
  not process.executable : "?:\\Program Files (x86)\\ScreenConnect\\bin\\roslyn\\csc.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 = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.parent.name : "ScreenConnect.Service.exe" and
  process.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe", "csc.exe") and
  not process.executable : "?:\\Program Files (x86)\\ScreenConnect\\bin\\roslyn\\csc.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.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • powershell_ise.exe corpus 53 (splunk 29, elastic 24)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • ScreenConnect.Service.exe corpus 2 (elastic 2)
field:"parent_process_basename" kind:wildcard value:"ScreenConnect.Service.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Program Files (x86)\ScreenConnect\bin\roslyn\csc.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\ScreenConnect\bin\roslyn\csc.exe"

Potential WizardUpdate Malware Infection

#
Source
github.com/elastic/protections-artifacts

Identifies the execution traces of the WizardUpdate malware. WizardUpdate is a macOS trojan that attempts to infiltrate macOS machines to steal data and it is associated with other types of malicious payloads, increasing the chances of multiple infections on a device.

MITRE ATT&CK Coverage

TacticTechniques
Command & ControlNo specific technique

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies the execution traces of the WizardUpdate malware. WizardUpdate is a macOS trojan that attempts to infiltrate
macOS machines to steal data and it is associated with other types of malicious payloads, increasing the chances of
multiple infections on a device.
"""
id = "eb78fa0f-5e8a-4c15-a099-e904c4a226e6"
license = "Elastic License v2"
name = "Potential WizardUpdate Malware Infection"
os_list = ["macos"]
reference = [
    "https://malpedia.caad.fkie.fraunhofer.de/details/osx.xcsset",
    "https://www.microsoft.com/security/blog/2022/02/02/the-evolution-of-a-mac-trojan-updateagents-progression/",
]
version = "1.0.28"

query = '''
process where event.action == "exec" and
 (
   (process.name in ("sh", "bash", "zsh") and process.command_line : "*=$(curl *eval*$*") or
   (process.name in ("curl", "nscurl") and process.command_line : "*_intermediate_agent_*machine_id*")
 ) and 
 not process.parent.code_signature.team_id in ("UBF8T346G9", "4DE7YGRTPT", "VDXQ22DGB9", "Q6L2SF6YDW", "2DC432GLL2") and 
 process.parent.executable != null
'''

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

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

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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.action == "exec" and
 (
   (process.name in ("sh", "bash", "zsh") and process.command_line : "*=$(curl *eval*$*") or
   (process.name in ("curl", "nscurl") and process.command_line : "*_intermediate_agent_*machine_id*")
 ) and 
 not process.parent.code_signature.team_id in ("UBF8T346G9", "4DE7YGRTPT", "VDXQ22DGB9", "Q6L2SF6YDW", "2DC432GLL2") and 
 process.parent.executable != null

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
process.command_linewildcard
  • *=$(curl *eval*$*
  • *_intermediate_agent_*machine_id*
field:"CommandLine" kind:wildcard
process.namein
  • bash corpus 181 (elastic 181)
  • curl corpus 82 (elastic 82)
  • nscurl corpus 41 (elastic 41)
  • sh corpus 180 (elastic 180)
  • zsh corpus 180 (elastic 180)
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.code_signature.team_idin2DC432GLL2, 4DE7YGRTPT, Q6L2SF6YDW, UBF8T346G9, VDXQ22DGB9excludes:process.parent.code_signature.team_id

PowerShell Keylogging Script

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

Detects PowerShell script block content that references Win32 keylogging primitives such as key state polling or low-level input hooks. Adversaries use keylogging to capture credentials and other sensitive user input.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects PowerShell script block content that references Win32 keylogging primitives such as key state polling or
low-level input hooks. Adversaries use keylogging to capture credentials and other sensitive user input.
"""
from = "now-9m"
index = ["logs-windows.powershell*", "winlogbeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "PowerShell Keylogging Script"
references = [
    "https://github.com/EmpireProject/Empire/blob/master/data/module_source/collection/Get-Keystrokes.ps1",
    "https://github.com/MojtabaTajik/FunnyKeylogger/blob/master/FunnyLogger.ps1",
]
risk_score = 73
rule_id = "bd2c86a0-8b61-4457-ab38-96943984e889"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Collection",
    "Resources: Investigation Guide",
    "Data Source: PowerShell Logs",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
event.category:process and host.os.type:windows and
  (
    powershell.file.script_block_text : (GetAsyncKeyState or NtUserGetAsyncKeyState or GetKeyboardState or "Get-Keystrokes") or
    powershell.file.script_block_text : (
      (SetWindowsHookEx or SetWindowsHookExA or SetWindowsHookExW or NtUserSetWindowsHookEx) and
      (
        GetForegroundWindow or GetWindowTextA or GetWindowTextW or "WM_KEYBOARD_LL" or "WH_MOUSE_LL" or
        "WH_KEYBOARD_LL" or "LowLevelKeyboardProc" or "CallNextHookEx"
      )
   )
  ) and not user.id : "S-1-5-18" and
  not powershell.file.script_block_text : (
    "sentinelbreakpoints" and "Set-PSBreakpoint"
  )
'''

note = """## Triage and analysis

### Investigating PowerShell Keylogging Script

#### Possible investigation steps

- Does the preserved script content show active keylogging intent rather than inert reference text?
  - Focus: the preserved script text on the alert and any associated `file.path`.
  - Implication: supports concern when the content invokes polling loops, hook registration, window-labeling routines, output formatting, or commodity functions such as "Get-Keystrokes"; carries less weight when the text is clearly documentation, training content, or inert reference with no adjacent execution evidence.

- Does reconstructing the full script reveal logging, labeling, staging, or transmission behavior that changes urgency?
  - Why: script block logging can split one script across multiple records; later fragments often reveal output paths, timer loops, or exfiltration.
  - Focus: `powershell.file.script_block_id`, `powershell.sequence`, `powershell.total`, and `powershell.file.script_block_length` to rebuild adjacent fragments, then the reconstructed content for foreground-window labeling, output files, archives, remote destinations, or cleanup logic. $investigate_0
  - Implication: supports active collection when reconstruction shows continuous polling, registered hooks, keystroke formatting, saved logs, compression, upload logic, or cleanup after collection.

- Does the user-host pairing fit recognized accessibility tooling, kiosk automation, or security assessment?
  - Focus: the `user.id` and `host.id` pairing, whether the host role supports input-capture tooling, and any prior alert recurrence for the same pairing and launcher.
  - Hint: if workflow documentation is unavailable, require the same pairing and launcher to recur across prior alerts.
  - Implication: escalate when the user has no recurring pattern of input capture, the host handles privileged workflows, or the timing falls outside scheduled testing.

- Can you recover the PowerShell process and explain how it was launched?
  - Focus: the matching process start event via `process.pid` and `host.id`, recovering `process.command_line`, `process.parent.executable`, `process.parent.command_line`, and `process.Ext.session_info.logon_type`. $investigate_1
  - Hint: if the process event cannot be found, keep later file, network, and authentication review bounded to the same host and alert time.
  - Implication: supports unauthorized use when the recovered process is launched by a document, browser, chat client, scheduled task, remote session, or user-writable script path.

- Do file events show keystroke logs, staged archives, or renamed artifacts?
  - Focus: file events for the same `process.entity_id`, with attention to `file.path`, `file.extension`, `file.Ext.header_bytes`, and `file.Ext.original.path` when logs or archives are renamed for staging.
  - Implication: supports active collection when log files, archives, or renamed artifacts appear in user-writable or hidden paths, or when header bytes do not match the visible extension.

- Do network events show credential exfiltration, webhook delivery, or remote staging?
  - Focus: network events for the same `process.entity_id`, separating DNS `lookup_result` events (`dns.question.name`, `dns.resolved_ip`) from connection events (`destination.ip`, `destination.port`).
  - Implication: suggests exfiltration when the process reaches rare public destinations, messaging or webhook services, or cloud storage. Missing network telemetry is unresolved, not benign.

- Do authentication events show the session came from an unusual origin or that captured credentials were reused?
  - Why: keylogging becomes higher priority when post-capture authentication shows new logons or explicit-credential use that could reflect captured input being used.
  - Focus: if `process.Ext.authentication_id` was recovered, bridge to `winlog.event_data.TargetLogonId` for session origin (`source.ip`, `winlog.event_data.AuthenticationPackageName`). Also check post-alert 4624 or 4648 events on the same `host.id` for accounts that do not match the alert user.
  - Hint: "4648" explicit-credential events do not use `winlog.event_data.TargetLogonId`; search `winlog.event_data.SubjectLogonId` instead.
  - Implication: suggests captured-input abuse when the session has an unexpected origin or when later logons show new remote, privileged, or explicit-credential activity.

- If the local evidence stays suspicious, do related alerts suggest broader compromise?
  - Focus: related alerts for the same `user.id` to find repeated collection or defense-evasion activity. $investigate_2
  - Hint: compare related alerts for the same `host.id` for persistence, repeated collection, or renamed input-capture variants. $investigate_3
  - Implication: broaden when either view shows collection, defense-evasion, persistence, or transfer activity outside the expected workflow; keep the case local when surrounding alerts stay confined to one recognized workflow.

- Escalate when script intent, launch context, artifacts, network, or authentication evidence align on unauthorized input capture; close only when all evidence supports a recognized benign workflow; if mixed or incomplete, preserve and escalate.

### False positive analysis

- Accessibility, kiosk, security-testing, or malware-analysis workflows can legitimately trigger this rule. Confirm by matching the same `process.executable`, signer, and `host.id` pattern across prior alerts or against workflow records.
- Before creating an exception, validate that the same `user.id`, `host.id`, `file.path`, and a stable `powershell.file.script_block_text` substring recur across prior alerts. Avoid exceptions on hook-function strings alone, `user.name` alone, or the host alone.

### Response and remediation

- If confirmed benign, reverse any temporary containment and document the script content, recovered launch chain, user-host scope, and any benign artifact or destination pattern that proved the confirmed workflow. Create an exception only if the same workflow recurs consistently across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the reconstructed script content, recovered `process.entity_id`, related `file.path` artifacts, any `dns.question.name` or `destination.ip` values linked to transfer, and authentication events around the alert. Apply reversible containment such as session restrictions or temporary destination blocking. Escalate to host isolation only when active collection, credential reuse, or transfer evidence is strong and the host role can tolerate it. Avoid destructive cleanup until scope is clearer.
- If confirmed malicious, document the recovered `process.entity_id`, `process.command_line`, `process.parent.executable`, written `file.path` artifacts, any confirmed `dns.question.name` or `destination.ip` values, and logon session details before initiating response actions. Prefer host isolation over process termination for initial containment when the asset can tolerate it, then contain affected accounts, block malicious destinations and scripts, and terminate recovered processes only after evidence capture.
- If keystroke logs, archives, or staging artifacts are identified, preserve them as sensitive evidence. Review related users and hosts for the same `powershell.file.script_block_text` content, `file.path` pattern, or `dns.question.name` destinations before eradicating. Then remove the artifacts and any persistence or automation identified during reconstruction or host-scoping.
- If follow-on authentication review suggests captured credentials were used, prioritize credential resets for the affected user and any additional accounts identified during the post-alert authentication timeline, then hunt for related sessions or privilege changes on the same host and other assets.
- After containment, restrict the execution path that allowed the script to run, such as tightening PowerShell execution policies or script-path allowlists. Retain PowerShell script block logging and related endpoint telemetry.
"""

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

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

[[transform.investigate]]
label = "Script block fragments for the same script"
description = ""
providers = [
  [
    { excluded = false, field = "powershell.file.script_block_id", queryType = "phrase", value = "{{powershell.file.script_block_id}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Process events for the PowerShell instance"
description = ""
providers = [
  [
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", 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" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

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

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1056"
name = "Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/"
[[rule.threat.technique.subtechnique]]
id = "T1056.001"
name = "Keylogging"
reference = "https://attack.mitre.org/techniques/T1056/001/"

[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[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.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"

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

Stages and Predicates

Stage 1: query

event.category:process and host.os.type:windows and
  (
    powershell.file.script_block_text : (GetAsyncKeyState or NtUserGetAsyncKeyState or GetKeyboardState or "Get-Keystrokes") or
    powershell.file.script_block_text : (
      (SetWindowsHookEx or SetWindowsHookExA or SetWindowsHookExW or NtUserSetWindowsHookEx) and
      (
        GetForegroundWindow or GetWindowTextA or GetWindowTextW or "WM_KEYBOARD_LL" or "WH_MOUSE_LL" or
        "WH_KEYBOARD_LL" or "LowLevelKeyboardProc" or "CallNextHookEx"
      )
   )
  ) and not user.id : "S-1-5-18" and
  not powershell.file.script_block_text : (
    "sentinelbreakpoints" and "Set-PSBreakpoint"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.categoryeq
  • process corpus 105 (elastic 105)
field:"event.category" kind:eq value:"process"
powershell.file.script_block_textin
  • CallNextHookEx
  • Get-Keystrokes corpus 2 (elastic 2)
  • GetAsyncKeyState
  • GetForegroundWindow
  • GetKeyboardState
  • GetWindowTextA
  • GetWindowTextW
  • LowLevelKeyboardProc
  • NtUserGetAsyncKeyState
  • NtUserSetWindowsHookEx
  • SetWindowsHookEx
  • SetWindowsHookExA
  • SetWindowsHookExW
  • WH_KEYBOARD_LL
  • WH_MOUSE_LL
  • WM_KEYBOARD_LL
field:"ScriptBlockText" kind:in

Exclusions

The rule actively suppresses these predicates.

Process Creation from a Stomped Module

#
Source
github.com/elastic/protections-artifacts

Identifies the creation of process where the parent process call stack contains a DLL with suspicious memory properties. This may be the result of a code injection using module stomping or DLL hollowing via overwriting the content of legit DLL with malicious code.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the creation of process where the parent process call stack contains a DLL with suspicious memory properties.
This may be the result of a code injection using module stomping or DLL hollowing via overwriting the content of legit
DLL with malicious code.
"""
id = "b444173e-ef79-4e76-b329-f0926aa249ee"
license = "Elastic License v2"
name = "Process Creation from a Stomped Module"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
    "https://www.ired.team/offensive-security/code-injection-process-injection/modulestomping-dll-hollowing-shellcode-injection",
]
version = "1.0.19"

query = '''
process where event.action == "start" and
 length(process.parent.thread.Ext.call_stack_summary) <= 60 and
 _arraysearch(process.parent.thread.Ext.call_stack, $entry,
             $entry.allocation_private_bytes >= 100000 and $entry.symbol_info: ("?:\\windows\\SysWOW64\\*.dll*", "?:\\Windows\\system32\\*.dll*")) and
 not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info:
                                                                ("?:\\Program Files (x86)\\*.dll*",
                                                                 "?:\\Program Files\\*.dll*",
                                                                 "?:\\Windows\\Sys*\\hmpalert.dll*",
                                                                 "?:\\Windows\\System32\\umppc*.dll*")) and
 not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.allocation_private_bytes >= 100000 and
                  $entry.symbol_info:
                        ("?:\\Windows\\SysWOW64\\KernelBase.dll*",
                         "?:\\Windows\\System32\\KernelBase.dll*",
                         "?:\\Windows\\System32\\ntdll.dll*",
                         "?:\\Windows\\SysWOW64\\ScriptControl32_*.dll!*",
                         "?:\\Windows\\SysWOW64\\rpcrt4.dll!*",
                         "?:\\Windows\\System32\\rpcrt4.dll!",
                         "?:\\Windows\\SysWOW64\\combase.dll!*",
                         "?:\\Windows\\System32\\combase.dll!*",
                         "?:\\Windows\\SysWOW64\\webio.dll*",
                         "?:\\Windows\\SysWOW64\\TWAINDSM.dll*",
                         "?:\\Windows\\Sys*\\ws2_32.dll*",
                         "?:\\Windows\\Sys*\\user32.dll*",
                         "?:\\Windows\\Sys*\\cyinjct.dll*",
                         "?:\\Windows\\SysWOW64\\twpix32.dll*",
                         "?:\\Windows\\SysWOW64\\IMCRCMN3.DLL*",
                         "?:\\Windows\\SysWOW64\\Windows.Security.Authentication.Web.Core.dll*",
                         "?:\\Windows\\assembly\\NativeImages_*",
                         "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                         "?:\\Windows\\Sys*\\spool\\drivers\\*"))
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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.7.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 length(process.parent.thread.Ext.call_stack_summary) <= 60 and
 _arraysearch(process.parent.thread.Ext.call_stack, $entry,
             $entry.allocation_private_bytes >= 100000 and $entry.symbol_info: ("?:\\windows\\SysWOW64\\*.dll*", "?:\\Windows\\system32\\*.dll*")) and
 not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.symbol_info:
                                                                ("?:\\Program Files (x86)\\*.dll*",
                                                                 "?:\\Program Files\\*.dll*",
                                                                 "?:\\Windows\\Sys*\\hmpalert.dll*",
                                                                 "?:\\Windows\\System32\\umppc*.dll*")) and
 not _arraysearch(process.parent.thread.Ext.call_stack, $entry, $entry.allocation_private_bytes >= 100000 and
                  $entry.symbol_info:
                        ("?:\\Windows\\SysWOW64\\KernelBase.dll*",
                         "?:\\Windows\\System32\\KernelBase.dll*",
                         "?:\\Windows\\System32\\ntdll.dll*",
                         "?:\\Windows\\SysWOW64\\ScriptControl32_*.dll!*",
                         "?:\\Windows\\SysWOW64\\rpcrt4.dll!*",
                         "?:\\Windows\\System32\\rpcrt4.dll!",
                         "?:\\Windows\\SysWOW64\\combase.dll!*",
                         "?:\\Windows\\System32\\combase.dll!*",
                         "?:\\Windows\\SysWOW64\\webio.dll*",
                         "?:\\Windows\\SysWOW64\\TWAINDSM.dll*",
                         "?:\\Windows\\Sys*\\ws2_32.dll*",
                         "?:\\Windows\\Sys*\\user32.dll*",
                         "?:\\Windows\\Sys*\\cyinjct.dll*",
                         "?:\\Windows\\SysWOW64\\twpix32.dll*",
                         "?:\\Windows\\SysWOW64\\IMCRCMN3.DLL*",
                         "?:\\Windows\\SysWOW64\\Windows.Security.Authentication.Web.Core.dll*",
                         "?:\\Windows\\assembly\\NativeImages_*",
                         "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                         "?:\\Windows\\Sys*\\spool\\drivers\\*"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.thread.Ext.call_stackarray_any(no value, null check)excludes:process.parent.thread.Ext.call_stack

RPC (Remote Procedure Call) to the Internet

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

This rule detects network events that may indicate the use of RPC traffic to the Internet. RPC is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or backdoor vector.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/02/18"
integration = ["network_traffic", "panw", "fortinet_fortigate", "pfsense", "zeek", "corelight"]
maturity = "production"
updated_date = "2026/09/03"

[rule]
author = ["Elastic"]
description = """
This rule detects network events that may indicate the use of RPC traffic to the Internet. RPC is commonly used by
system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be
directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or
backdoor vector.
"""
from = "now-9m"
index = ["logs-network_traffic.*", "logs-panw.panos*", "logs-fortinet_fortigate.log-*", "logs-pfsense.log-*", "logs-zeek.*", "logs-corelight.*"]
language = "kuery"
license = "Elastic License v2"
name = "RPC (Remote Procedure Call) to the Internet"
references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
risk_score = 73
rule_id = "32923416-763a-4531-bb35-f33b9232ecdb"
severity = "high"
tags = ["Tactic: Initial Access",
    "Tactic: Lateral Movement",
    "Domain: Endpoint",
    "Use Case: Threat Detection",
    "Data Source: Corelight",
    "Data Source: Fortinet",
    "Data Source: PAN-OS",
    "Data Source: Network Traffic",
    "Data Source: pfSense",
    "Data Source: Zeek",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "query"

query = '''
(data_stream.dataset:(fortinet_fortigate.log or network_traffic.flow) or event.category:(network or network_traffic)) and
  network.transport:tcp and (destination.port:135 or data_stream.dataset:zeek.dce_rpc) and
  source.ip:(
    10.0.0.0/8 or
    172.16.0.0/12 or
    192.168.0.0/16
  ) and
  not destination.ip:(
    10.0.0.0/8 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.0.0.0/24 or
    192.0.0.0/29 or
    192.0.0.8/32 or
    192.0.0.9/32 or
    192.0.0.10/32 or
    192.0.0.170/32 or
    192.0.0.171/32 or
    192.0.2.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.168.0.0/16 or
    192.88.99.0/24 or
    224.0.0.0/4 or
    100.64.0.0/10 or
    192.175.48.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    240.0.0.0/4 or
    "::1" or
    "FE80::/10" or
    "FF00::/8"
  )
'''
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 RPC (Remote Procedure Call) to the Internet

RPC enables remote management and resource sharing across networks, crucial for system administration. However, when exposed to the Internet, it becomes a target for attackers seeking initial access or backdoor entry. The detection rule identifies suspicious RPC traffic from internal IPs to external networks, flagging potential exploitation attempts by monitoring specific ports and IP ranges.

### Possible investigation steps

- Review the source IP address from the alert to identify the internal system initiating the RPC traffic. Check if this IP belongs to a known or authorized device within the network.
- Examine the destination IP address to determine if it is a known or suspicious external entity. Use threat intelligence sources to assess if the IP has been associated with malicious activity.
- Analyze the network traffic logs for the specific event.dataset values (network_traffic.flow or zeek.dce_rpc) to gather more context about the nature and volume of the RPC traffic.
- Investigate the destination port, specifically port 135, to confirm if the traffic is indeed RPC-related and assess if there are any legitimate reasons for this communication.
- Check for any recent changes or anomalies in the network configuration or system settings of the source IP that might explain the unexpected RPC traffic.
- Correlate this alert with other security events or logs to identify any patterns or additional indicators of compromise that might suggest a broader attack campaign.

### False positive analysis

- Internal testing environments may generate RPC traffic to external IPs for legitimate purposes. Identify and document these environments, then create exceptions in the detection rule to prevent unnecessary alerts.
- Cloud-based services or applications that require RPC communication for integration or management might trigger false positives. Review these services and whitelist their IP addresses if they are verified as non-threatening.
- VPN or remote access solutions that use RPC for secure connections can be mistaken for suspicious activity. Ensure that the IP ranges of these solutions are excluded from the rule to avoid false alerts.
- Automated backup or synchronization tools that use RPC to communicate with external servers could be flagged. Verify these tools and add their destination IPs to an exception list if they are part of routine operations.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Conduct a thorough analysis of the affected system to identify any unauthorized changes or installed backdoors, focusing on processes and services related to RPC.
- Revoke any compromised credentials and enforce a password reset for all accounts that may have been accessed or used during the incident.
- Apply necessary patches and updates to the affected system and any other systems with similar vulnerabilities to mitigate the risk of exploitation.
- Monitor network traffic for any signs of lateral movement or additional suspicious activity, particularly focusing on RPC-related traffic.
- 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 logging and monitoring for RPC traffic to detect and respond to similar threats more effectively in the future."""


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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1021.003"
name = "Distributed Component Object Model"
reference = "https://attack.mitre.org/techniques/T1021/003/"

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

[rule.alert_suppression]
group_by = ["source.ip", "destination.ip"]
missing_fields_strategy = "doNotSuppress"

[rule.alert_suppression.duration]
unit = "h"
value = 1

Stages and Predicates

Stage 1: query

(data_stream.dataset:(fortinet_fortigate.log or network_traffic.flow) or event.category:(network or network_traffic)) and
  network.transport:tcp and (destination.port:135 or data_stream.dataset:zeek.dce_rpc) and
  source.ip:(
    10.0.0.0/8 or
    172.16.0.0/12 or
    192.168.0.0/16
  ) and
  not destination.ip:(
    10.0.0.0/8 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.0.0.0/24 or
    192.0.0.0/29 or
    192.0.0.8/32 or
    192.0.0.9/32 or
    192.0.0.10/32 or
    192.0.0.170/32 or
    192.0.0.171/32 or
    192.0.2.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.168.0.0/16 or
    192.88.99.0/24 or
    224.0.0.0/4 or
    100.64.0.0/10 or
    192.175.48.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    240.0.0.0/4 or
    "::1" or
    "FE80::/10" or
    "FF00::/8"
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

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

Suspicious BootExecute Registry Modification

#
Source
github.com/elastic/protections-artifacts

Boot Execute allows native applications with the NtProcessStartup entry point and depends solely on ntdll.dll to run prior to the complete initialization of the Windows operating system. Adversaries may abuse this time window to tamper with endpoint security services prior they get a chance to start.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Boot Execute allows native applications with the NtProcessStartup entry point and depends solely on ntdll.dll to run
prior to the complete initialization of the Windows operating system. Adversaries may abuse this time window to tamper
with endpoint security services prior they get a chance to start.
"""
id = "d9748901-b533-4190-9cf1-0c8cd0512094"
license = "Elastic License v2"
name = "Suspicious BootExecute Registry Modification"
os_list = ["windows"]
reference = ["https://github.com/rad9800/BootExecuteEDR"]
version = "1.0.4"

query = '''
registry where event.action == "modification" and
 registry.path : "HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecute" and
 process.executable != null and registry.data.strings : "??*" and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in ("NortonLifeLock Inc.", "Avast Software s.r.o.", "AOMEI International Network Limited",
                                              "QUICK HEAL TECHNOLOGIES LIMITED", "Glarysoft Ltd", "AVG Technologies USA, LLC",
                                              "VMware, Inc.", "Glarysoft LTD", "Omnissa, LLC", "Bitdefender SRL", "Symantec Corporation",
                                              "PIRIFORM SOFTWARE LIMITED", "CHENGDU AOMEI Tech Co., Ltd.", "Gen Digital Inc.")) and
 not process.executable : ("C:\\Windows\\System32\\chkdsk.exe",
                           "C:\\Windows\\System32\\fsavailux.exe",
                           "C:\\Windows\\System32\\msiexec.exe",
                           "C:\\Windows\\regedit.exe") and
 not registry.data.strings :
            ("autocheck autochk ?", "autocheck autoche ?", "autocheck autochk /k:? /k:? ?", "autocheck autochk /k:C /k:D /k:G ?",
             "autocheck autochk /q /v /k:? ?", "autocheck autochk /q /v /k:? *", "autocheck autochk /q /v ?",
             "autocheck autochk /r \\??\\C:",  "autocheck autochk /p \\??\\C:", "autocheck autochk /?:C ?", "autocheck autochk /q /v ")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"


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


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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and
 registry.path : "HKLM\\SYSTEM\\ControlSet*\\Control\\Session Manager\\BootExecute" and
 process.executable != null and registry.data.strings : "??*" and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in ("NortonLifeLock Inc.", "Avast Software s.r.o.", "AOMEI International Network Limited",
                                              "QUICK HEAL TECHNOLOGIES LIMITED", "Glarysoft Ltd", "AVG Technologies USA, LLC",
                                              "VMware, Inc.", "Glarysoft LTD", "Omnissa, LLC", "Bitdefender SRL", "Symantec Corporation",
                                              "PIRIFORM SOFTWARE LIMITED", "CHENGDU AOMEI Tech Co., Ltd.", "Gen Digital Inc.")) and
 not process.executable : ("C:\\Windows\\System32\\chkdsk.exe",
                           "C:\\Windows\\System32\\fsavailux.exe",
                           "C:\\Windows\\System32\\msiexec.exe",
                           "C:\\Windows\\regedit.exe") and
 not registry.data.strings :
            ("autocheck autochk ?", "autocheck autoche ?", "autocheck autochk /k:? /k:? ?", "autocheck autochk /k:C /k:D /k:G ?",
             "autocheck autochk /q /v /k:? ?", "autocheck autochk /q /v /k:? *", "autocheck autochk /q /v ?",
             "autocheck autochk /r \\??\\C:",  "autocheck autochk /p \\??\\C:", "autocheck autochk /?:C ?", "autocheck autochk /q /v ")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
registry.data.stringswildcard
  • ??*
field:"Details" kind:wildcard value:"??*"
registry.pathwildcard
  • HKLM\SYSTEM\ControlSet*\Control\Session Manager\BootExecute corpus 3 (elastic 3)
field:"TargetObject" kind:wildcard value:"HKLM\SYSTEM\ControlSet*\Control\Session Manager\BootExecute"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinAOMEI International Network Limited, AVG Technologies USA, LLC, Avast Software s.r.o., Bitdefender SRL, CHENGDU AOMEI Tech Co., Ltd., Gen Digital Inc., Glarysoft LTD, Glarysoft Ltd, NortonLifeLock Inc., Omnissa, LLC, PIRIFORM SOFTWARE LIMITED, QUICK HEAL TECHNOLOGIES LIMITED, Symantec Corporation, VMware, Inc.excludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeqC:\Windows\System32\chkdsk.exe, C:\Windows\System32\fsavailux.exe, C:\Windows\System32\msiexec.exe, C:\Windows\regedit.exeexcludes:process.executable
registry.data.stringswildcardautocheck autochk ?, autocheck autoche ?, autocheck autochk /k:? /k:? ?, autocheck autochk /k:C /k:D /k:G ?, autocheck autochk /q /v /k:? ?, autocheck autochk /q /v /k:? *, autocheck autochk /q /v ?, autocheck autochk /r \??\C:, autocheck autochk /p \??\C:, autocheck autochk /?:C ?, autocheck autochk /q /v excludes:registry.data.strings

Suspicious Parent-Child Relationship

#
Source
github.com/elastic/protections-artifacts

Identifies Windows programs run with unexpected parent processes, which can indicate masquerading via process hollowing or other forms of code injection in an attempt to evade detections that monitor the execution from suspicious locations.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies Windows programs run with unexpected parent processes, which can indicate masquerading via process hollowing
or other forms of code injection in an attempt to evade detections that monitor the execution from suspicious locations.
"""
id = "18a26e3e-e535-4d23-8ffa-a3cdba56d16e"
license = "Elastic License v2"
name = "Suspicious Parent-Child Relationship"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/bits-and-bytes-analyzing-bitsloth",
    "https://www.elastic.co/security-labs/elastic-security-labs-discovers-lobshot-malware",
    "https://www.elastic.co/security-labs/elastic-security-labs-steps-through-the-r77-rootkit",
]
version = "1.0.45"

query = '''
process where event.action == "start" and
 process.executable : ("?:\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*", "\\\\*") and
 process.parent.executable : ("?:\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*", "\\\\*") and
  (
   /*
     suspicious parent processes
     N.B svchost.exe is covered by ruleId 5b00c9ba-9546-47cc-8f9f-1c1a3e95f65c

    */
   (process.name : "autochk.exe" and not process.parent.name : "smss.exe") or

   (process.name : ("consent.exe", "RuntimeBroker.exe") and not process.parent.name : ("svchost.exe", "RuntimeBroker.exe") and
    not process.parent.executable :
                 ("?:\\Program Files\\ThreatLocker\\threatlockerconsent.exe",
                  "?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Container Helper.exe")) or
   (process.name : "SearchIndexer.exe" and not process.parent.name : ("services.exe", "SearchIndexer.exe")) or
   (process.name : "smss.exe" and not process.parent.name : ("System", "smss.exe", "sihost.exe")) or
   (process.name : "wininit.exe" and not process.parent.name : "smss.exe") or
   (process.name : ("lsass.exe", "LsaIso.exe") and not process.parent.name : ("wininit.exe", "lsass.exe", "services.exe")) or
   (process.name : "services.exe" and not process.parent.name : "wininit.exe") or
   (process.name : "spoolsv.exe" and not process.parent.name : ("services.exe", "spoolsv.exe")) or
   (process.name : "taskhost.exe" and not process.parent.name : ("services.exe", "svchost.exe")) or
   (process.name : "taskhostw.exe" and not process.parent.name : ("services.exe", "svchost.exe", "taskhostw.exe")) or
   (process.name : ("wmiprvse.exe", "wsmprovhost.exe", "winrshost.exe") and not process.parent.name : "svchost.exe") or
   (process.name : "sihost.exe" and not process.parent.name : ("svchost.exe", "sihost.exe", "powershell.exe")) or
   (process.name : ("winlogon.exe", "csrss.exe", "SearchProtocolHost.exe", "fontdrvhost.exe", "userinit.exe", "dwm.exe", "LogonUI.exe", "taskhostw.exe") and
    (process.parent.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\Users\\*\\Downloads\\*", "?:\\ProgramData\\*",
                                 "?:\\Windows\\Temp\\*", "?:\\Users\\*\\Desktop\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*") or
     process.parent.name : ("python*", "powershell.exe", "rundll32.exe", "regsvr32.exe"))) or

   /* suspicious child processes */
   (process.parent.name : "lsass.exe" and not process.name : ("lsass.exe", "WerFaultSecure.exe", "WerFault.exe", "efsui.exe", "LsaIso.exe") and
    not (process.code_signature.subject_name in ("NoMachine S.a.r.l.", "AuthLite, LLC") and process.code_signature.trusted == true) and
    not process.hash.sha256 : ("bfcb8f057dae3df9c656ec983d165c1571dbb5e19b6310cc0e5f1bff4c063c1e",
                               "dd1731be5fccca0d15f2c8e4780debc2962e4c434a7a138fff631a6aa0165962",
                               "67f366015d701dcd609e1f40c6bcbe56e7d2b479ebc4229927e50674769a8ead")) or
   (process.parent.name : "autochk.exe" and not process.name:("chkdsk.exe", "doskey.exe", "WerFault.exe", "conhost.exe")) or
   (process.parent.name : "smss.exe" and
    not process.name : ("autochk.exe", "smss.exe", "csrss.exe", "wininit.exe", "winlogon.exe", "setupcl.exe", "WerFault.exe"))
   )
   and not process.parent.executable :
                   ("?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\AcroCEF\\AcroCEF.exe",
                    "?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\*\\AcroCEF.exe",
                    "?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
                    "?:\\Program Files\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe") and
   not (process.name : "dwm.exe" and process.code_signature.subject_name == "Teramind Inc." and process.code_signature.trusted == true) and
   not (process.name : "SearchProtocolHost.exe" and process.parent.name : "rundll32.exe" and process.parent.args : "AppXDeploymentExtensions.OneCore.dll,ShellRefresh") and
   not (process.parent.executable : "?:\\Windows\\System32\\smss.exe" and process.parent.args : "-SpecialSession") and
   not (process.parent.executable : ("?:\\Program Files\\Sandboxie\\SandboxieDcomLaunch.exe", "?:\\Program Files\\Sandboxie-Plus\\SandboxieDcomLaunch.exe") and process.name : "RuntimeBroker.exe") and
   not (process.name : ("winlogon.exe", "csrss.exe") and
        process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
        process.parent.args : "/client=Personal" and process.parent.args : "/background") and
   not (process.executable : "?:\\Windows\\System32\\wbem\\WmiPrvSE.exe" and process.args : "/regserver" and
        process.Ext.token.integrity_level_name : "system") and
   not (process.name : "consent.exe" and
        process.parent.executable : ("?:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\ADS\\CRWindowsClientService.exe",
                                     "?:\\Program Files\\EvoSecurity\\EvoAgent\\EvoConsentUI.exe")) and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeUpdate\\*\\MicrosoftEdgeUpdateCore.exe" and
        process.executable : "?:\\WINDOWS\\system32\\SearchProtocolHost.exe" and process.command_line : "*UsGthrFltPipeMssGthrPipe*") and
   not (process.executable : "?:\\Windows\\System32\\SearchProtocolHost.exe" and
        process.parent.executable : ("?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe", "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")) and
   not (process.name : "cmd.exe" and process.parent.executable : "?:\\Windows\\System32\\lsass.exe" and
        process.args : "C:\\AdPasswordSync\\passwd.bat") and
   not (process.executable :
                ("?:\\Program Files (x86)\\Tanium\\Tanium Client\\Patch\\tools\\TaniumFileInfo.exe",
                 "?:\\Program Files (x86)\\VIPRE Business Agent\\UrlInspectAddon.exe") and process.parent.name : "smss.exe") and
   not (process.parent.name : "lsass.exe" and
        process.executable : "?:\\Program Files\\McAfee\\Endpoint Encryption Agent\\MfeEpeHost.exe") and
   not (process.parent.name : "lsass.exe" and process.code_signature.subject_name == "Secure Endpoints Inc." and process.code_signature.trusted == true) and
   not (process.name : "consent.exe" and process.parent.name : "rundll32.exe" and
        process.parent.args == "shell32.dll,SHCreateLocalServerRunDll" and process.parent.args == "{9BA05972-F6A8-11CF-A442-00A0C90A8F39}") and
   not (process.executable : ("?:\\Windows\\System32\\spoolsv.exe", "?:\\Windows\\System32\\RuntimeBroker.exe") and
        process.parent.executable : ("?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Starter.exe",
                                     "?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Container Helper.exe")) and
   not (process.executable : "C:\\Windows\\Sys?????\\wbem\\WmiPrvSE.exe" and process.args : "/RegServer" and process.parent.name : ("powershell.exe", "cmd.exe")) and 
   not (process.parent.name == "lsass.exe" and process.args : ("C:\\Program` Files\\PasswordRBL\\passwdfw.ps1", "C:\\Program Files\\PasswordRBL\\passwdfw.ps1")) and
   not (process.name : "services.exe" and process.parent.executable : "?:\\Windows\\LFSAgent\\lasrv.exe" and
        process.code_signature.trusted == true and
        process.code_signature.subject_name : "LEPIDE SOFTWARE PRIVATE LIMITED") and
   not (process.name : "LogonUI.exe" and process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\*\\FileCoAuth.exe")
'''

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 = "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.technique.subtechnique]]
id = "T1055.012"
name = "Process Hollowing"
reference = "https://attack.mitre.org/techniques/T1055/012/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.executable : ("?:\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*", "\\\\*") and
 process.parent.executable : ("?:\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*", "\\\\*") and
  (
   /*
     suspicious parent processes
     N.B svchost.exe is covered by ruleId 5b00c9ba-9546-47cc-8f9f-1c1a3e95f65c
    */
   (process.name : "autochk.exe" and not process.parent.name : "smss.exe") or
   (process.name : ("consent.exe", "RuntimeBroker.exe") and not process.parent.name : ("svchost.exe", "RuntimeBroker.exe") and
    not process.parent.executable :
                 ("?:\\Program Files\\ThreatLocker\\threatlockerconsent.exe",
                  "?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Container Helper.exe")) or
   (process.name : "SearchIndexer.exe" and not process.parent.name : ("services.exe", "SearchIndexer.exe")) or
   (process.name : "smss.exe" and not process.parent.name : ("System", "smss.exe", "sihost.exe")) or
   (process.name : "wininit.exe" and not process.parent.name : "smss.exe") or
   (process.name : ("lsass.exe", "LsaIso.exe") and not process.parent.name : ("wininit.exe", "lsass.exe", "services.exe")) or
   (process.name : "services.exe" and not process.parent.name : "wininit.exe") or
   (process.name : "spoolsv.exe" and not process.parent.name : ("services.exe", "spoolsv.exe")) or
   (process.name : "taskhost.exe" and not process.parent.name : ("services.exe", "svchost.exe")) or
   (process.name : "taskhostw.exe" and not process.parent.name : ("services.exe", "svchost.exe", "taskhostw.exe")) or
   (process.name : ("wmiprvse.exe", "wsmprovhost.exe", "winrshost.exe") and not process.parent.name : "svchost.exe") or
   (process.name : "sihost.exe" and not process.parent.name : ("svchost.exe", "sihost.exe", "powershell.exe")) or
   (process.name : ("winlogon.exe", "csrss.exe", "SearchProtocolHost.exe", "fontdrvhost.exe", "userinit.exe", "dwm.exe", "LogonUI.exe", "taskhostw.exe") and
    (process.parent.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\Users\\*\\Downloads\\*", "?:\\ProgramData\\*",
                                 "?:\\Windows\\Temp\\*", "?:\\Users\\*\\Desktop\\*", "\\Device\\CdRom*", "\\Device\\Mup\\*") or
     process.parent.name : ("python*", "powershell.exe", "rundll32.exe", "regsvr32.exe"))) or
   (process.parent.name : "lsass.exe" and not process.name : ("lsass.exe", "WerFaultSecure.exe", "WerFault.exe", "efsui.exe", "LsaIso.exe") and
    not (process.code_signature.subject_name in ("NoMachine S.a.r.l.", "AuthLite, LLC") and process.code_signature.trusted == true) and
    not process.hash.sha256 : ("bfcb8f057dae3df9c656ec983d165c1571dbb5e19b6310cc0e5f1bff4c063c1e",
                               "dd1731be5fccca0d15f2c8e4780debc2962e4c434a7a138fff631a6aa0165962",
                               "67f366015d701dcd609e1f40c6bcbe56e7d2b479ebc4229927e50674769a8ead")) or
   (process.parent.name : "autochk.exe" and not process.name:("chkdsk.exe", "doskey.exe", "WerFault.exe", "conhost.exe")) or
   (process.parent.name : "smss.exe" and
    not process.name : ("autochk.exe", "smss.exe", "csrss.exe", "wininit.exe", "winlogon.exe", "setupcl.exe", "WerFault.exe"))
   )
   and not process.parent.executable :
                   ("?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\AcroCEF\\AcroCEF.exe",
                    "?:\\Program Files (x86)\\Adobe\\Acrobat DC\\Acrobat\\*\\AcroCEF.exe",
                    "?:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe",
                    "?:\\Program Files\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe") and
   not (process.name : "dwm.exe" and process.code_signature.subject_name == "Teramind Inc." and process.code_signature.trusted == true) and
   not (process.name : "SearchProtocolHost.exe" and process.parent.name : "rundll32.exe" and process.parent.args : "AppXDeploymentExtensions.OneCore.dll,ShellRefresh") and
   not (process.parent.executable : "?:\\Windows\\System32\\smss.exe" and process.parent.args : "-SpecialSession") and
   not (process.parent.executable : ("?:\\Program Files\\Sandboxie\\SandboxieDcomLaunch.exe", "?:\\Program Files\\Sandboxie-Plus\\SandboxieDcomLaunch.exe") and process.name : "RuntimeBroker.exe") and
   not (process.name : ("winlogon.exe", "csrss.exe") and
        process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe" and
        process.parent.args : "/client=Personal" and process.parent.args : "/background") and
   not (process.executable : "?:\\Windows\\System32\\wbem\\WmiPrvSE.exe" and process.args : "/regserver" and
        process.Ext.token.integrity_level_name : "system") and
   not (process.name : "consent.exe" and
        process.parent.executable : ("?:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\ADS\\CRWindowsClientService.exe",
                                     "?:\\Program Files\\EvoSecurity\\EvoAgent\\EvoConsentUI.exe")) and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeUpdate\\*\\MicrosoftEdgeUpdateCore.exe" and
        process.executable : "?:\\WINDOWS\\system32\\SearchProtocolHost.exe" and process.command_line : "*UsGthrFltPipeMssGthrPipe*") and
   not (process.executable : "?:\\Windows\\System32\\SearchProtocolHost.exe" and
        process.parent.executable : ("?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe", "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")) and
   not (process.name : "cmd.exe" and process.parent.executable : "?:\\Windows\\System32\\lsass.exe" and
        process.args : "C:\\AdPasswordSync\\passwd.bat") and
   not (process.executable :
                ("?:\\Program Files (x86)\\Tanium\\Tanium Client\\Patch\\tools\\TaniumFileInfo.exe",
                 "?:\\Program Files (x86)\\VIPRE Business Agent\\UrlInspectAddon.exe") and process.parent.name : "smss.exe") and
   not (process.parent.name : "lsass.exe" and
        process.executable : "?:\\Program Files\\McAfee\\Endpoint Encryption Agent\\MfeEpeHost.exe") and
   not (process.parent.name : "lsass.exe" and process.code_signature.subject_name == "Secure Endpoints Inc." and process.code_signature.trusted == true) and
   not (process.name : "consent.exe" and process.parent.name : "rundll32.exe" and
        process.parent.args == "shell32.dll,SHCreateLocalServerRunDll" and process.parent.args == "{9BA05972-F6A8-11CF-A442-00A0C90A8F39}") and
   not (process.executable : ("?:\\Windows\\System32\\spoolsv.exe", "?:\\Windows\\System32\\RuntimeBroker.exe") and
        process.parent.executable : ("?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Starter.exe",
                                     "?:\\Program Files (x86)\\Workplace\\Components\\WorkplaceContainerComponent\\Current\\Workplace Container Helper.exe")) and
   not (process.executable : "C:\\Windows\\Sys?????\\wbem\\WmiPrvSE.exe" and process.args : "/RegServer" and process.parent.name : ("powershell.exe", "cmd.exe")) and
   not (process.parent.name == "lsass.exe" and process.args : ("C:\\Program` Files\\PasswordRBL\\passwdfw.ps1", "C:\\Program Files\\PasswordRBL\\passwdfw.ps1")) and
   not (process.name : "services.exe" and process.parent.executable : "?:\\Windows\\LFSAgent\\lasrv.exe" and
        process.code_signature.trusted == true and
        process.code_signature.subject_name : "LEPIDE SOFTWARE PRIVATE LIMITED") and
   not (process.name : "LogonUI.exe" and process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\*\\FileCoAuth.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.executablewildcard
  • ?:\* corpus 18 (elastic 18)
  • \Device\CdRom* corpus 2 (elastic 2)
  • \Device\Mup\* corpus 8 (elastic 8)
  • \\* corpus 2 (elastic 2)
field:"Image" kind:wildcard
process.namewildcard
  • LogonUI.exe corpus 4 (elastic 4)
  • LsaIso.exe corpus 3 (elastic 3)
  • RuntimeBroker.exe corpus 3 (elastic 3)
  • SearchIndexer.exe corpus 4 (elastic 3, splunk 1)
  • SearchProtocolHost.exe corpus 6 (elastic 4, splunk 2)
  • autochk.exe corpus 4 (elastic 4)
  • consent.exe corpus 3 (elastic 3)
  • csrss.exe corpus 5 (elastic 5)
  • dwm.exe corpus 3 (elastic 3)
  • fontdrvhost.exe corpus 3 (elastic 3)
  • lsass.exe corpus 9 (elastic 9)
  • services.exe corpus 7 (elastic 7)
  • sihost.exe corpus 2 (elastic 2)
  • smss.exe corpus 4 (elastic 4)
  • spoolsv.exe corpus 5 (elastic 4, splunk 1)
  • taskhost.exe corpus 4 (elastic 3, splunk 1)
  • taskhostw.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)
  • winrshost.exe corpus 4 (elastic 4)
  • wmiprvse.exe corpus 7 (elastic 7)
  • wsmprovhost.exe corpus 4 (elastic 4)
field:"process_basename" kind:wildcard
process.parent.executablewildcard
  • ?:\* corpus 3 (elastic 3)
  • ?:\ProgramData\* corpus 3 (elastic 3)
  • ?:\Users\*\AppData\* corpus 4 (elastic 4)
  • ?:\Users\*\Desktop\*
  • ?:\Users\*\Downloads\*
  • ?:\Users\Public\* corpus 3 (elastic 3)
  • ?:\Windows\Temp\*
  • \Device\CdRom*
  • \Device\CdRom*
  • \Device\Mup\*
  • \Device\Mup\*
  • \\*
field:"ParentImage" kind:wildcard
process.parent.namewildcard
  • autochk.exe corpus 2 (elastic 2)
  • lsass.exe corpus 3 (elastic 3)
  • powershell.exe corpus 2 (elastic 2)
  • python* corpus 20 (elastic 20)
  • regsvr32.exe
  • rundll32.exe
  • smss.exe corpus 3 (elastic 3)
field:"parent_process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.token.integrity_level_nameeqsystemexcludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system"
process.argseq/regserverexcludes:process.args field:"process.args" value:"/regserver"
process.executableeq?:\Windows\System32\wbem\WmiPrvSE.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\wbem\WmiPrvSE.exe"
process.argseq/RegServerexcludes:process.args field:"process.args" value:"/RegServer"
process.executableeqC:\Windows\Sys?????\wbem\WmiPrvSE.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\Sys?????\wbem\WmiPrvSE.exe"
process.parent.nameeqpowershell.exe, cmd.exeexcludes:process.parent.name field:"process.parent.name" value:"powershell.exe" field:"process.parent.name" value:"cmd.exe"
process.argseqC:\AdPasswordSync\passwd.batexcludes:process.args field:"process.args" value:"C:\AdPasswordSync\passwd.bat"
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.parent.executableeq?:\Windows\System32\lsass.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\lsass.exe"
process.argseqC:\Program` Files\PasswordRBL\passwdfw.ps1, C:\Program Files\PasswordRBL\passwdfw.ps1excludes:process.args field:"process.args" value:"C:\Program` Files\PasswordRBL\passwdfw.ps1" field:"process.args" value:"C:\Program Files\PasswordRBL\passwdfw.ps1"
process.parent.nameeqlsass.exeexcludes:process.parent.name field:"process.parent.name" value:"lsass.exe"
process.code_signature.subject_nameeqSecure Endpoints Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Secure Endpoints Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.code_signature.subject_nameeqTeramind Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Teramind Inc."
process.nameeqdwm.exeexcludes:process.name field:"process.name" value:"dwm.exe"
process.code_signature.subject_nameeqLEPIDE SOFTWARE PRIVATE LIMITEDexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"LEPIDE SOFTWARE PRIVATE LIMITED"
process.nameeqservices.exeexcludes:process.name field:"process.name" value:"services.exe"
process.parent.executableeq?:\Windows\LFSAgent\lasrv.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\LFSAgent\lasrv.exe"
process.command_linematchUsGthrFltPipeMssGthrPipeexcludes:process.command_line field:"process.command_line" value:"UsGthrFltPipeMssGthrPipe"
process.executableeq?:\WINDOWS\system32\SearchProtocolHost.exeexcludes:process.executable field:"process.executable" value:"?:\WINDOWS\system32\SearchProtocolHost.exe"
process.parent.executablewildcard?:\Users\*\AppData\Local\Microsoft\EdgeUpdate\*\MicrosoftEdgeUpdateCore.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Microsoft\EdgeUpdate\*\MicrosoftEdgeUpdateCore.exe"
process.executableeq?:\Program Files (x86)\Tanium\Tanium Client\Patch\tools\TaniumFileInfo.exe, ?:\Program Files (x86)\VIPRE Business Agent\UrlInspectAddon.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Tanium\Tanium Client\Patch\tools\TaniumFileInfo.exe" field:"process.executable" value:"?:\Program Files (x86)\VIPRE Business Agent\UrlInspectAddon.exe"
process.parent.nameeqsmss.exeexcludes:process.parent.name field:"process.parent.name" value:"smss.exe"
process.executableeq?:\Program Files\McAfee\Endpoint Encryption Agent\MfeEpeHost.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\McAfee\Endpoint Encryption Agent\MfeEpeHost.exe"
process.executableeq?:\Windows\System32\SearchProtocolHost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\SearchProtocolHost.exe"
process.parent.executablewildcard?:\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exe, C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exe" field:"process.parent.executable" value:"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
process.executableeq?:\Windows\System32\spoolsv.exe, ?:\Windows\System32\RuntimeBroker.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\spoolsv.exe" field:"process.executable" value:"?:\Windows\System32\RuntimeBroker.exe"
process.parent.executableeq?:\Program Files (x86)\Workplace\Components\WorkplaceContainerComponent\Current\Workplace Starter.exe, ?:\Program Files (x86)\Workplace\Components\WorkplaceContainerComponent\Current\Workplace Container Helper.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Workplace\Components\WorkplaceContainerComponent\Current\Workplace Starter.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\Workplace\Components\WorkplaceContainerComponent\Current\Workplace Container Helper.exe"
process.nameeqLogonUI.exeexcludes:process.name field:"process.name" value:"LogonUI.exe"
process.parent.executablewildcard?:\Users\*\AppData\Local\Microsoft\OneDrive\*\FileCoAuth.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Microsoft\OneDrive\*\FileCoAuth.exe"
process.nameeqRuntimeBroker.exeexcludes:process.name field:"process.name" value:"RuntimeBroker.exe"
process.parent.executableeq?:\Program Files\Sandboxie\SandboxieDcomLaunch.exe, ?:\Program Files\Sandboxie-Plus\SandboxieDcomLaunch.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\Sandboxie\SandboxieDcomLaunch.exe" field:"process.parent.executable" value:"?:\Program Files\Sandboxie-Plus\SandboxieDcomLaunch.exe"
process.nameeqSearchProtocolHost.exeexcludes:process.name field:"process.name" value:"SearchProtocolHost.exe"
process.parent.argseqAppXDeploymentExtensions.OneCore.dll,ShellRefreshexcludes:process.parent.args field:"process.parent.args" value:"AppXDeploymentExtensions.OneCore.dll,ShellRefresh"
process.parent.nameeqrundll32.exeexcludes:process.parent.name field:"process.parent.name" value:"rundll32.exe"
process.nameeqconsent.exeexcludes:process.name field:"process.name" value:"consent.exe"
process.parent.argseqshell32.dll,SHCreateLocalServerRunDllexcludes:process.parent.args field:"process.parent.args" value:"shell32.dll,SHCreateLocalServerRunDll"
process.parent.argseq{9BA05972-F6A8-11CF-A442-00A0C90A8F39}excludes:process.parent.args field:"process.parent.args" value:"{9BA05972-F6A8-11CF-A442-00A0C90A8F39}"
process.parent.executableeq?:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\ADS\CRWindowsClientService.exe, ?:\Program Files\EvoSecurity\EvoAgent\EvoConsentUI.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\ADS\CRWindowsClientService.exe" field:"process.parent.executable" value:"?:\Program Files\EvoSecurity\EvoAgent\EvoConsentUI.exe"
process.nameeqwinlogon.exe, csrss.exeexcludes:process.name field:"process.name" value:"winlogon.exe" field:"process.name" value:"csrss.exe"
process.parent.argseq/backgroundexcludes:process.parent.args field:"process.parent.args" value:"/background"
process.parent.argseq/client=Personalexcludes:process.parent.args field:"process.parent.args" value:"/client=Personal"
process.parent.executablewildcard?:\Users\*\AppData\Local\Microsoft\OneDrive\OneDrive.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Microsoft\OneDrive\OneDrive.exe"
process.parent.argseq-SpecialSessionexcludes:process.parent.args field:"process.parent.args" value:"-SpecialSession"
process.parent.executableeq?:\Windows\System32\smss.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\smss.exe"
process.parent.executablewildcard?:\Program Files\Adobe\Acrobat DC\Acrobat\AcroCEF\AcroCEF.exe, ?:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\*\AcroCEF.exe, ?:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroCEF\RdrCEF.exe, ?:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroCEF\RdrCEF.exeexcludes:process.parent.executable

Suspicious Path Mounted

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

This rule detects suspicious paths mounted on Linux systems. The mount command is used to attach filesystems to the system, and attackers may use it to mount malicious filesystems or directories for data exfiltration or persistence.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body


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

[rule]
author = ["Elastic"]
description = """
This rule detects suspicious paths mounted on Linux systems. The mount command is used to attach filesystems to
the system, and attackers may use it to mount malicious filesystems or directories for data exfiltration or
persistence.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Path Mounted"
note = """ ## Triage and analysis

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

### Investigating Suspicious Path Mounted

In Linux environments, the mount command integrates filesystems, enabling access to storage devices. Adversaries exploit this by mounting malicious filesystems in sensitive directories like /tmp or /dev/shm to exfiltrate data or maintain persistence. The detection rule identifies such activities by monitoring the execution of the mount command in unusual paths, excluding legitimate parent processes, thus highlighting potential threats.

### Possible investigation steps

- Review the process details to confirm the execution of the mount command, focusing on the process.name and process.args fields to identify the specific path being mounted.
- Examine the process.parent.executable field to determine the parent process that initiated the mount command, ensuring it is not a known legitimate process.
- Investigate the user account associated with the process to determine if it is a privileged account or if there are any signs of compromise.
- Check for any recent changes or anomalies in the mounted directories, such as unexpected files or modifications, to assess potential data exfiltration or persistence activities.
- Correlate the event with other security alerts or logs from the same host to identify any related suspicious activities or patterns that could indicate a broader attack.

### False positive analysis

- System maintenance scripts may trigger the rule if they mount filesystems in monitored paths. Review and whitelist these scripts by adding their parent executable paths to the exclusion list.
- Backup processes that temporarily mount directories for data transfer can be mistaken for suspicious activity. Identify these processes and exclude their parent executables to prevent false alerts.
- Software installations or updates that require mounting filesystems in user directories might be flagged. Verify these activities and add the responsible parent executables to the exclusion criteria.
- Development tools that use temporary mounts for testing purposes can generate false positives. Recognize these tools and exclude their parent executables to reduce noise.
- Custom administrative scripts that perform legitimate mounting operations should be reviewed and, if deemed safe, their parent executables should be added to the exclusion list.

### Response and remediation

- Immediately isolate the affected system to prevent further data exfiltration or persistence by disconnecting it from the network.
- Terminate any suspicious mount processes identified in the alert to halt potential malicious activity.
- Conduct a thorough review of mounted filesystems and directories to identify and unmount any unauthorized or suspicious mounts.
- Restore any compromised files or directories from backups, ensuring they are clean and free from malicious modifications.
- Implement stricter access controls and permissions on sensitive directories like /tmp, /var/tmp, /dev/shm, /home, and /root to prevent unauthorized mounting.
- Escalate the incident to the security operations team for further investigation and to assess the scope of the threat, including potential lateral movement or additional compromised systems.
- Enhance monitoring and detection capabilities by configuring alerts for unusual mount activities and integrating threat intelligence feeds to identify similar tactics used by adversaries.
"""
risk_score = 47
rule_id = "68e90a9b-0eab-425e-be3b-902b0cd1fe9c"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.

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

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name == "mount" and 
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/home/*", "/root/*", "/mount") and process.parent.executable != null and
not (
  process.parent.executable like (
    "/bin/*", "/usr/bin/*", "/usr/local/bin/*", "/sbin/*", "/usr/sbin/*", "/usr/local/sbin/*", "/usr/libexec/*",
    "/usr/local/nutanix/ngt/*/python"
  ) or
  process.parent.executable in (
    "/usr/lib/uptrack/ksplice-apply", "/usr/lib/Acronis/BackupAndRecovery/mms",
    "/usr/lib/Acronis/BackupAndRecovery/service_process-bin", "/usr/lib/systemd/systemd", "/etc/grub.d/10_linux_zfs",
    "./tools/image-summary", "/nfsplugin", "/usr/share/ksplice/ksplice-apply", "/lib/systemd/systemd"
  ) or
  process.parent.name == "snapd"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name == "mount" and 
process.args like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/home/*", "/root/*", "/mount") and process.parent.executable != null and
not (
  process.parent.executable like (
    "/bin/*", "/usr/bin/*", "/usr/local/bin/*", "/sbin/*", "/usr/sbin/*", "/usr/local/sbin/*", "/usr/libexec/*",
    "/usr/local/nutanix/ngt/*/python"
  ) or
  process.parent.executable in (
    "/usr/lib/uptrack/ksplice-apply", "/usr/lib/Acronis/BackupAndRecovery/mms",
    "/usr/lib/Acronis/BackupAndRecovery/service_process-bin", "/usr/lib/systemd/systemd", "/etc/grub.d/10_linux_zfs",
    "./tools/image-summary", "/nfsplugin", "/usr/share/ksplice/ksplice-apply", "/lib/systemd/systemd"
  ) or
  process.parent.name == "snapd"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executablein./tools/image-summary, /etc/grub.d/10_linux_zfs, /lib/systemd/systemd, /nfsplugin, /usr/lib/Acronis/BackupAndRecovery/mms, /usr/lib/Acronis/BackupAndRecovery/service_process-bin, /usr/lib/systemd/systemd, /usr/lib/uptrack/ksplice-apply, /usr/share/ksplice/ksplice-applyexcludes:process.parent.executable
process.parent.executablewildcard/bin/*, /usr/bin/*, /usr/local/bin/*, /sbin/*, /usr/sbin/*, /usr/local/sbin/*, /usr/libexec/*, /usr/local/nutanix/ngt/*/pythonexcludes:process.parent.executable
process.parent.nameeqsnapdexcludes:process.parent.name field:"process.parent.name" value:"snapd"

Suspicious Terminal Child Process Execution

#
Source
github.com/elastic/protections-artifacts

Detects the execution of a process in a suspicious location by the Terminal application. Terminal will, often times, be granted full disk access by users and administrators who use it. Threat actors are aware of this and will abuse it in order to get their payloads to execute with the same context as Terminal, providing their payload full disk access. They do this by modifying shell profiles (e.g .zshrc, bashrc, etc.) that point to and execute their payload then when Terminal initiates those profiles the payload gets executed within the same context as Terminal.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the execution of a process in a suspicious location by the Terminal application. Terminal will, often times, be
granted full disk access by users and administrators who use it. Threat actors are aware of this and will abuse it in
order to get their payloads to execute with the same context as Terminal, providing their payload full disk access. They
do this by modifying shell profiles (e.g .zshrc, bashrc, etc.) that point to and execute their payload then when
Terminal initiates those profiles the payload gets executed within the same context as Terminal.
"""
id = "8e88d216-af7a-4f5c-8155-fa7d2be03987"
license = "Elastic License v2"
name = "Suspicious Terminal Child Process Execution"
os_list = ["macos"]
reference = ["https://cedowens.medium.com/give-me-some-macos-context-c13aecbd4c5b"]
version = "1.0.21"

query = '''
process where event.type == "start" and event.action == "exec" and 
 user.name == "root" and 
 process.parent.name like~ "terminal" and
 process.name like~ ("terminal", "zsh", "bash", "sh", "tclsh*") and
 process.args == "-c" and
 process.args like~ 
               ("/private/tmp/*", 
                "/var/tmp/*", 
                "/tmp/*", 
                "/var/folders/*", 
                "/Users/Shared/*", 
                "/Library/Containers/*", 
                "/var/root/*", 
                "/Library/WebServer/*", 
                "/Library/Graphics/*",
                "/Library/Fonts/*", 
                "/usr/local/bin/*", 
                "/Users/*/Library/*", 
                "/Users/*/Applications/*")
'''

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

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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and 
 user.name == "root" and 
 process.parent.name like~ "terminal" and
 process.name like~ ("terminal", "zsh", "bash", "sh", "tclsh*") and
 process.args == "-c" and
 process.args like~ 
               ("/private/tmp/*", 
                "/var/tmp/*", 
                "/tmp/*", 
                "/var/folders/*", 
                "/Users/Shared/*", 
                "/Library/Containers/*", 
                "/var/root/*", 
                "/Library/WebServer/*", 
                "/Library/Graphics/*",
                "/Library/Fonts/*", 
                "/usr/local/bin/*", 
                "/Users/*/Library/*", 
                "/Users/*/Applications/*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • -c corpus 91 (elastic 91)
field:"process.args" kind:eq value:"-c"
process.argswildcard
  • /Library/Containers/* corpus 3 (elastic 3)
  • /Library/Fonts/* corpus 3 (elastic 3)
  • /Library/Graphics/* corpus 2 (elastic 2)
  • /Library/WebServer/* corpus 3 (elastic 3)
  • /Users/*/Applications/* corpus 3 (elastic 3)
  • /Users/*/Library/* corpus 2 (elastic 2)
  • /Users/Shared/* corpus 3 (elastic 3)
  • /private/tmp/* corpus 3 (elastic 3)
  • /tmp/* corpus 7 (elastic 7)
  • /usr/local/bin/* corpus 2 (elastic 2)
  • /var/folders/* corpus 3 (elastic 3)
  • /var/root/* corpus 3 (elastic 3)
  • /var/tmp/* corpus 7 (elastic 7)
field:"process.args" kind:wildcard
process.namewildcard
  • bash corpus 33 (elastic 33)
  • sh corpus 33 (elastic 33)
  • tclsh* corpus 10 (elastic 10)
  • terminal corpus 3 (elastic 3)
  • zsh corpus 31 (elastic 31)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • terminal
field:"parent_process_basename" kind:wildcard value:"terminal"
user.nameeq
  • root corpus 4 (elastic 4)
field:"user" kind:eq value:"root"

Suspicious Web Browser Sensitive File Access

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

Identifies the access or file open of web browser sensitive files by an untrusted/unsigned process or osascript. Adversaries may acquire credentials from web browsers by reading files specific to the target browser.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2020/01/04"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/08/25"

[rule]
author = ["Elastic", "Massimo Bertocchi"]
description = """
Identifies the access or file open of web browser sensitive files by an untrusted/unsigned process or osascript.
Adversaries may acquire credentials from web browsers by reading files specific to the target browser.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Web Browser Sensitive File Access"
references = ["https://securelist.com/calisto-trojan-for-macos/86543/"]
risk_score = 73
rule_id = "20457e4f-d1de-4b92-ae69-142e27a4342a"
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 macOS 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, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where event.action == "open" and host.os.type == "macos" and process.executable != null and
 file.name like~ ("cookies.sqlite",
                  "key?.db",
                  "logins.json",
                  "Cookies",
                  "Cookies.binarycookies",
                  "Login Data") and
 ((process.code_signature.trusted == false or process.code_signature.exists == false) or process.name == "osascript") and
 not process.code_signature.signing_id == "org.mozilla.firefox" and
not ?Effective_process.executable like "/Library/Elastic/Endpoint/elastic-endpoint.app/Contents/MacOS/elastic-endpoint"
'''
note = """## Triage and analysis

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

### Investigating Suspicious Web Browser Sensitive File Access

Web browsers store sensitive data like cookies and login credentials in specific files. Adversaries exploit this by accessing these files using untrusted or unsigned processes, potentially stealing credentials. The detection rule identifies such unauthorized access on macOS by monitoring file access events, focusing on untrusted processes or scripts, and excluding known safe executables, thus flagging potential credential theft attempts.

### Possible investigation steps

- Review the process executable path and name to determine if it is a known legitimate application or script, focusing on those not signed by trusted entities or identified as osascript.
- Check the process code signature details to verify if the process is unsigned or untrusted, which could indicate malicious activity.
- Investigate the user account associated with the process to determine if there is any unusual or unauthorized activity, such as unexpected logins or privilege escalations.
- Examine the file access event details, including the specific sensitive file accessed (e.g., cookies.sqlite, logins.json), to assess the potential impact on credential security.
- Correlate the event with other security alerts or logs from the same host or user to identify any patterns or additional suspicious activities that might indicate a broader compromise.
- Verify if the process executable path matches any known safe paths, such as the excluded path for the Elastic Endpoint, to rule out false positives.

### False positive analysis

- Access by legitimate applications: Some legitimate applications may access browser files for valid reasons, such as backup or synchronization tools. Users can create exceptions for these applications by adding their code signatures to the exclusion list.
- Developer or testing scripts: Developers might use scripts like osascript for testing purposes, which could trigger the rule. To manage this, users can whitelist specific scripts or processes used in development environments.
- Security software interactions: Security tools might access browser files as part of their scanning or monitoring activities. Users should verify the legitimacy of these tools and add them to the exclusion list if they are trusted.
- System maintenance tasks: Automated system maintenance tasks might access browser files. Users can identify these tasks and exclude them if they are part of routine system operations and deemed safe.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any untrusted or unsigned processes identified in the alert, especially those accessing sensitive browser files.
- Conduct a thorough review of the affected system's recent activity logs to identify any additional suspicious behavior or potential lateral movement.
- Change all potentially compromised credentials, focusing on those stored in the affected web browsers, and enforce multi-factor authentication where possible.
- Restore any altered or deleted sensitive files from a known good backup to ensure data integrity.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Update endpoint protection and monitoring tools to enhance detection capabilities for similar unauthorized access attempts in the future."""


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

[[rule.threat.technique]]
id = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"

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

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

[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 = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"

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

Stages and Predicates

Stage 1: file

file where event.action == "open" and host.os.type == "macos" and process.executable != null and
 file.name like~ ("cookies.sqlite",
                  "key?.db",
                  "logins.json",
                  "Cookies",
                  "Cookies.binarycookies",
                  "Login Data") and
 ((process.code_signature.trusted == false or process.code_signature.exists == false) or process.name == "osascript") and
 not process.code_signature.signing_id == "org.mozilla.firefox" and
not ?Effective_process.executable like "/Library/Elastic/Endpoint/elastic-endpoint.app/Contents/MacOS/elastic-endpoint"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 49 (elastic 49)
field:"EventType" kind:eq value:"open"
file.namewildcard
  • Cookies corpus 8 (elastic 8)
  • Cookies.binarycookies corpus 8 (elastic 8)
  • Login Data corpus 8 (elastic 8)
  • cookies.sqlite corpus 11 (elastic 11)
  • key?.db corpus 11 (elastic 11)
  • logins.json corpus 11 (elastic 11)
field:"file.name" kind:wildcard
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Effective_process.executableeq/Library/Elastic/Endpoint/elastic-endpoint.app/Contents/MacOS/elastic-endpointexcludes:Effective_process.executable field:"Effective_process.executable" value:"/Library/Elastic/Endpoint/elastic-endpoint.app/Contents/MacOS/elastic-endpoint"
process.code_signature.signing_ideqorg.mozilla.firefoxexcludes:process.code_signature.signing_id field:"process.code_signature.signing_id" value:"org.mozilla.firefox"

Suspicious Zoom Child Process

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

A suspicious Zoom child process was detected, which may indicate an attempt to run unnoticed. Verify process details such as command line, network connections, file writes and associated file signature details as well.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"

[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"

[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""

[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""


[rule]
author = ["Elastic"]
description = """
A suspicious Zoom child process was detected, which may indicate an attempt to run unnoticed. Verify process details
such as command line, network connections, file writes and associated file signature details as well.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Zoom Child Process"
note = """## Triage and analysis

### Investigating Suspicious Zoom Child Process

By examining the specific traits of Windows binaries -- such as process trees, command lines, network connections, registry modifications, and so on -- it's possible to establish a baseline of normal activity. Deviations from this baseline can indicate malicious activity, such as masquerading, and deserve further investigation.

This rule identifies a potential malicious process masquerading as `Zoom.exe` or exploiting a vulnerability in the application causing it to execute code.

> **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.

#### Possible investigation steps

- 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.
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
- Examine the command line of the child process to determine which commands or scripts were executed.
- Examine the host for derived artifacts that indicate suspicious activities:
  - Analyze the process executable using a private sandboxed analysis system.
  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
    - Attempts to contact external domains and addresses.
      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
      - Examine the DNS cache for suspicious or anomalous entries.
        - $osquery_0
    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
    - Examine the host services for suspicious or anomalous entries.
      - $osquery_1
      - $osquery_2
      - $osquery_3
  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.


### False positive analysis

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

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further 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.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""

setup = """## Setup

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

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

### Additional data sources

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

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

risk_score = 47
rule_id = "97aba1ef-6034-4bd3-8c1a-1e0996b27afa"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Execution",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Windows Security Event Logs",
    "Data Source: Crowdstrike",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
 process.parent.name : "Zoom.exe" and process.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe")
'''


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

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

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

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

[[rule.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.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
 process.parent.name : "Zoom.exe" and process.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • powershell_ise.exe corpus 53 (splunk 29, elastic 24)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • Zoom.exe corpus 3 (elastic 2, splunk 1)
field:"parent_process_basename" kind:wildcard value:"Zoom.exe"

Back to all Elastic rules