Detection rules › Elastic

Elastic rules: 33

Access Control List Modification via setfacl

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

This rule detects Linux Access Control List (ACL) modification via the setfacl command. Attackers may use the setfacl utility to modify file and directory permissions in order to evade detection and maintain persistence on a compromised system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/08/23"
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/12/17"

[rule]
author = ["Elastic"]
description = """
This rule detects Linux Access Control List (ACL) modification via the setfacl command. Attackers may
use the setfacl utility to modify file and directory permissions in order to evade detection and maintain
persistence on a compromised system.
"""
from = "now-9m"
index = [
    "auditbeat-*",
    "endgame-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Access Control List Modification via setfacl"
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 Access Control List Modification via setfacl

Access Control Lists (ACLs) in Linux enhance file permission management by allowing more granular access control. The `setfacl` command modifies these ACLs, potentially altering who can access or modify files. Adversaries may exploit `setfacl` to stealthily change permissions, evading detection and maintaining persistence. The detection rule identifies suspicious `setfacl` executions, excluding benign patterns, to flag potential misuse.

### Possible investigation steps

- Review the process details to confirm the execution of the setfacl command, focusing on the process.name and event.type fields to ensure the alert is valid.
- Examine the process.command_line to understand the specific ACL modifications attempted and identify any unusual or unauthorized changes.
- Investigate the user account associated with the process execution to determine if the action aligns with their typical behavior or role.
- Check the process's parent process to identify how the setfacl command was initiated and assess if it was part of a legitimate workflow or a potential compromise.
- Correlate the event with other security logs or alerts from the same host to identify any related suspicious activities or patterns that might indicate a broader attack.

### False positive analysis

- Routine system maintenance tasks may trigger the rule if they involve legitimate use of setfacl. To manage this, identify and document regular maintenance scripts or processes that use setfacl and create exceptions for these specific command lines.
- Backup operations that restore ACLs using setfacl can be mistaken for suspicious activity. Exclude these by adding exceptions for command lines that match known backup procedures, such as those using the --restore option.
- Automated log management tools might use setfacl to manage permissions on log directories like /var/log/journal/. To prevent false positives, exclude these specific directory paths from triggering the rule.
- Custom applications or services that require dynamic permission changes using setfacl could be flagged. Review these applications and, if deemed safe, add their specific command patterns to the exception list to avoid unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or changes.
- Review the process execution logs to identify any unauthorized users or processes that executed the `setfacl` command.
- Revert any unauthorized ACL changes by restoring the original file permissions from a known good backup or configuration.
- Conduct a thorough scan of the system for any additional signs of compromise, such as unauthorized user accounts or unexpected processes.
- Update and patch the system to address any vulnerabilities that may have been exploited to gain access.
- Implement stricter access controls and monitoring on critical systems to detect and prevent unauthorized ACL modifications in the future.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected."""
references = [
    "https://www.uptycs.com/blog/threat-research-report-team/evasive-techniques-used-by-malicious-linux-shell-scripts",
]
risk_score = 21
rule_id = "999565a2-fc52-4d72-91e4-ba6712c0377e"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: Auditd Manager",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name == "setfacl" and not (
  ?process.parent.executable in (
    "/opt/puppetlabs/puppet/bin/ruby", "/usr/libexec/dirsrv/ds_systemd_ask_password_acl", "/usr/lib/systemd/systemd-udevd",
    "/usr/bin/udevadm", "/usr/sbin/ds_systemd_ask_password_acl", "/usr/bin/su", "/bin/su"
  ) or
  process.command_line == "/bin/setfacl --restore=-" or
  process.args == "/var/log/journal/" or
  ?process.parent.name in ("stats.pl", "perl", "find") or
  ?process.parent.command_line like~ "*ansible*" or
  ?process.parent.args == "/opt/audit-log-acl.sh"
)
'''

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

[[rule.threat.technique]]
id = "T1222"
name = "File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/"

[[rule.threat.technique.subtechnique]]
id = "T1222.002"
name = "Linux and Mac File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/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 == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name == "setfacl" and not (
  ?process.parent.executable in (
    "/opt/puppetlabs/puppet/bin/ruby", "/usr/libexec/dirsrv/ds_systemd_ask_password_acl", "/usr/lib/systemd/systemd-udevd",
    "/usr/bin/udevadm", "/usr/sbin/ds_systemd_ask_password_acl", "/usr/bin/su", "/bin/su"
  ) or
  process.command_line == "/bin/setfacl --restore=-" or
  process.args == "/var/log/journal/" or
  ?process.parent.name in ("stats.pl", "perl", "find") or
  ?process.parent.command_line like~ "*ansible*" or
  ?process.parent.args == "/opt/audit-log-acl.sh"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq/var/log/journal/excludes:process.args field:"process.args" value:"/var/log/journal/"
process.command_lineeq/bin/setfacl --restore=-excludes:process.command_line field:"process.command_line" value:"/bin/setfacl --restore=-"
process.parent.argseq/opt/audit-log-acl.shexcludes:process.parent.args field:"process.parent.args" value:"/opt/audit-log-acl.sh"
process.parent.command_linematchansibleexcludes:process.parent.command_line field:"process.parent.command_line" value:"ansible"
process.parent.executablein/bin/su, /opt/puppetlabs/puppet/bin/ruby, /usr/bin/su, /usr/bin/udevadm, /usr/lib/systemd/systemd-udevd, /usr/libexec/dirsrv/ds_systemd_ask_password_acl, /usr/sbin/ds_systemd_ask_password_aclexcludes:process.parent.executable
process.parent.nameinfind, perl, stats.plexcludes:process.parent.name field:"process.parent.name" value:"find" field:"process.parent.name" value:"perl" field:"process.parent.name" value:"stats.pl"

AWS First Occurrence of STS GetFederationToken Request by User

#
Status
production
Severity
high
Time window
6m
Group by
aws.cloudtrail.user_identity.arn
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the first occurrence of an AWS Security Token Service (STS) GetFederationToken request made by a user. The GetFederationToken API call allows users to request temporary security credentials to access AWS resources. The maximum expiration period for these tokens is 36 hours and they can be used to create a console signin token even for identities that don't already have one. Adversaries may use this API to obtain temporary credentials for persistence and to bypass IAM API call limitations by gaining console access.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2024/08/19"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/08"

[rule]
author = ["Elastic"]
description = """
Identifies the first occurrence of an AWS Security Token Service (STS) GetFederationToken request made by a user. The GetFederationToken API call allows users to request temporary security credentials to
access AWS resources. The maximum expiration period for these tokens is 36 hours and they can be used to create a console signin token even for identities that don't already have one. Adversaries may use this API to obtain temporary credentials for persistence and to bypass IAM API call limitations by gaining console access.
"""
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS First Occurrence of STS GetFederationToken Request by User"
references = [
    "https://hackingthe.cloud/aws/post_exploitation/survive_access_key_deletion_with_sts_getfederationtoken/",
    "https://www.crowdstrike.com/en-us/blog/how-adversaries-persist-with-aws-user-federation/",
    "https://medium.com/@adan.alvarez/how-attackers-persist-in-aws-using-getfederationtoken-a-simple-and-effective-technique-used-in-the-987ec1f0bdfe/"
]
risk_score = 73
rule_id = "7a5cc9a8-5ea3-11ef-beec-f661ea17fbce"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: Amazon Web Services",
    "Data Source: AWS",
    "Data Source: AWS STS",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Tactic: Persistence",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider:sts.amazonaws.com
    and event.action:GetFederationToken
    and event.outcome:success
'''
note = """## Triage and analysis

### Investigating AWS First Occurrence of STS GetFederationToken Request by User

AWS Security Token Service (STS) enables users to request temporary credentials for accessing AWS resources. While beneficial for legitimate use, adversaries may exploit this to gain unauthorized access. These credentials will remain active for the duration specified (maximum 36 hours), even if the initial compromised identity is deleted. They can also be used to request a console signin token which allows the adversary to make sensitive IAM API calls which would otherwise be denied with the federation token alone. The detection rule identifies unusual activity by flagging the first instance of a `GetFederationToken` request by a user helping to uncover potential misuse aimed at evading defenses and gaining persistence.

### Possible investigation steps

- Review the specific user account associated with the `GetFederationToken` request to determine if the activity aligns with their typical behavior and role within the organization.
- Examine the AWS CloudTrail logs for additional context around the time of the `GetFederationToken` request, looking for any other unusual or suspicious activities by the same user or related accounts.
- Check the `source.ip` and `source.geo` fields of the request to identify if it originates from an expected or unexpected location.
- View the `aws.cloudtrail.response_elements` to find the created `federatedUser.arn`. Investigate the resources accessed by this Federated User to assess if there was any suspicious activity.
- Consult with the requesting user `aws.cloudtrail.user_identity.arn` to verify if the `GetFederationToken` request was legitimate and necessary for their work tasks.

### False positive analysis

- Routine administrative tasks by cloud administrators may trigger the rule if they are using `GetFederationToken` for legitimate purposes. To manage this, create exceptions for known administrative accounts that regularly perform these actions.
- Automated scripts or applications that use `GetFederationToken` for legitimate operations might be flagged. Identify these scripts and exclude their associated user accounts from the rule to prevent unnecessary alerts.
- Third-party services integrated with AWS that require temporary credentials might cause false positives. Review and whitelist these services if they are verified and trusted to avoid repeated alerts.
- New employees or contractors accessing AWS resources for the first time may trigger the rule. Implement a process to verify their access requirements and exclude their accounts if their actions are deemed non-threatening.

### Response and remediation

- If compromise is verified, attach a policy that denies all actions, effectively preventing any further activity, even from temporary credentials. You can use the AWS-managed policy [AWSDenyAll](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSDenyAll.html). This ensures that any temporary credentials generated by the compromised user are also blocked, stopping the attacker’s activities.
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
- Conduct a root cause analysis to determine how the `GetFederationToken` request was initiated and identify any potential security gaps or misconfigurations.
- Implement additional monitoring and alerting for `GetFederationToken` requests to detect and respond to similar activities promptly in the future.
- Review and update IAM policies and permissions to ensure that only authorized users have the ability to request temporary credentials, reducing the risk of misuse."""

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

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"
[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/001/"


[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"


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

[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.arn"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: "aws.cloudtrail"
    and event.provider:sts.amazonaws.com
    and event.action:GetFederationToken
    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.actioneq
  • GetFederationToken corpus 2 (elastic 2)
field:"EventType" kind:eq value:"GetFederationToken"
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • sts.amazonaws.com corpus 11 (elastic 11)
field:"Provider_Name" kind:eq value:"sts.amazonaws.com"

Azure AKS CoreDNS or Kube-DNS Configuration Modified

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

Detects an identity creating or modifying the CoreDNS or kube-dns ConfigMap in the kube-system namespace on AKS (Azure Kubernetes Service), excluding known AKS control-plane and platform identities. Rewriting cluster DNS (by editing coredns/kube-dns or creating and editing coredns-custom) enables cluster-wide adversary-in-the-middle by redirecting internal service resolution to attacker-controlled IPs, allowing credential capture and traffic interception. Coverage includes workload service accounts (system:serviceaccount:*), so a compromised in-cluster token is not excluded.

Known False Positives

  • Approved automation, platform controllers, or GitOps may update the CoreDNS ConfigMap (for example custom forward rules). Validate the identity and change window, and add exclusions for verified service accounts.

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

[rule]
author = ["Elastic"]
description = """
Detects an identity creating or modifying the CoreDNS or kube-dns ConfigMap in the kube-system namespace on AKS (Azure
Kubernetes Service), excluding known AKS control-plane and platform identities. Rewriting cluster DNS (by editing
coredns/kube-dns or creating and editing coredns-custom) enables cluster-wide adversary-in-the-middle by redirecting
internal service resolution to attacker-controlled IPs, allowing credential capture and traffic interception. Coverage
includes workload service accounts (system:serviceaccount:*), so a compromised in-cluster token is not excluded.
"""
false_positives = [
    """
    Approved automation, platform controllers, or GitOps may update the CoreDNS ConfigMap (for example custom forward
    rules). Validate the identity and change window, and add exclusions for verified service accounts.
    """,
]
from = "now-9m"
index = ["logs-azure.platformlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure AKS CoreDNS or Kube-DNS Configuration Modified"
note = """## Triage and analysis

### Investigating Azure AKS CoreDNS or Kube-DNS Configuration Modified

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`. CoreDNS resolves in-cluster
service names; an attacker who edits `coredns`/`kube-dns` or creates/edits the user-managed `coredns-custom` ConfigMap
can inject forward or rewrite rules that redirect service resolution to attacker-controlled endpoints, enabling
cluster-wide interception of credentials and traffic. `coredns-custom` is the supported customization surface, so
legitimate DNS tuning also lands here; the acting identity is excluded when it is an AKS platform reconciler
(`aksService`), leaving non-platform changes as the signal.

### Possible investigation steps

- Review the submitted ConfigMap body in `azure.platformlogs.properties.log.requestObject.data` for added forward,
  rewrite, or hosts entries pointing at unexpected IPs or domains. This content, not the act of editing, is what
  distinguishes malicious DNS redirection from routine customization.
- Identify the acting identity in `azure.platformlogs.properties.log.user.username` (and its groups in
  `azure.platformlogs.properties.log.user.groups`) and confirm it should manage the CoreDNS configuration; a workload
  service account (`system:serviceaccount:<ns>:<sa>`) editing cluster DNS is the higher-concern case.
- Confirm the operation and object via `azure.platformlogs.properties.log.verb` (a `create` of `coredns-custom` where it
  did not previously exist is notable) and `azure.platformlogs.properties.log.objectRef.name` (`coredns`,
  `coredns-custom`, or `kube-dns`), and inspect `azure.platformlogs.properties.log.userAgent`.
- Evaluate the source in `azure.platformlogs.properties.log.sourceIPs` and pivot on it for related RBAC changes, secret
  reads, or exec sessions.

### False positive analysis

- `coredns-custom` is the AKS-supported way to add custom forward/stub rules, so approved automation, GitOps, or
  administrators editing it are expected. The AKS reconciler (`aksService`) that continuously (re)creates
  `coredns-custom` is excluded by identity. Validate the change content and window, then exclude the specific verified
  service account rather than re-broadening to all `system:*`.

### Response and remediation

- If unauthorized, restore the CoreDNS ConfigMap from a known-good source, revoke the acting identity's tokens, and
  review the RBAC that permitted the change.
- Hunt for credential capture or redirected traffic during the window the malicious configuration was active.
- Collect kube-audit and identity artifacts per incident response procedures.
"""
references = [
    "https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/",
    "https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
    "https://microsoft.github.io/Threat-Matrix-for-Kubernetes/techniques/CoreDNS%20poisoning/",
    "https://learn.microsoft.com/en-us/azure/aks/coredns-custom",
    "https://www.aquasec.com/blog/dns-spoofing-kubernetes-clusters/",
    "https://hub.armosec.io/docs/c-0037",
]
risk_score = 47
rule_id = "1291513f-02f2-48d6-9f9c-06e5c8f23ecb"
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). ConfigMap writes are
mutating operations recorded in both categories with the same `auditID`, so clusters that enable both categories may
generate two alerts per change.
"""
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:"configmaps" and
  azure.platformlogs.properties.log.objectRef.namespace:"kube-system" and
  azure.platformlogs.properties.log.objectRef.name:("coredns" or "kube-dns" or "coredns-custom") and
  azure.platformlogs.properties.log.verb:("create" or "update" or "patch" or "delete") 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.responseStatus.code",
]

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

[[rule.threat.technique]]
id = "T1557"
name = "Adversary-in-the-Middle"
reference = "https://attack.mitre.org/techniques/T1557/"

[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:"configmaps" and
  azure.platformlogs.properties.log.objectRef.namespace:"kube-system" and
  azure.platformlogs.properties.log.objectRef.name:("coredns" or "kube-dns" or "coredns-custom") and
  azure.platformlogs.properties.log.verb:("create" or "update" or "patch" or "delete") 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.

Bun Script Attempted to Access IMDS Metadata

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

Identifies Bun scripting interpreter establishing a network connection to the link-local instance metadata service address (169.254.169.254). Adversaries and cloud malware often query the instance metadata API to harvest IAM credentials, tokens, and other secrets from cloud-hosted workloads.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Identifies Bun scripting interpreter establishing a network connection to the link-local instance metadata service
address (169.254.169.254). Adversaries and cloud malware often query the instance metadata API to harvest IAM
credentials, tokens, and other secrets from cloud-hosted workloads.
"""
id = "04a04478-10b8-4b3f-a4e1-fe0c49c0f65b"
license = "Elastic License v2"
name = "Bun Script Attempted to Access IMDS Metadata"
os_list = ["macos"]
reference = [
    "https://attack.mitre.org/techniques/T1552/005/",
    "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html",
    "https://www.elastic.co/security-labs/shai-hulud-chaindrop-npm-supply-chain",
]
version = "1.0.0"

query = '''
sequence by process.entity_id with maxspan=1m
  [process where event.type == "start" and event.action in ("start", "exec") and process.name : ("bun", "bun.exe") and 
   not process.command_line like ("bun --watch src/app.ts", 
                                  "bun test src/integrations/__tests__/*", 
                                  "bun run scripts/ingest-resilience-retrospectives.ts --ingest", 
                                  "bun packages/product-config/codegen/api-codegen.ts", 
                                  "bun run apps/backend/probe-pagination.ts")]
  [network where event.action == "connection_attempted" and destination.address == "169.254.169.254" and destination.port == 80]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action in ("start", "exec") and process.name : ("bun", "bun.exe") and 
   not process.command_line like ("bun --watch src/app.ts", 
                                  "bun test src/integrations/__tests__/*", 
                                  "bun run scripts/ingest-resilience-retrospectives.ts --ingest", 
                                  "bun packages/product-config/codegen/api-codegen.ts", 
                                  "bun run apps/backend/probe-pagination.ts")]

Stage 2: network

[network where event.action == "connection_attempted" and destination.address == "169.254.169.254" and destination.port == 80]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.addresseq
  • 169.254.169.254 corpus 2 (elastic 2)
field:"destination.address" kind:eq value:"169.254.169.254"
destination.porteq
  • 80 transforms: number corpus 4 (elastic 4)
field:"DestinationPort" kind:eq value:"80"
event.actioneq
  • connection_attempted corpus 72 (elastic 72)
field:"EventType" kind:eq value:"connection_attempted"
event.actionin
  • exec corpus 180 (elastic 180)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • bun corpus 4 (elastic 4)
  • bun.exe corpus 3 (elastic 3)
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linewildcardbun --watch src/app.ts, bun test src/integrations/__tests__/*, bun run scripts/ingest-resilience-retrospectives.ts --ingest, bun packages/product-config/codegen/api-codegen.ts, bun run apps/backend/probe-pagination.tsexcludes:process.command_line

Chromium Extension Loaded from Unusual Parent

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

Detects the manual loading of a Chromium extension from an unusual parent process. This activity is suspicious and could be indicative of a malware loading a malicious extension to persist or collect browsing secrets such as cookies, browsing history.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects the manual loading of a Chromium extension from an unusual parent process. This activity is suspicious and could
be indicative of a malware loading a malicious extension to persist or collect browsing secrets such as cookies,
browsing history.
"""
id = "d7fda3d7-fe77-49c2-8b50-d28a6da206c4"
license = "Elastic License v2"
name = "Chromium Extension Loaded from Unusual Parent"
os_list = ["windows"]
reference = [
    "https://redcanary.com/blog/chromeloader/",
    "https://blogs.vmware.com/security/2022/09/the-evolution-of-the-chromeloader-malware.html",
]
version = "1.0.27"

query = '''
sequence with maxspan=5m
 [process where event.action == "start" and process.parent.executable != null and
  (
   (process.Ext.relative_file_creation_time <= 600 or process.Ext.relative_file_name_modify_time <= 600) or
   process.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*", "?:\\Windows\\Microsoft.Net\\*") or
   process.name in~ ("wscript.exe", "cscript.exe", "mshta.exe", "powershell.exe", "regsvr32.exe", "rundll32.exe", "cmd.exe")
  ) and
  not (process.code_signature.subject_name :
               ("Cypress.io, Inc.", "PortSwigger Ltd", "Scalehat Technologies Ltd", "Azul Systems, Inc.", "JetBrains s.r.o.",
                "Katalon Inc.", "Shenzhen Love Sense Technology Co., Ltd.") and
       process.code_signature.trusted == true) and

  not process.hash.sha256 :
              ("a064743886dc4068db7e4143a2eba14d1cdf80f5dd28d8057c6087a30ca7f3b4",
               "7d95b4e26859620738a31dbbafbf019da42f2378821e2bb49b748956ef50b3e3",
               "fcc098d6a5df5a302c4fc635203bf28868a92d2469465551f6cf7e5c93a1719a",
               "e4244190024bdd0ffed267b47f897cca054a4762c76b93cb34ae2d7925589956",
               "e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f",
               "02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60",
               "e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f",
               "ffa8aee6d8b251b21d7744980196fb556ca7e4247aa7017d5e7ee7d498d50c4d",
               "02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60",
               "976373ee09d6cb298ac802b46002c9dfbd30f1bf0988f840a74285ee409c6d5d",
               "023f1d06be341eb26c365706a9113f9f23087aaf4df6cc17d12ec935a7a1a0cc",
               "839ef38f0ed23a9dcca4f0a807e205f95e26370f35ec9ea9915721c06eda04f2",
               "88e697f93ea94d74a1979af662339e826d784337e0abdb74f27e9293d94e9fed",
               "f7c7a89503959800005bfe6767f189e49c9c76aeea38d6f304f7be2d8663d204",
               "55c5203db4d44d96f4124c60e69ae0823f4372efa4b5416675d9564a83d6ad2c",
               "afb45186ad4f4217c2fc1dfc2239ff5ab016ef0ba5fc329bc6aa8fd10c7ecc88") and

  not (process.name : "cmd.exe" and
       process.parent.executable : ("?:\\Users\\*\\AppData\\Local\\Programs\\GoLogin\\GoLogin.exe",
                                    "C:\\Users\\*\\AppData\\Local\\PDFProSuite\\pdfprosuite.exe")) and

  not (process.executable : "?:\\Windows\\SysWOW64\\cmd.exe" and process.parent.name : "node.exe" and
       process.parent.args : ("--check-update", "update.js"))
  ] by process.entity_id
 [process where event.action == "start" and process.command_line : "*--load-extension*"] by process.parent.entity_id
'''

min_endpoint_version = "8.4.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 = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1176"
name = "Software Extensions"
reference = "https://attack.mitre.org/techniques/T1176/"
[[threat.technique.subtechnique]]
id = "T1176.001"
name = "Browser Extensions"
reference = "https://attack.mitre.org/techniques/T1176/001/"



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and process.parent.executable != null and
  (
   (process.Ext.relative_file_creation_time <= 600 or process.Ext.relative_file_name_modify_time <= 600) or
   process.executable : ("?:\\Users\\*\\AppData\\*", "?:\\Users\\Public\\*", "?:\\ProgramData\\*", "?:\\Windows\\Microsoft.Net\\*") or
   process.name in~ ("wscript.exe", "cscript.exe", "mshta.exe", "powershell.exe", "regsvr32.exe", "rundll32.exe", "cmd.exe")
  ) and
  not (process.code_signature.subject_name :
               ("Cypress.io, Inc.", "PortSwigger Ltd", "Scalehat Technologies Ltd", "Azul Systems, Inc.", "JetBrains s.r.o.",
                "Katalon Inc.", "Shenzhen Love Sense Technology Co., Ltd.") and
       process.code_signature.trusted == true) and

  not process.hash.sha256 :
              ("a064743886dc4068db7e4143a2eba14d1cdf80f5dd28d8057c6087a30ca7f3b4",
               "7d95b4e26859620738a31dbbafbf019da42f2378821e2bb49b748956ef50b3e3",
               "fcc098d6a5df5a302c4fc635203bf28868a92d2469465551f6cf7e5c93a1719a",
               "e4244190024bdd0ffed267b47f897cca054a4762c76b93cb34ae2d7925589956",
               "e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f",
               "02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60",
               "e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f",
               "ffa8aee6d8b251b21d7744980196fb556ca7e4247aa7017d5e7ee7d498d50c4d",
               "02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60",
               "976373ee09d6cb298ac802b46002c9dfbd30f1bf0988f840a74285ee409c6d5d",
               "023f1d06be341eb26c365706a9113f9f23087aaf4df6cc17d12ec935a7a1a0cc",
               "839ef38f0ed23a9dcca4f0a807e205f95e26370f35ec9ea9915721c06eda04f2",
               "88e697f93ea94d74a1979af662339e826d784337e0abdb74f27e9293d94e9fed",
               "f7c7a89503959800005bfe6767f189e49c9c76aeea38d6f304f7be2d8663d204",
               "55c5203db4d44d96f4124c60e69ae0823f4372efa4b5416675d9564a83d6ad2c",
               "afb45186ad4f4217c2fc1dfc2239ff5ab016ef0ba5fc329bc6aa8fd10c7ecc88") and

  not (process.name : "cmd.exe" and
       process.parent.executable : ("?:\\Users\\*\\AppData\\Local\\Programs\\GoLogin\\GoLogin.exe",
                                    "C:\\Users\\*\\AppData\\Local\\PDFProSuite\\pdfprosuite.exe")) and

  not (process.executable : "?:\\Windows\\SysWOW64\\cmd.exe" and process.parent.name : "node.exe" and
       process.parent.args : ("--check-update", "update.js"))
  ] by process.entity_id

Stage 2: process

[process where event.action == "start" and process.command_line : "*--load-extension*"] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.relative_file_creation_timele
  • 600 transforms: number corpus 3 (elastic 3)
field:"process.Ext.relative_file_creation_time" kind:le value:"600"
process.Ext.relative_file_name_modify_timele
  • 600 transforms: number
field:"process.Ext.relative_file_name_modify_time" kind:le value:"600"
process.command_linewildcard
  • *--load-extension* corpus 2 (elastic 1, splunk 1)
field:"CommandLine" kind:wildcard value:"*--load-extension*"
process.executablewildcard
  • ?:\ProgramData\* corpus 18 (elastic 18)
  • ?:\Users\*\AppData\* corpus 12 (elastic 12)
  • ?:\Users\Public\* corpus 22 (elastic 22)
  • ?:\Windows\Microsoft.Net\* corpus 11 (elastic 11)
field:"Image" kind:wildcard
process.namein
  • cmd.exe corpus 24 (splunk 17, elastic 6, kusto 1)
  • cscript.exe corpus 24 (splunk 16, elastic 8)
  • mshta.exe corpus 27 (splunk 15, elastic 12)
  • powershell.exe corpus 31 (splunk 19, elastic 11, kusto 1)
  • regsvr32.exe corpus 14 (splunk 10, elastic 4)
  • rundll32.exe corpus 17 (splunk 12, elastic 5)
  • wscript.exe corpus 28 (elastic 14, splunk 14)
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.code_signature.subject_nameeqCypress.io, Inc., PortSwigger Ltd, Scalehat Technologies Ltd, Azul Systems, Inc., JetBrains s.r.o., Katalon Inc., Shenzhen Love Sense Technology Co., Ltd.excludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeq?:\Windows\SysWOW64\cmd.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\SysWOW64\cmd.exe"
process.parent.argseq--check-update, update.jsexcludes:process.parent.args field:"process.parent.args" value:"--check-update" field:"process.parent.args" value:"update.js"
process.parent.nameeqnode.exeexcludes:process.parent.name field:"process.parent.name" value:"node.exe"
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.parent.executablewildcard?:\Users\*\AppData\Local\Programs\GoLogin\GoLogin.exe, C:\Users\*\AppData\Local\PDFProSuite\pdfprosuite.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Programs\GoLogin\GoLogin.exe" field:"process.parent.executable" value:"C:\Users\*\AppData\Local\PDFProSuite\pdfprosuite.exe"
process.hash.sha256eqa064743886dc4068db7e4143a2eba14d1cdf80f5dd28d8057c6087a30ca7f3b4, 7d95b4e26859620738a31dbbafbf019da42f2378821e2bb49b748956ef50b3e3, fcc098d6a5df5a302c4fc635203bf28868a92d2469465551f6cf7e5c93a1719a, e4244190024bdd0ffed267b47f897cca054a4762c76b93cb34ae2d7925589956, e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f, 02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60, e309416c7ec1606899e646b54ff8ac15a42925e2cfb8b0cd5d455b208846671f, ffa8aee6d8b251b21d7744980196fb556ca7e4247aa7017d5e7ee7d498d50c4d, 02901bc79c262a6e0c9f8c62682c9165e50ed0027ff54011de949c3a510bbd60, 976373ee09d6cb298ac802b46002c9dfbd30f1bf0988f840a74285ee409c6d5d, 023f1d06be341eb26c365706a9113f9f23087aaf4df6cc17d12ec935a7a1a0cc, 839ef38f0ed23a9dcca4f0a807e205f95e26370f35ec9ea9915721c06eda04f2, 88e697f93ea94d74a1979af662339e826d784337e0abdb74f27e9293d94e9fed, f7c7a89503959800005bfe6767f189e49c9c76aeea38d6f304f7be2d8663d204, 55c5203db4d44d96f4124c60e69ae0823f4372efa4b5416675d9564a83d6ad2c, afb45186ad4f4217c2fc1dfc2239ff5ab016ef0ba5fc329bc6aa8fd10c7ecc88excludes:process.hash.sha256

Chroot Execution in Container Context on Linux

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

Detects chroot execution on Linux when the process appears to run in a container-oriented context: the process title matches runc init, the entry leader is a container workload, or the parent process is runc. Chroot from inside a container can pivot to an alternate root filesystem and is a common step in container breakout attempts when combined with sensitive host mounts.

Known False Positives

  • Build and packaging images sometimes run chroot against a staged root filesystem inside CI or init containers; correlate with approved pipelines and image build jobs before escalating.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[metadata]
creation_date = "2026/04/27"
integration = ["endpoint", "auditd_manager"]
maturity = "production"
updated_date = "2026/07/17"

[rule]
author = ["Elastic"]
description = """
Detects chroot execution on Linux when the process appears to run in a container-oriented context: the process title
matches runc init, the entry leader is a container workload, or the parent process is runc. Chroot from inside a
container can pivot to an alternate root filesystem and is a common step in container breakout attempts when combined
with sensitive host mounts.
"""
false_positives = [
    """
    Build and packaging images sometimes run chroot against a staged root filesystem inside CI or init containers;
    correlate with approved pipelines and image build jobs before escalating.
    """,
]
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*", "logs-endpoint.events.process*"]
language = "kuery"
license = "Elastic License v2"
name = "Chroot Execution in Container Context on Linux"
note = """## Triage and analysis

### Investigating Chroot Execution in Container Context on Linux

This alert is the host-process analogue to Defend for Containers chroot coverage: it keys on chroot binaries or
arguments plus signals that the execution is tied to a container runtime (runc parent, runc init title, or Elastic
Defend container session metadata). Review the command line for the target root path, especially host-linked mounts such
as `/host`, `/proc/1/root`, or unexpected node paths.

### Possible investigation steps

- Confirm whether the workload was expected to use chroot and whether the target directory is an internal build root
  versus a host filesystem mount.
- For Elastic Defend events, use session and entry leader context to map the pod or container image; for Auditd
  Manager events, pivot on `process.parent` and nearby syscall activity on the same host.
- Hunt for follow-on shell execution, access to the container runtime socket, or kubelet credential paths.

### False positive analysis

- Legitimate image builds and package installs may chroot into a prepared rootfs; tune by parent process, user, or CI
  agent identity when noise is high.

### Response and remediation

- If unauthorized, isolate the workload and node, preserve artifacts, and rotate credentials exposed to the container.
"""
references = [
    "https://some-natalie.dev/container-escapes-chroot/",
    "https://attack.mitre.org/techniques/T1611/",
]
risk_score = 73
rule_id = "9056d577-4da5-47bf-8c94-6c0b1bb3f8a5"
setup = """## Setup

This rule requires process execution telemetry from Elastic Defend and/or Auditd Manager on Linux.

### 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 to select "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).

### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.

#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Auditd Manager" and select the integration to see more details about it.
- Click "Add Auditd Manager".
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed "auditd manager" to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click "Save and Continue".
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).

#### Rule Specific Setup Note
Ensure execve (or equivalent process) auditing is enabled so `event.category:process` and process fields populate for
chroot invocations. Container-context clauses that rely on `process.entry_leader` or `process.title` are primarily
populated on Elastic Defend; Auditd Manager match when `process.title` matches on container runc.
"""
severity = "high"
tags = [
    "Data Source: Auditd Manager",
    "Data Source: Elastic Defend",
    "Domain: Container",
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
host.os.type:linux and event.category:process and 
event.type:start and event.action:(executed or exec) and 
(process.name:"chroot" or process.args:("chroot" or "/bin/chroot" or "/usr/bin/chroot" or "/usr/local/bin/chroot")) and 
(process.title:"runc init" or process.entry_leader.entry_meta.type:"container" or process.parent.name:("runc" or "containerd-shim-runc-v2")) and
not process.args:(apt-get or add-apt-repository or apt-cache* or */var/lib/rancher/agent/tmp* or dpkg)
'''

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

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

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

Stages and Predicates

Stage 1: query

host.os.type:linux and event.category:process and 
event.type:start and event.action:(executed or exec) and 
(process.name:"chroot" or process.args:("chroot" or "/bin/chroot" or "/usr/bin/chroot" or "/usr/local/bin/chroot")) and 
(process.title:"runc init" or process.entry_leader.entry_meta.type:"container" or process.parent.name:("runc" or "containerd-shim-runc-v2")) and
not process.args:(apt-get or add-apt-repository or apt-cache* or */var/lib/rancher/agent/tmp* or dpkg)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Decoded Payload Piped to Interpreter

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

This rule identifies when a decoded payload is piped to an interpreter. Malware authors may attempt to evade detection by encoding and obfuscating their payload.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule identifies when a decoded payload is piped to an interpreter. Malware authors may attempt to evade detection
by encoding and obfuscating their payload.
"""
id = "452d6452-a8ec-4cae-9720-567fb44d93b7"
license = "Elastic License v2"
name = "Decoded Payload Piped to Interpreter"
os_list = ["linux"]
version = "1.0.10"

query = '''
sequence by process.parent.entity_id, process.working_directory with maxspan=1s
  [process where event.type == "start" and event.action == "exec" and (
    (
      process.name in ("base64", "basez", "base64plain", "base64url", "base64mime", "base64pem", "basenc", "base32", "base16") and
      process.command_line like~ ("* -d*", "* --decode*")
    ) or
    (
      process.name == "openssl" and
      process.args == "enc" and process.args in ("-d", "-base64", "-a", "-A")
    ) or
    (
      process.name like "python*" and (
        (process.args == "base64" and process.args in ("-d", "-u", "-t")) or
        (process.args == "-c" and process.args like "*base64*" and process.command_line like~ "*b64decode*")
      )
    ) or
    (
      process.name like "perl*" and
      process.command_line like~ "*decode_base64*"
    ) or
    (
      process.name like "ruby*" and
      process.args == "-e" and
      process.command_line like~ "*Base64.decode64*"
    ) or
    (
      process.name like~ "java*" and
      process.command_line like~ "*base64*decode(*"
    ) or
    (
      process.name like~ "lua*" and
      process.command_line like~ ("*mime.decode(*base64*", "*mime.unb64(*")
    ) or
    (
      process.name in ("node", "deno") and
      (
        process.command_line like~ ("*atob(*", "*eval(*") or
        (
          process.command_line like~ "*buffer.from*" and
          process.command_line like~ "*base64*"
        )
      )
    ) or
    (
      process.name == "pwsh" and
      process.command_line like~ (
        "* -e *", "* -en *", "* -enc *", "* -enco *", "* -encod *", "* -encode *", "* -encoded *",
        "* -encodedcommand *", "*frombase64string*"
      )
    ) or
    (
      process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
      process.command_line like~ ("*base64 -d*", "*base64 --decode*")
    )
  ) and
  not (
    process.parent.command_line like "*DAAAAAtAAAAOQAAAF0AAAArAAAAJAAAACAAAABdAAAAXQAAACAAAAAmAAAAJgAAACAAAABbAAAAIAAAACIAAAAkAAAAcwAAAGkAAABnAAAAbgAAAGEAAAB0AAAAdQAAAHIAAABlAAAAIgAAACAAAAAtAAAAZQAAAHEAAAAgAAAAMgAAADAAAAAwAAAAMgAAADAAAAA5AAAAIAAAAF0AAAA7AAAAIAAAAHQAAABoAAAAZQAAAG4AAAA*" or
    process.command_line like "/bin/bash -c base64 -d <<< IwAAAC*" or
    (
      process.parent.executable like "/var/lib/amazon/ssm/i-*/document/orchestration/*_script.sh" and
      process.working_directory == "/usr/bin" and
      process.command_line == "base64 --decode"
    ) or
    (
      process.working_directory like "/var/snap/amazon-ssm-agent/*" and
      process.parent.args like "/var/lib/amazon/ssm/*/document/orchestration/*/_script.sh" and
      process.name == "base64"
    ) or
    process.working_directory in ("/opt/SolarWinds/Agent/bin/Plugins/ADMProbe", "/root/control-center-packaging") or
    process.parent.executable in ("/usr/share/windsurf/windsurf", "/usr/share/cursor/cursor", "/usr/share/devin-desktop/devin-desktop") or
    process.parent.command_line like ("claude", "*__CURSOR_SANDBOX_ENV_RESTORE*") or
    (
      process.command_line like~ ("*eval*1337*SendConductor*", "*eval*KITTY_SSH_KITTEN_DATA_DIR*") and
      process.parent.name in ("sshd", "sshd-session")
    ) or
    process.command_line like "/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg*" or
    (
      process.parent.command_line like (
        "/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg*",
        "/bin/bash -c base64 -d <<< IwAAACEAAAAvAAAAYgAAAGkAAABuAAAAL*"
      ) and
      process.command_line == "base64 -d"
    ) or
    (process.working_directory like "/home/u.*" and process.parent.command_line like "bash -lc printf %s*") or 
    (process.working_directory == "/opt/Elastic/Endpoint/state/response_actions" and process.command_line == "base64 -d") or
    (process.working_directory == "/home/deploy" and user.name == "deploy" and process.parent.args == "bash") or
    process.entry_leader.executable == "/usr/sbin/qemu-ga"
  )]
  [process where event.type == "start" and event.action == "exec" and process.name like (
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "python*", "perl*", "ruby*", "lua*", "php*", "node", "pwsh", "deno"
  ) and process.args_count == 1 and
  process.args like (
    "-bash", "-dash", "-sh", "-tcsh", "-csh", "-zsh", "-ksh", "-fish",
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh", "/bin/csh",
    "/bin/zsh", "/bin/ksh", "/bin/fish",
    "/usr/bin/bash", "/usr/bin/dash", "/usr/bin/sh", "/usr/bin/tcsh",
    "/usr/bin/csh", "/usr/bin/zsh", "/usr/bin/ksh", "/usr/bin/fish",
    "python*", "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
    "perl*", "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
    "ruby*", "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
    "lua*", "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
    "php*", "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
    "node", "/bin/node", "/usr/bin/node", "/usr/local/bin/node",
    "pwsh", "/bin/pwsh", "/usr/bin/pwsh", "/usr/local/bin/pwsh",
    "deno", "/bin/deno", "/usr/bin/deno", "/usr/local/bin/deno",
    "/dev/fd/*"
  ) and
  not (
    process.parent.command_line in ("bash ./run_tests.sh unit-integration", "/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure") or
    process.command_line == "/usr/bin/perl /usr/bin/shasum -a 256" or
    process.working_directory like (
      "/usr/local/zeek", "/opt/zeek", "/var/lib/docker/overlay2/*/opt/zeek", "/usr/local/zeek_old_install",
      "/var/lib/docker/overlay2/*/usr/local/zeek", "/proc/self/fd/*/usr/local/zeek"
    ) or
    (process.parent.name == "zsh" and process.parent.command_line like "*extendedglob*") or
    (process.name like "python*" and process.parent.name like "python*")
  )]
'''

min_endpoint_version = "8.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.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.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"

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


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

[internal]
min_endpoint_version = "8.3.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and (
    (
      process.name in ("base64", "basez", "base64plain", "base64url", "base64mime", "base64pem", "basenc", "base32", "base16") and
      process.command_line like~ ("* -d*", "* --decode*")
    ) or
    (
      process.name == "openssl" and
      process.args == "enc" and process.args in ("-d", "-base64", "-a", "-A")
    ) or
    (
      process.name like "python*" and (
        (process.args == "base64" and process.args in ("-d", "-u", "-t")) or
        (process.args == "-c" and process.args like "*base64*" and process.command_line like~ "*b64decode*")
      )
    ) or
    (
      process.name like "perl*" and
      process.command_line like~ "*decode_base64*"
    ) or
    (
      process.name like "ruby*" and
      process.args == "-e" and
      process.command_line like~ "*Base64.decode64*"
    ) or
    (
      process.name like~ "java*" and
      process.command_line like~ "*base64*decode(*"
    ) or
    (
      process.name like~ "lua*" and
      process.command_line like~ ("*mime.decode(*base64*", "*mime.unb64(*")
    ) or
    (
      process.name in ("node", "deno") and
      (
        process.command_line like~ ("*atob(*", "*eval(*") or
        (
          process.command_line like~ "*buffer.from*" and
          process.command_line like~ "*base64*"
        )
      )
    ) or
    (
      process.name == "pwsh" and
      process.command_line like~ (
        "* -e *", "* -en *", "* -enc *", "* -enco *", "* -encod *", "* -encode *", "* -encoded *",
        "* -encodedcommand *", "*frombase64string*"
      )
    ) or
    (
      process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
      process.command_line like~ ("*base64 -d*", "*base64 --decode*")
    )
  ) and
  not (
    process.parent.command_line like "*DAAAAAtAAAAOQAAAF0AAAArAAAAJAAAACAAAABdAAAAXQAAACAAAAAmAAAAJgAAACAAAABbAAAAIAAAACIAAAAkAAAAcwAAAGkAAABnAAAAbgAAAGEAAAB0AAAAdQAAAHIAAABlAAAAIgAAACAAAAAtAAAAZQAAAHEAAAAgAAAAMgAAADAAAAAwAAAAMgAAADAAAAA5AAAAIAAAAF0AAAA7AAAAIAAAAHQAAABoAAAAZQAAAG4AAAA*" or
    process.command_line like "/bin/bash -c base64 -d <<< IwAAAC*" or
    (
      process.parent.executable like "/var/lib/amazon/ssm/i-*/document/orchestration/*_script.sh" and
      process.working_directory == "/usr/bin" and
      process.command_line == "base64 --decode"
    ) or
    (
      process.working_directory like "/var/snap/amazon-ssm-agent/*" and
      process.parent.args like "/var/lib/amazon/ssm/*/document/orchestration/*/_script.sh" and
      process.name == "base64"
    ) or
    process.working_directory in ("/opt/SolarWinds/Agent/bin/Plugins/ADMProbe", "/root/control-center-packaging") or
    process.parent.executable in ("/usr/share/windsurf/windsurf", "/usr/share/cursor/cursor", "/usr/share/devin-desktop/devin-desktop") or
    process.parent.command_line like ("claude", "*__CURSOR_SANDBOX_ENV_RESTORE*") or
    (
      process.command_line like~ ("*eval*1337*SendConductor*", "*eval*KITTY_SSH_KITTEN_DATA_DIR*") and
      process.parent.name in ("sshd", "sshd-session")
    ) or
    process.command_line like "/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg*" or
    (
      process.parent.command_line like (
        "/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg*",
        "/bin/bash -c base64 -d <<< IwAAACEAAAAvAAAAYgAAAGkAAABuAAAAL*"
      ) and
      process.command_line == "base64 -d"
    ) or
    (process.working_directory like "/home/u.*" and process.parent.command_line like "bash -lc printf %s*") or 
    (process.working_directory == "/opt/Elastic/Endpoint/state/response_actions" and process.command_line == "base64 -d") or
    (process.working_directory == "/home/deploy" and user.name == "deploy" and process.parent.args == "bash") or
    process.entry_leader.executable == "/usr/sbin/qemu-ga"
  )]

Stage 2: process

[process where event.type == "start" and event.action == "exec" and process.name like (
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "python*", "perl*", "ruby*", "lua*", "php*", "node", "pwsh", "deno"
  ) and process.args_count == 1 and
  process.args like (
    "-bash", "-dash", "-sh", "-tcsh", "-csh", "-zsh", "-ksh", "-fish",
    "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh", "/bin/csh",
    "/bin/zsh", "/bin/ksh", "/bin/fish",
    "/usr/bin/bash", "/usr/bin/dash", "/usr/bin/sh", "/usr/bin/tcsh",
    "/usr/bin/csh", "/usr/bin/zsh", "/usr/bin/ksh", "/usr/bin/fish",
    "python*", "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
    "perl*", "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
    "ruby*", "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
    "lua*", "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
    "php*", "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
    "node", "/bin/node", "/usr/bin/node", "/usr/local/bin/node",
    "pwsh", "/bin/pwsh", "/usr/bin/pwsh", "/usr/local/bin/pwsh",
    "deno", "/bin/deno", "/usr/bin/deno", "/usr/local/bin/deno",
    "/dev/fd/*"
  ) and
  not (
    process.parent.command_line in ("bash ./run_tests.sh unit-integration", "/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure") or
    process.command_line == "/usr/bin/perl /usr/bin/shasum -a 256" or
    process.working_directory like (
      "/usr/local/zeek", "/opt/zeek", "/var/lib/docker/overlay2/*/opt/zeek", "/usr/local/zeek_old_install",
      "/var/lib/docker/overlay2/*/usr/local/zeek", "/proc/self/fd/*/usr/local/zeek"
    ) or
    (process.parent.name == "zsh" and process.parent.command_line like "*extendedglob*") or
    (process.name like "python*" and process.parent.name like "python*")
  )]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • -c
  • -e
  • base64
  • enc
field:"process.args" kind:eq
process.argsin
  • -A
  • -a
  • -base64
  • -d
  • -t
  • -u
field:"process.args" kind:in
process.argswildcard
  • *base64*
  • -bash
  • -csh
  • -dash
  • -fish
  • -ksh
  • -sh
  • -tcsh
  • -zsh
  • /bin/bash
  • /bin/csh
  • /bin/dash
  • /bin/deno
  • /bin/fish
  • /bin/ksh
  • /bin/lua*
  • /bin/node
  • /bin/perl*
  • /bin/php*
  • /bin/pwsh
  • /bin/python*
  • /bin/ruby*
  • /bin/sh
  • /bin/tcsh
  • /bin/zsh
  • /dev/fd/*
  • /usr/bin/bash
  • /usr/bin/csh
  • /usr/bin/dash
  • /usr/bin/deno
  • /usr/bin/fish
  • /usr/bin/ksh
  • /usr/bin/lua*
  • /usr/bin/node
  • /usr/bin/perl*
  • /usr/bin/php*
  • /usr/bin/pwsh
  • /usr/bin/python*
  • /usr/bin/ruby*
  • /usr/bin/sh
  • +26 more values (see full rule source)
field:"process.args" kind:wildcard
process.args_counteq
  • 1 transforms: number
field:"process.args_count" kind:eq value:"1"
process.command_linewildcard
  • * --decode*
  • * -d*
  • * -e *
  • * -en *
  • * -enc *
  • * -enco *
  • * -encod *
  • * -encode *
  • * -encoded *
  • * -encodedcommand *
  • *Base64.decode64*
  • *atob(*
  • *b64decode*
  • *base64 --decode*
  • *base64 -d*
  • *base64*
  • *base64*decode(*
  • *buffer.from*
  • *decode_base64*
  • *eval(*
  • *frombase64string*
  • *mime.decode(*base64*
  • *mime.unb64(*
field:"CommandLine" kind:wildcard
process.nameeq
  • openssl
  • pwsh
field:"process_basename" kind:eq
process.namein
  • base16
  • base32
  • base64
  • base64mime
  • base64pem
  • base64plain
  • base64url
  • basenc
  • basez
  • bash
  • busybox
  • csh
  • dash
  • deno
  • fish
  • ksh
  • node
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • bash
  • csh
  • dash
  • deno
  • fish
  • java*
  • ksh
  • lua*
  • lua*
  • node
  • perl*
  • perl*
  • php*
  • pwsh
  • python*
  • python*
  • ruby*
  • ruby*
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_lineeqbase64 --decodeexcludes:process.command_line field:"process.command_line" value:"base64 --decode"
process.parent.executablewildcard/var/lib/amazon/ssm/i-*/document/orchestration/*_script.shexcludes:process.parent.executable field:"process.parent.executable" value:"/var/lib/amazon/ssm/i-*/document/orchestration/*_script.sh"
process.working_directoryeq/usr/binexcludes:process.working_directory field:"process.working_directory" value:"/usr/bin"
process.command_lineeqbase64 -dexcludes:process.command_line field:"process.command_line" value:"base64 -d"
process.parent.command_linestarts_with/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg, /bin/bash -c base64 -d <<< IwAAACEAAAAvAAAAYgAAAGkAAABuAAAALexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg" field:"process.parent.command_line" value:"/bin/bash -c base64 -d <<< IwAAACEAAAAvAAAAYgAAAGkAAABuAAAAL"
process.working_directoryeq/opt/Elastic/Endpoint/state/response_actionsexcludes:process.working_directory field:"process.working_directory" value:"/opt/Elastic/Endpoint/state/response_actions"
process.command_linewildcard*eval*1337*SendConductor*, *eval*KITTY_SSH_KITTEN_DATA_DIR*excludes:process.command_line field:"process.command_line" value:"*eval*1337*SendConductor*" field:"process.command_line" value:"*eval*KITTY_SSH_KITTEN_DATA_DIR*"
process.parent.nameinsshd, sshd-sessionexcludes:process.parent.name field:"process.parent.name" value:"sshd" field:"process.parent.name" value:"sshd-session"
process.nameeqbase64excludes:process.name field:"process.name" value:"base64"
process.parent.argswildcard/var/lib/amazon/ssm/*/document/orchestration/*/_script.shexcludes:process.parent.args field:"process.parent.args" value:"/var/lib/amazon/ssm/*/document/orchestration/*/_script.sh"
process.working_directorystarts_with/var/snap/amazon-ssm-agent/excludes:process.working_directory field:"process.working_directory" value:"/var/snap/amazon-ssm-agent/"
process.parent.argseqbashexcludes:process.parent.args field:"process.parent.args" value:"bash"
process.working_directoryeq/home/deployexcludes:process.working_directory field:"process.working_directory" value:"/home/deploy"
user.nameeqdeployexcludes:user.name field:"user.name" value:"deploy"
process.parent.command_linestarts_withbash -lc printf %sexcludes:process.parent.command_line field:"process.parent.command_line" value:"bash -lc printf %s"
process.working_directorystarts_with/home/u.excludes:process.working_directory field:"process.working_directory" value:"/home/u."
process.command_linestarts_with/bin/bash -c base64 -d <<< IwAAACexcludes:process.command_line field:"process.command_line" value:"/bin/bash -c base64 -d <<< IwAAAC"
process.command_linestarts_with/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGgexcludes:process.command_line field:"process.command_line" value:"/bin/bash -c base64 -d <<< IwAAACAAAABHAAAAZQAAAHQAAAAgAAAAdAAAAGg"
process.entry_leader.executableeq/usr/sbin/qemu-gaexcludes:process.entry_leader.executable field:"process.entry_leader.executable" value:"/usr/sbin/qemu-ga"
process.parent.command_linematchDAAAAAtAAAAOQAAAF0AAAArAAAAJAAAACAAAABdAAAAXQAAACAAAAAmAAAAJgAAACAAAABbAAAAIAAAACIAAAAkAAAAcwAAAGkAAABnAAAAbgAAAGEAAAB0AAAAdQAAAHIAAABlAAAAIgAAACAAAAAtAAAAZQAAAHEAAAAgAAAAMgAAADAAAAAwAAAAMgAAADAAAAA5AAAAIAAAAF0AAAA7AAAAIAAAAHQAAABoAAAAZQAAAG4AAAAexcludes:process.parent.command_line field:"process.parent.command_line" value:"DAAAAAtAAAAOQAAAF0AAAArAAAAJAAAACAAAABdAAAAXQAAACAAAAAmAAAAJgAAACAAAABbAAAAIAAAACIAAAAkAAAAcwAAAGkAAABnAAAAbgAAAGEAAAB0AAAAdQAAAHIAAABlAAAAIgAAACAAAAAtAAAAZQAAAHEAAAAgAAAAMgAAADAAAAAwAAAAMgAAADAAAAA5AAAAIAAAAF0AAAA7AAAAIAAAAHQAAABoAAAAZQAAAG4AAAA"
process.parent.command_linewildcardclaude, *__CURSOR_SANDBOX_ENV_RESTORE*excludes:process.parent.command_line field:"process.parent.command_line" value:"claude" field:"process.parent.command_line" value:"*__CURSOR_SANDBOX_ENV_RESTORE*"
process.parent.executablein/usr/share/cursor/cursor, /usr/share/devin-desktop/devin-desktop, /usr/share/windsurf/windsurfexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/share/cursor/cursor" field:"process.parent.executable" value:"/usr/share/devin-desktop/devin-desktop" field:"process.parent.executable" value:"/usr/share/windsurf/windsurf"
process.working_directoryin/opt/SolarWinds/Agent/bin/Plugins/ADMProbe, /root/control-center-packagingexcludes:process.working_directory field:"process.working_directory" value:"/opt/SolarWinds/Agent/bin/Plugins/ADMProbe" field:"process.working_directory" value:"/root/control-center-packaging"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.parent.namestarts_withpythonexcludes:process.parent.name field:"process.parent.name" value:"python"
process.parent.command_linematchextendedglobexcludes:process.parent.command_line field:"process.parent.command_line" value:"extendedglob"
process.parent.nameeqzshexcludes:process.parent.name field:"process.parent.name" value:"zsh"
process.command_lineeq/usr/bin/perl /usr/bin/shasum -a 256excludes:process.command_line field:"process.command_line" value:"/usr/bin/perl /usr/bin/shasum -a 256"
process.parent.command_linein/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure, bash ./run_tests.sh unit-integrationexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/sh /var/lib/dpkg/info/nmap-common.postinst configure" field:"process.parent.command_line" value:"bash ./run_tests.sh unit-integration"
process.working_directorywildcard/usr/local/zeek, /opt/zeek, /var/lib/docker/overlay2/*/opt/zeek, /usr/local/zeek_old_install, /var/lib/docker/overlay2/*/usr/local/zeek, /proc/self/fd/*/usr/local/zeekexcludes:process.working_directory

Deletion of Shell History File

#
Source
github.com/elastic/protections-artifacts

Detects the deletion of shell history files through suspicious or commonly available tooling via a file deletion event. Shell history files are used to store the command history of a user. Adversaries may attempt to delete these files to remove evidence of their activity.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects the deletion of shell history files through suspicious or commonly available tooling via a file deletion event.
Shell history files are used to store the command history of a user. Adversaries may attempt to delete these files to
remove evidence of their activity.
"""
id = "e2e24fba-2852-4e3c-be8d-fda553653522"
license = "Elastic License v2"
name = "Deletion of Shell History File"
os_list = ["linux"]
version = "1.0.2"

query = '''
file where event.type == "deletion" and file.name in (
  ".bash_history", ".zsh_history", ".sh_history", ".ksh_history",
  ".history", ".csh_history", ".tcsh_history", "fish_history", ".ash_history"
) and
/* Enforce non-backup home & root directories to prevent false positives */
(
  file.path like ("/home/*/*", "/root/*", "/etc/*") and
  not file.path like ("/home/*/*/*", "/root/*/*")
) and
(
  process.name in (
    "rm", "sudo", "truncate", "unlink", "find", "xargs", "install", "shred", "vi", "vim",
    "vim.basic", "coreutils", "tar", "gzip", "bzip2", "rmdir", "mv", "cp", "ln", "busybox",
    "bash", "zsh", "sh", "tcsh", "csh", "ksh", "fish"
  ) or
  process.name like ".*" or
  process.executable like (
    "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*", "/home/*"
  )
)
'''

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 = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.003"
name = "Clear Command History"
reference = "https://attack.mitre.org/techniques/T1070/003/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: file

file where event.type == "deletion" and file.name in (
  ".bash_history", ".zsh_history", ".sh_history", ".ksh_history",
  ".history", ".csh_history", ".tcsh_history", "fish_history", ".ash_history"
) and
(
  file.path like ("/home/*/*", "/root/*", "/etc/*") and
  not file.path like ("/home/*/*/*", "/root/*/*")
) and
(
  process.name in (
    "rm", "sudo", "truncate", "unlink", "find", "xargs", "install", "shred", "vi", "vim",
    "vim.basic", "coreutils", "tar", "gzip", "bzip2", "rmdir", "mv", "cp", "ln", "busybox",
    "bash", "zsh", "sh", "tcsh", "csh", "ksh", "fish"
  ) or
  process.name like ".*" or
  process.executable like (
    "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*", "/home/*"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • deletion
field:"event.type" kind:eq value:"deletion"
file.namein
  • .ash_history
  • .bash_history
  • .csh_history
  • .history
  • .ksh_history
  • .sh_history
  • .tcsh_history
  • .zsh_history
  • fish_history
field:"file.name" kind:in
file.pathwildcard
  • /etc/*
  • /home/*/*
  • /root/*
field:"TargetFilename" kind:wildcard
process.executablewildcard
  • ./*
  • /boot/*
  • /dev/shm/*
  • /home/*
  • /lost+found/*
  • /proc/*
  • /root/*
  • /run/*
  • /sys/*
  • /tmp/*
  • /var/mail/*
  • /var/run/*
  • /var/tmp/*
  • /var/www/*
field:"Image" kind:wildcard
process.namein
  • bash
  • busybox
  • bzip2
  • coreutils
  • cp
  • csh
  • find
  • fish
  • gzip
  • install
  • ksh
  • ln
  • mv
  • rm
  • rmdir
  • sh
  • shred
  • sudo
  • tar
  • tcsh
  • truncate
  • unlink
  • vi
  • vim
  • vim.basic
  • xargs
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
field:"process_basename" kind:wildcard value:".*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathwildcard/home/*/*/*, /root/*/*excludes:file.path field:"file.path" value:"/home/*/*/*" field:"file.path" value:"/root/*/*"

DLL Loaded from a Macro Enabled Document

#
Source
github.com/elastic/protections-artifacts

Identifies when a Microsoft Office process loads a DLL and from a call stack pointing to Microsoft Office Visual Basic for Applications modules. This may indicate an attempt to get initial access using malicious macro enabled documents.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[rule]
description = """
Identifies when a Microsoft Office process loads a DLL and from a call stack pointing to Microsoft Office Visual Basic
for Applications modules. This may indicate an attempt to get initial access using malicious macro enabled documents.
"""
id = "9ebda43a-16dd-4d9e-ab7c-c1056e7d959a"
license = "Elastic License v2"
name = "DLL Loaded from a Macro Enabled Document"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.24"

query = '''
library where
   process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "mspub.exe", "fltldr.exe", "visio.exe") and
   (
    /* VBA */
    process.thread.Ext.call_stack_summary : "*|vbe?.dll*" or

    /* Shellcode RWX  */
    (_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.protection : "RWX") and
     not process.thread.Ext.call_stack_summary : ("*|clr.dll|*", "*mscorwks.dll*", "*mscoreei.dll|mscoree.dll*", "*system.management.ni.dll*"))
   ) and

   /* Suspicious DLLs */
   (
    dll.name : "taskschd.dll" or
    dll.Ext.relative_file_creation_time <= 300 or
    ((dll.code_signature.trusted == false or dll.code_signature.exists == false) and not dll.path : ("?:\\Windows\\System32\\*", "?:\\Windows\\SysWOW64\\*"))
    ) and

    not dll.path :
           ("?:\\Windows\\assembly\\NativeImages_*.dll",
            "?:\\Windows\\System32\\spool\\drivers\\x64\\3\\*",
            "?:\\Program Files\\*",
            "?:\\Program Files (x86)\\*",
            "?:\\Windows\\Microsoft.NET\\Framework*", 
            "?:\\Windows\\system32\\scrrun.dll",
            "?:\\Windows\\syswow64\\scrrun.dll",
            "?:\\Windows\\SysWOW64\\THREED32.OCX",
            "C:\\blp\\*",
            "?:\\Windows\\System32\\DriverStore\\FileRepository\\*") and
    not dll.hash.sha256 :
                 ("a33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25",
                  "4579447a18f557ef95cad8df77634370dbe7ddeaed8d319ea6e7a26ac1e79db6",
                  "f1c4e834f96abc5d787bd3d4efea008537eb44fd3e3b6560f8cef4eace525a62",
                  "902553c9ffdc9e9751c6045b50590613183d4a7cc730365f7d629729a43fedcd",
                  "b80eca5b58d276be4d66bda65599e609efde2811de252172eeccea803826d41f",
                  "a33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25",
                  "f110d49ca78d0fe8ee0fa1824f7bb714359159e824a65a13f2fd5bb7d91b692a",
                  "90b3278ba2df87e4d61817adacf60f467359e0ff54dc793c0d5fdbc5fb087e59",
                  "2e531fdebdc3468c03922545ce169804400e3ebb577e08ec88a6561901d2c595",
                  "97c8afd6038b37729933ea0895760abe0a15b48258c46a04a0d010ed1ffa4e07",
                  "81fc25734e3876b34e287a1df17cb94483029534392fed50f0c629e40485660c",
                  "bd92610dd9504c6eef269b4c7b1bcaf9ebf28081bb81a82fc053035701182383",
                  "1e38e061ee5fcd4a76c591c24a39da005dc5fd58062ef8fadfe1ade95bfdbd4c",
                  "96c0caf8a7e7c087028c0793eb9a0ab21f7a4a7a5ca5c85a95ad1f4419a8186c",
                  "079cff190d73f4d1074844bf188588542cf3b52c22f775019fad113e0b63b14d",
                  "d661f1a025d99a98ebc6e42b3e69ae89379773821b2471ae138c4e55a5b63aa7",
                  "75e06078dd24506ffea81cf1615f5f9d9057abe2caf0067c396f20f3bea8b817",
                  "44185134b1f8c503c78e9dbc36891ba3fa109237c3dc79399955bf29e75921d4",
                  "9c2f359207114f5de82f080b08cbcfe723153b3f9c002c3f672a60e88c0d71b6")
'''

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

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

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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: library

library where
   process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "mspub.exe", "fltldr.exe", "visio.exe") and
   (
    process.thread.Ext.call_stack_summary : "*|vbe?.dll*" or
    (_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.protection : "RWX") and
     not process.thread.Ext.call_stack_summary : ("*|clr.dll|*", "*mscorwks.dll*", "*mscoreei.dll|mscoree.dll*", "*system.management.ni.dll*"))
   ) and
   (
    dll.name : "taskschd.dll" or
    dll.Ext.relative_file_creation_time <= 300 or
    ((dll.code_signature.trusted == false or dll.code_signature.exists == false) and not dll.path : ("?:\\Windows\\System32\\*", "?:\\Windows\\SysWOW64\\*"))
    ) and
    not dll.path :
           ("?:\\Windows\\assembly\\NativeImages_*.dll",
            "?:\\Windows\\System32\\spool\\drivers\\x64\\3\\*",
            "?:\\Program Files\\*",
            "?:\\Program Files (x86)\\*",
            "?:\\Windows\\Microsoft.NET\\Framework*",
            "?:\\Windows\\system32\\scrrun.dll",
            "?:\\Windows\\syswow64\\scrrun.dll",
            "?:\\Windows\\SysWOW64\\THREED32.OCX",
            "C:\\blp\\*",
            "?:\\Windows\\System32\\DriverStore\\FileRepository\\*") and
    not dll.hash.sha256 :
                 ("a33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25",
                  "4579447a18f557ef95cad8df77634370dbe7ddeaed8d319ea6e7a26ac1e79db6",
                  "f1c4e834f96abc5d787bd3d4efea008537eb44fd3e3b6560f8cef4eace525a62",
                  "902553c9ffdc9e9751c6045b50590613183d4a7cc730365f7d629729a43fedcd",
                  "b80eca5b58d276be4d66bda65599e609efde2811de252172eeccea803826d41f",
                  "a33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25",
                  "f110d49ca78d0fe8ee0fa1824f7bb714359159e824a65a13f2fd5bb7d91b692a",
                  "90b3278ba2df87e4d61817adacf60f467359e0ff54dc793c0d5fdbc5fb087e59",
                  "2e531fdebdc3468c03922545ce169804400e3ebb577e08ec88a6561901d2c595",
                  "97c8afd6038b37729933ea0895760abe0a15b48258c46a04a0d010ed1ffa4e07",
                  "81fc25734e3876b34e287a1df17cb94483029534392fed50f0c629e40485660c",
                  "bd92610dd9504c6eef269b4c7b1bcaf9ebf28081bb81a82fc053035701182383",
                  "1e38e061ee5fcd4a76c591c24a39da005dc5fd58062ef8fadfe1ade95bfdbd4c",
                  "96c0caf8a7e7c087028c0793eb9a0ab21f7a4a7a5ca5c85a95ad1f4419a8186c",
                  "079cff190d73f4d1074844bf188588542cf3b52c22f775019fad113e0b63b14d",
                  "d661f1a025d99a98ebc6e42b3e69ae89379773821b2471ae138c4e55a5b63aa7",
                  "75e06078dd24506ffea81cf1615f5f9d9057abe2caf0067c396f20f3bea8b817",
                  "44185134b1f8c503c78e9dbc36891ba3fa109237c3dc79399955bf29e75921d4",
                  "9c2f359207114f5de82f080b08cbcfe723153b3f9c002c3f672a60e88c0d71b6")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.relative_file_creation_timele
  • 300 transforms: number corpus 7 (elastic 7)
field:"dll.Ext.relative_file_creation_time" kind:le value:"300"
dll.code_signature.existseq
  • false transforms: boolean corpus 22 (elastic 22)
field:"dll.code_signature.exists" kind:eq value:"false"
dll.code_signature.trustedeq
  • false transforms: boolean corpus 21 (elastic 21)
field:"dll.code_signature.trusted" kind:eq value:"false"
dll.namewildcard
  • taskschd.dll corpus 7 (elastic 7)
field:"dll.name" kind:wildcard value:"taskschd.dll"
process.namewildcard
  • EXCEL.EXE corpus 34 (elastic 34)
  • POWERPNT.EXE corpus 31 (elastic 31)
  • WINWORD.EXE corpus 35 (elastic 35)
  • fltldr.exe corpus 8 (elastic 8)
  • mspub.exe corpus 15 (elastic 15)
  • visio.exe corpus 2 (elastic 2)
field:"process_basename" kind:wildcard
process.thread.Ext.call_stack_summarywildcard
  • *|vbe?.dll* corpus 3 (elastic 3)
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"*|vbe?.dll*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.hash.sha256eqa33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25, 4579447a18f557ef95cad8df77634370dbe7ddeaed8d319ea6e7a26ac1e79db6, f1c4e834f96abc5d787bd3d4efea008537eb44fd3e3b6560f8cef4eace525a62, 902553c9ffdc9e9751c6045b50590613183d4a7cc730365f7d629729a43fedcd, b80eca5b58d276be4d66bda65599e609efde2811de252172eeccea803826d41f, a33c6d203ffa6941b1e498f52f6ef565c5d731c2deecbae067c0039208a8db25, f110d49ca78d0fe8ee0fa1824f7bb714359159e824a65a13f2fd5bb7d91b692a, 90b3278ba2df87e4d61817adacf60f467359e0ff54dc793c0d5fdbc5fb087e59, 2e531fdebdc3468c03922545ce169804400e3ebb577e08ec88a6561901d2c595, 97c8afd6038b37729933ea0895760abe0a15b48258c46a04a0d010ed1ffa4e07, 81fc25734e3876b34e287a1df17cb94483029534392fed50f0c629e40485660c, bd92610dd9504c6eef269b4c7b1bcaf9ebf28081bb81a82fc053035701182383, 1e38e061ee5fcd4a76c591c24a39da005dc5fd58062ef8fadfe1ade95bfdbd4c, 96c0caf8a7e7c087028c0793eb9a0ab21f7a4a7a5ca5c85a95ad1f4419a8186c, 079cff190d73f4d1074844bf188588542cf3b52c22f775019fad113e0b63b14d, d661f1a025d99a98ebc6e42b3e69ae89379773821b2471ae138c4e55a5b63aa7, 75e06078dd24506ffea81cf1615f5f9d9057abe2caf0067c396f20f3bea8b817, 44185134b1f8c503c78e9dbc36891ba3fa109237c3dc79399955bf29e75921d4, 9c2f359207114f5de82f080b08cbcfe723153b3f9c002c3f672a60e88c0d71b6excludes:dll.hash.sha256
dll.pathwildcard?:\Windows\assembly\NativeImages_*.dll, ?:\Windows\System32\spool\drivers\x64\3\*, ?:\Program Files\*, ?:\Program Files (x86)\*, ?:\Windows\Microsoft.NET\Framework*, ?:\Windows\system32\scrrun.dll, ?:\Windows\syswow64\scrrun.dll, ?:\Windows\SysWOW64\THREED32.OCX, C:\blp\*, ?:\Windows\System32\DriverStore\FileRepository\*excludes:dll.path

Entra ID Service Principal Created

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

Identifies when a new service principal is added in Microsoft Entra ID. An application, hosted service, or automated tool that accesses or modifies resources needs an identity created. This identity is known as a service principal. For security reasons, it's always recommended to use service principals with automated tools rather than allowing them to log in with a user identity.

Known False Positives

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

MITRE ATT&CK Coverage

TacticTechniques
Persistence

Telemetry Coverage

PlatformRecord / event type
AzureAdd service principal

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when a new service principal is added in Microsoft Entra ID. An application, hosted service, or automated
tool that accesses or modifies resources needs an identity created. This identity is known as a service principal. For
security reasons, it's always recommended to use service principals with automated tools rather than allowing them to
log in with a user identity.
"""
false_positives = [
    """
    A service principal may be created by a system or network administrator. Verify whether the username, hostname,
    and/or resource name should be making changes in your environment. Service principal additions from unfamiliar users
    or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
    """,
]
from = "now-9m"
index = ["filebeat-*", "logs-azure.auditlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID Service Principal Created"
note = """## Triage and analysis

### Investigating Entra ID Service Principal Created

Service Principals are identities used by applications, services, and automation tools to access specific resources. They grant specific access based on the assigned API permissions. Most organizations that work a lot with Azure AD make use of service principals. Whenever an application is registered, it automatically creates an application object and a service principal in an Azure AD tenant.

This rule looks for the addition of service principals. This behavior may enable attackers to impersonate legitimate service principals to camouflage their activities among noisy automations/apps.

#### Possible investigation steps

- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user account during the past 48 hours.
- Consider the source IP address and geolocation for the user who issued the command. Do they look normal for the user?
- Consider the time of day. If the user is a human, not a program or script, did the activity take place during a normal time of day?
- Check if this operation was approved and performed according to the organization's change management policy.
- Contact the account owner and confirm whether they are aware of this activity.
- Examine the account's commands, API calls, and data management actions in the last 24 hours.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.

### False positive analysis

If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and device conditions.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    - Identify the account role in the cloud environment.
    - Assess the criticality of affected services and servers.
    - Work with your IT team to identify and minimize the impact on users.
    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    - Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Check if unauthorized new users were created, remove unauthorized new accounts, and request password resets for other IAM users.
- Consider enabling multi-factor authentication for users.
- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) by Microsoft.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via 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://msrc-blog.microsoft.com/2020/12/13/customer-guidance-on-recent-nation-state-cyber-attacks/",
    "https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal",
]
risk_score = 21
rule_id = "60b6b72f-0fbc-47e7-9895-9ba7627a8b50"
setup = """### Microsft Entra ID Audit Logs
This rule requires the Azure integration with Microsoft Entra ID Audit Logs data stream ingesting in your Elastic Stack deployment. For more information, refer to the [Microsoft Entra ID Audit Logs integration documentation](https://www.elastic.co/docs/reference/integrations/azure/adlogs).
"""
severity = "low"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Data Source: Microsoft Entra ID",
    "Data Source: Microsoft Entra ID Audit Logs",
    "Use Case: Identity and Access Audit",
    "Resources: Investigation Guide",
    "Tactic: Persistence",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:azure.auditlogs
    and azure.auditlogs.operation_name:"Add service principal"
    and event.outcome:(success or Success)
    and not azure.auditlogs.identity: (
        "Managed Service Identity" or
        "Windows Azure Service Management API" or
        "Microsoft Azure AD Internal - Jit Provisioning" or
        "AAD App Management" or
        "Power Virtual Agents Service"
        )
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1136"
name = "Create Account"
reference = "https://attack.mitre.org/techniques/T1136/"
[[rule.threat.technique.subtechnique]]
id = "T1136.003"
name = "Cloud Account"
reference = "https://attack.mitre.org/techniques/T1136/003/"



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

Stages and Predicates

Stage 1: query

data_stream.dataset:azure.auditlogs
    and azure.auditlogs.operation_name:"Add service principal"
    and event.outcome:(success or Success)
    and not azure.auditlogs.identity: (
        "Managed Service Identity" or
        "Windows Azure Service Management API" or
        "Microsoft Azure AD Internal - Jit Provisioning" or
        "AAD App Management" or
        "Power Virtual Agents Service"
        )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
azure.auditlogs.identityinAAD App Management, Managed Service Identity, Microsoft Azure AD Internal - Jit Provisioning, Power Virtual Agents Service, Windows Azure Service Management APIexcludes:azure.auditlogs.identity

FortiGate FortiCloud SSO Login from Unusual Source

#
Status
production
Severity
medium
Time window
7205m
Group by
source.ip
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects the first successful FortiCloud SSO login from a previously unseen source IP address to a FortiGate device within the last 5 days. FortiCloud SSO logins from new source IPs may indicate exploitation of SAML-based authentication bypass vulnerabilities such as CVE-2026-24858, where crafted SAML assertions allow unauthorized access to FortiGate devices registered to other accounts. Environments that regularly use FortiCloud SSO will only alert on new source IPs not seen in the lookback window.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/01/28"
integration = ["fortinet_fortigate"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rule detects the first successful FortiCloud SSO login from a previously unseen source IP address to a FortiGate
device within the last 5 days. FortiCloud SSO logins from new source IPs may indicate exploitation of SAML-based
authentication bypass vulnerabilities such as CVE-2026-24858, where crafted SAML assertions allow unauthorized access to
FortiGate devices registered to other accounts. Environments that regularly use FortiCloud SSO will only alert on new
source IPs not seen in the lookback window.
"""
from = "now-7205m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "FortiGate FortiCloud SSO Login from Unusual Source"
note = """## Triage and analysis

### Investigating FortiGate FortiCloud SSO Login from Unusual Source

This alert indicates that a FortiCloud SSO login was observed from a source IP address not previously seen authenticating via SSO in the last 5 days. This is a high-value signal because it filters out routine SSO access from known management IPs and only fires on novel source addresses.

CVE-2026-24858 (FG-IR-26-060) allows attackers with a FortiCloud account and a registered device to craft SAML assertions that authenticate them as administrators on other FortiGate devices when FortiCloud SSO is enabled. This vulnerability has been actively exploited in the wild.

### Possible investigation steps

- Check `source.ip` against known corporate management networks, VPN egress points, and jump hosts. Investigate the IP's ASN and geolocation, as attacker IPs have been observed from The Constant Company LLC, BL Networks, Kaopu Cloud HK Limited, and Cloudflare-protected ranges.
- Determine whether this IP has been seen in any other authentication context across the environment.
- Check `Esql.user_values` for the SSO account name (typically an email address) and verify the account belongs to the organization. Compare against known attacker email IOCs: cloud-noc@mail.io, cloud-init@mail.io, heltaylor.12@tutamail.com, support@openmail.pro.
- Check `Esql.observer_name_values` to identify which FortiGate device was accessed and confirm whether FortiCloud SSO is intentionally enabled on the device.
- Look for local administrator account creation, configuration exports, firewall policy changes, or VPN user/group creation immediately following the SSO login. The observed attack pattern involves rogue admin creation within seconds of login.

### False positive analysis

- Administrators connecting from a new office location, hotel, or home network for the first time may trigger this alert.
- FortiCloud SSO access after IP address changes such as ISP rotation or VPN egress changes can appear as a new source IP.
- First login after FortiCloud SSO is initially enabled on a device will fire since no historical SSO logins exist.

### Response and remediation

- If the activity is unauthorized, disable FortiCloud SSO immediately using `config system global` > `set admin-forticloud-sso-login disable`.
- Audit all administrator accounts for unauthorized additions and review and restore configuration from a known-clean backup.
- Rotate all credentials including any LDAP/AD accounts connected to the device.
- Upgrade FortiOS to a patched version.
- If the activity is expected, document the new source IP and consider adding an exception if it represents a new management location."""
references = [
    "https://www.fortiguard.com/psirt/FG-IR-26-060",
    "https://www.fortinet.com/blog/psirt-blogs/analysis-of-sso-abuse-on-fortios",
    "https://www.elastic.co/docs/reference/integrations/fortinet_fortigate",
    "https://www.cisa.gov/news-events/alerts/2026/01/28/fortinet-releases-guidance-address-ongoing-exploitation-authentication-bypass-vulnerability-cve-2026",
]
risk_score = 47
rule_id = "618a219d-a363-4ab1-ba30-870d7c22facd"
severity = "medium"
tags = [
    "Use Case: Threat Detection",
    "Tactic: Initial Access",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
    "Domain: Network",
    "Domain: Identity",
    "Data Source: Fortinet",
    "Data Source: Fortinet FortiGate",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
FROM logs-fortinet_fortigate.* metadata _id, _version, _index

| WHERE data_stream.dataset == "fortinet_fortigate.log" and
        event.category == "authentication" and event.action == "login" and
        event.outcome == "success" and
        (fortinet.firewall.method == "sso" or fortinet.firewall.ui like "sso*") and
        source.ip is not null
| STATS Esql.logon_count = COUNT(*),
        Esql.first_time_seen = MIN(@timestamp),
        Esql.user_values = VALUES(source.user.name),
        Esql.observer_name_values = VALUES(observer.name),
        Esql.message_values = VALUES(message) BY source.ip

// first time seen is within 6m of the rule execution time and for the last 5d of events history
| EVAL Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
| WHERE Esql.recent <= 6 AND Esql.logon_count == 1

// move dynamic fields to ECS equivalent for rule exceptions
| EVAL source.user.name = MV_FIRST(Esql.user_values)

| KEEP source.ip, source.user.name, Esql.*
'''


[[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 = "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 = "T1606"
name = "Forge Web Credentials"
reference = "https://attack.mitre.org/techniques/T1606/"

[[rule.threat.technique.subtechnique]]
id = "T1606.002"
name = "SAML Tokens"
reference = "https://attack.mitre.org/techniques/T1606/002/"

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

Stages and Predicates

Stage 1: from

FROM logs-fortinet_fortigate.* metadata _id, _version, _index

Stage 2: where

| WHERE data_stream.dataset == "fortinet_fortigate.log" and
        event.category == "authentication" and event.action == "login" and
        event.outcome == "success" and
        (fortinet.firewall.method == "sso" or fortinet.firewall.ui like "sso*") and
        source.ip is not null

Stage 3: stats

| STATS Esql.logon_count = COUNT(*),
        Esql.first_time_seen = MIN(@timestamp),
        Esql.user_values = VALUES(source.user.name),
        Esql.observer_name_values = VALUES(observer.name),
        Esql.message_values = VALUES(message) BY source.ip

Stage 4: eval

| EVAL Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())

Stage 5: where

| WHERE Esql.recent <= 6 AND Esql.logon_count == 1

Stage 6: eval

| EVAL source.user.name = MV_FIRST(Esql.user_values)

Stage 7: keep

| KEEP source.ip, source.user.name, Esql.*

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
source.ipKEEP source.ip
source.user.nameKEEP source.user.name
Esql.*KEEP Esql.*

Google Workspace Password Policy Modified

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

Detects when a Google Workspace administrator modifies organization password policy settings. Adversaries with administrative access may weaken password requirements, such as disabling strong password enforcement, allowing password reuse, or reducing minimum length, to increase the success of password spraying and credential stuffing against tenant accounts and to sustain access after initial compromise.

Known False Positives

  • Password policies may be modified by system administrators. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2020/11/17"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2026/06/01"

[rule]
author = ["Elastic"]
description = """
Detects when a Google Workspace administrator modifies organization password policy settings. Adversaries with
administrative access may weaken password requirements, such as disabling strong password enforcement, allowing password
reuse, or reducing minimum length, to increase the success of password spraying and credential stuffing against tenant
accounts and to sustain access after initial compromise.
"""
false_positives = [
    """
    Password policies may be modified by system administrators. Verify that the configuration change was expected.
    Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-130m"
index = ["filebeat-*", "logs-google_workspace.admin-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "Google Workspace Password Policy Modified"
note = """## Triage and analysis

### Investigating Google Workspace Password Policy Modified

Threat actors with Google Workspace administrative access may modify tenant password policies to weaken authentication
controls across an organizational unit or domain. Relaxing password complexity, reuse, or rotation requirements increases
the likelihood of successful password spraying, credential stuffing, and reuse of passwords exposed in third-party
breaches. Because policy changes apply to all users in scope, a single modification can materially expand the attack
surface for the entire unit.

Saving changes in the Admin console can update multiple password settings at once. Google logs each setting change as a
separate `CHANGE_APPLICATION_SETTING` or `CREATE_APPLICATION_SETTING` event (for example, minimum length, maximum
length, reset frequency, strong password enforcement, and password reuse). Alert suppression groups by `user.email`,
`google_workspace.admin.org_unit.name`, and `source.ip` within the rule lookback so analysts receive one alert per
password policy modification session instead of one alert per setting.

### Possible investigation steps

- Identify the initiating (actor) administrator by reviewing `user.email` or `user.name`, and note the `source.ip` and `event.ingested` timestamps.
- Identify the setting changed in the alert by reviewing `google_workspace.admin.setting.name`.
- Review `google_workspace.admin.old_value` and `google_workspace.admin.new_value` to determine whether the change weakened policy. Examples of high-risk changes include:
  - `Password Management - Enforce strong password` set to disabled
  - `Password Management - Enable password reuse` set to enabled
  - `Password Management - Minimum password length` reduced
  - `Password Management - Password reset frequency` increased (less frequent rotation)
- Identify the scope of impact by reviewing `google_workspace.admin.org_unit.name` and determining which users inherit the updated policy.
- Determine whether the modification is expected and authorized:
  - If the actor account or `source.ip` is unusual, treat the alert as higher priority until proven benign.
- Search Kibana for all password settings changed in the session:
  - In Discover (or the alert investigation workflow), search Google Workspace admin logs with a time range centered on the alert timestamp (±5 minutes).
  - Use the following KQL example, replacing `<ACTOR_EMAIL>` and `<ORG_UNIT>` as needed:
    ```
    data_stream.dataset: "google_workspace.admin" and event.action: ("CHANGE_APPLICATION_SETTING" or "CREATE_APPLICATION_SETTING") and user.email: "<ACTOR_EMAIL>" and google_workspace.admin.setting.name: Password Management - *
    ```
  - Optionally filter on `google_workspace.admin.org_unit.name: "<ORG_UNIT>"` to isolate changes for the same organizational unit.
  - Review all `google_workspace.admin.setting.name`, `google_workspace.admin.old_value`, and `google_workspace.admin.new_value` fields returned to understand the full scope of the modification.
- Scope for related activity by searching for the same `user.email` performing other security-weakening admin actions within the last 48 hours, such as MFA enforcement changes, SSO/SAML modifications, or role assignments.

### False positive analysis

- Verify the password policy change aligns with an approved change window, compliance exception, or migration activity.
- Policy hardening can also generate alerts for this rule — use `old_value` and `new_value` to distinguish benign hardening from weakening changes.

### Response and remediation

- Initiate the incident response process based on triage findings.
- If the modification is not clearly authorized, restore password policy settings to their prior values for the affected organizational unit while the investigation proceeds.
- If the initiating admin account is suspected compromised, reset credentials, revoke active sessions, and review delegated admin roles assigned to that account.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    - Identify the account role in the cloud environment.
    - Assess the criticality of affected services and servers.
    - Work with your IT team to identify and minimize the impact on users.
    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    - Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified.
- Review the permissions assigned to the implicated administrator to ensure that the least privilege principle is being followed.
- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via 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

The Google Workspace Fleet integration, the Filebeat module, or data that's similarly structured is required for this rule.

### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators might observe lag times ranging from several minutes to 3 days between the event occurrence time and the event being visible in the Google Workspace admin/audit logs.
- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
- See the following references for further information:
  - https://support.google.com/a/answer/7061566
  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
references = [
    "https://support.google.com/a/answer/7061566",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
]
risk_score = 47
rule_id = "a99f82f5-8e77-4f8b-b3ce-10c0f6afbc73"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Google Workspace",
    "Use Case: Identity and Access Audit",
    "Tactic: Persistence",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:google_workspace.admin and
  event.action:(CHANGE_APPLICATION_SETTING or CREATE_APPLICATION_SETTING) and
  google_workspace.admin.setting.name:(
    "Password Management - Enforce strong password" or
    "Password Management - Password reset frequency" or
    "Password Management - Enable password reuse" or
    "Password Management - Enforce password policy at next login" or
    "Password Management - Minimum password length" or
    "Password Management - Maximum password length"
  )
'''

[rule.alert_suppression]
group_by = ["user.email", "google_workspace.admin.org_unit.name", "source.ip"]
duration = {value = 130, unit = "m"}
missing_fields_strategy = "suppress"

[rule.investigation_fields]
field_names = [
    "user.name",
    "user.email",
    "source.ip",
    "event.action",
    "google_workspace.admin.setting.name",
    "google_workspace.admin.org_unit.name",
    "google_workspace.admin.old_value",
    "google_workspace.admin.new_value",
]

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

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

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

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

[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"

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

Stages and Predicates

Stage 1: query

data_stream.dataset:google_workspace.admin and
  event.action:(CHANGE_APPLICATION_SETTING or CREATE_APPLICATION_SETTING) and
  google_workspace.admin.setting.name:(
    "Password Management - Enforce strong password" or
    "Password Management - Password reset frequency" or
    "Password Management - Enable password reuse" or
    "Password Management - Enforce password policy at next login" or
    "Password Management - Minimum password length" or
    "Password Management - Maximum password length"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • google_workspace.admin corpus 16 (elastic 16)
field:"data_stream.dataset" kind:eq value:"google_workspace.admin"
event.actionin
  • CHANGE_APPLICATION_SETTING corpus 2 (elastic 2)
  • CREATE_APPLICATION_SETTING corpus 2 (elastic 2)
field:"EventType" kind:in
google_workspace.admin.setting.namein
  • Password Management - Enable password reuse
  • Password Management - Enforce password policy at next login
  • Password Management - Enforce strong password
  • Password Management - Maximum password length
  • Password Management - Minimum password length
  • Password Management - Password reset frequency
field:"gws::admin_setting_name" kind:in

Microsoft IIS Connection Strings Decryption

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

Identifies use of aspnet_regiis to decrypt Microsoft IIS connection strings. An attacker with Microsoft IIS web server access via a webshell or similar access can decrypt and dump any hardcoded connection strings, such as the MSSQL service account password using the aspnet_regiis command.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies use of aspnet_regiis to decrypt Microsoft IIS connection strings. An attacker with Microsoft IIS web server
access via a webshell or similar access can decrypt and dump any hardcoded connection strings, such as the MSSQL service
account password using the aspnet_regiis command.
"""
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"
max_signals = 33
name = "Microsoft IIS Connection Strings Decryption"
references = [
    "https://www.netspi.com/blog/technical-blog/network-pentesting/decrypting-iis-passwords-to-break-out-of-the-dmz-part-1/",
    "https://symantec-enterprise-blogs.security.com/blog-post/greenbug-espionage-telco-south-asia",
]
risk_score = 73
rule_id = "c25e9c87-95e1-4368-bfab-9fd34cf867ec"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  (process.name : "aspnet_regiis.exe" or ?process.pe.original_file_name == "aspnet_regiis.exe") and
  process.args : "connectionStrings" and process.args : ("-pdf", "-pd")
'''

note = """## Triage and analysis

### Investigating Microsoft IIS Connection Strings Decryption

#### Possible investigation steps

- Which protected IIS configuration section and application path did the command expose?
  - Focus: `process.command_line` and `process.working_directory` for the protected-section decrypt operation ("connectionStrings" with "-pdf" or "-pd") and the target application path.
  - Implication: escalate faster when the target is a production web root, shared IIS configuration path, copied temp tree, or folder unrelated to the named IIS site; lower concern at this step only for a staging or development target path. Path context alone never closes the alert.

- Is the aspnet_regiis instance the expected signed .NET utility in the expected launch context?
  - Focus: `process.executable`, `process.code_signature.subject_name`, `process.code_signature.trusted`, and `process.parent.command_line`.
  - Implication: escalate when the binary is renamed, unsigned, user-writable, or launched from a shell, script host, IIS worker lineage, or remote-admin chain that does not fit the workflow. Expected Microsoft identity reduces masquerade concern, but never clears the decrypt action by itself.

- Do the user, parent chain, and session type fit IIS administration on this host?
  - Focus: `user.id`, `process.parent.command_line`, and `process.Ext.session_info.logon_type`.
  - Hint: If parent lineage remains unclear, expand ancestry before accepting an IIS administration explanation.
  - Implication: escalate when an unusual user, web-content lineage, remote-interactive session, service context, or unusual admin context performs the decrypt; lower concern when the same user/host pair and parent workflow recur for IIS administration on this server.

- Did follow-on process activity expose, stage, or reuse the recovered secrets?
  - Focus: child and same-parent process starts, reading `process.executable` and `process.command_line` for shells, PowerShell, archive utilities, SQL clients, config copies, or output commands. $investigate_2
  - Hint: use sibling command lines to look for "aspnet_regiis -pdf appSettings", "aspnet_regiis -px", or direct IIS config-copy commands; if `process.entity_id` is absent, use the `host.id` + `process.parent.pid` or `process.pid` fallback branches in a tight alert-time window.
  - Implication: escalate when decryption is followed by shell output, copied configs, archive creation, SQL tooling such as sqlcmd/osql/isql, PowerShell database testing, or additional protected-section access.

- If available, do process-scoped file records corroborate config staging?
  - Focus: file activity scoped by `host.id` and `process.entity_id`, or direct children through `process.parent.entity_id`, for config copies, temp staging, and archives. $investigate_3
  - Implication: escalate when available records show copied "web.config", "applicationHost.config", or "machine.config" material, temp staging, or archive output. If `process.entity_id` is absent, use `host.id` + `process.pid` in a tight alert window; missing endpoint file telemetry is unresolved, not benign.

- If available, do process-scoped network records corroborate SQL access or transfer?
  - Focus: network activity scoped by `host.id` and `process.entity_id`, or direct children through `process.parent.entity_id`, for database, proxy, external, or share destinations. $investigate_4
  - Implication: escalate when available records show database connectivity, proxy use, external egress, or remote staging after the decrypt. If `process.entity_id` is absent, use `host.id` + `process.pid` in a tight alert window. Missing network telemetry is unresolved, not benign.

- If local findings remain suspicious or incomplete, do related alerts show broader credential-access activity?
  - Focus: related alerts for `user.id`, especially webshell execution, privilege escalation, lateral movement, SQL testing, archive/exfiltration, or repeated credential access. $investigate_0
  - Hint: compare `host.id` alerts for webshell, staging, exfiltration, persistence, or repeated aspnet_regiis activity on the IIS asset. $investigate_1
  - Implication: broaden response when either scope shows complementary webshell, staging, SQL access, or credential-access activity. No related alerts only limits scope; it does not close the decrypt activity.

- Based on the evidence gathered, what disposition is supported?
  - Focus: `process.command_line`, `process.executable`, `process.code_signature.subject_name`, `process.parent.command_line`, `process.Ext.session_info.logon_type`, optional file/network corroboration, and related-alert scope.
  - Implication: escalate when those categories show unrecognized decryption, config staging, SQL testing, or secret reuse; close only when telemetry from the same categories aligns with one exact IIS maintenance, deployment, migration, or recovery workflow, using outside confirmation only to corroborate that exact activity; preserve and escalate if evidence is mixed or incomplete.

### False positive analysis

- Recognized IIS maintenance, deployment, or migration can legitimately run aspnet_regiis against connection strings. Confirm only when telemetry shows the utility path and signer, parent workflow, command target, `user.id`, `host.id`, and follow-on process activity all align with the same change.
- IR/recovery can also be legitimate when responders decrypt a known application path to restore service or rotate secrets. Confirm that config copies, SQL testing, transfer evidence, and credential rotation stay inside the recovery scope; if external records are unavailable, close only when this alert's telemetry is complete and non-contradictory.
- Build exceptions from the minimum confirmed workflow: `process.executable`, `process.code_signature.subject_name`, parent workflow, exact target path, `user.id`, and `host.id`. Avoid exceptions on aspnet_regiis alone, "connectionStrings" alone, or host alone.

### Response and remediation

- If confirmed benign, document the recognized utility path, target path, operator, session type, parent lineage, and follow-on activity before reversing temporary containment. Create an exception only if that same pattern recurs across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the recovered `process.entity_id`, `process.command_line`, target application path, child-process lineage, copied config material, archive names, and any confirmed destinations before destructive changes. Apply reversible containment first, such as temporarily restricting outbound connectivity or share access for the affected `host.id`; escalate to host isolation or account action only if follow-on commands, copied configs, or related alerts show broader compromise and the IIS host can tolerate it.
- If confirmed malicious, preserve the same artifacts, then use endpoint response to isolate the host or terminate the responsible process. If direct response is unavailable, escalate with the preserved artifact set to the team that can act.
- Rotate the credentials exposed by the targeted connection strings, including database passwords, service-account secrets, and any downstream application credentials discovered during the investigation. Prioritize credentials tied to production databases or shared service accounts.
- Before deleting or restoring anything, review related `host.id` and `user.id` activity for the same aspnet_regiis arguments, targeted config paths, copied config filenames, database destinations, and adjacent protected-section abuse such as "aspnet_regiis -pdf appSettings" or "aspnet_regiis -px". Then eradicate the webshells, scripts, copied configuration files, archives, and persistence mechanisms uncovered during the investigation, and remediate the initial access or privilege path that allowed the decrypt action.
- After containment, scope other hosts for the same aspnet_regiis arguments, targeted config paths, follow-on database or archive activity, and adjacent protected-section abuse ("aspnet_regiis -pdf appSettings", "aspnet_regiis -px", or direct IIS config copies).
- Post-incident hardening: restrict aspnet_regiis use against production IIS paths to recognized administration workflows and document the recognized target-path and destination patterns that justified any exception.
"""

setup = """## Setup

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

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

### Additional data sources

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

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

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

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

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  (process.name : "aspnet_regiis.exe" or ?process.pe.original_file_name == "aspnet_regiis.exe") and
  process.args : "connectionStrings" and process.args : ("-pdf", "-pd")

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
  • -pd corpus 3 (elastic 3)
  • -pdf
  • connectionStrings
field:"process.args" kind:wildcard
process.namewildcard
  • aspnet_regiis.exe corpus 2 (elastic 2)
field:"process_basename" kind:wildcard value:"aspnet_regiis.exe"
process.pe.original_file_nameeq
  • aspnet_regiis.exe
field:"OriginalFileName" kind:eq value:"aspnet_regiis.exe"

NetworkManager Dispatcher Script Creation

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

This rule detects the creation of a NetworkManager dispatcher script on a Linux system. NetworkManager dispatcher scripts are shell scripts that NetworkManager executes when network interfaces change state. Attackers can abuse NetworkManager dispatcher scripts to maintain persistence on a system by executing malicious code whenever a network event occurs.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the creation of a NetworkManager dispatcher script on a Linux system. NetworkManager dispatcher
scripts are shell scripts that NetworkManager executes when network interfaces change state. Attackers can abuse
NetworkManager dispatcher scripts to maintain persistence on a system by executing malicious code whenever a network
event occurs.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "NetworkManager Dispatcher Script Creation"
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 NetworkManager Dispatcher Script Creation

NetworkManager dispatcher scripts are executed on Linux systems when network interfaces change state, allowing for automated responses to network events. Adversaries can exploit this by creating scripts that execute malicious code, ensuring persistence and evasion. The detection rule identifies unauthorized script creation by monitoring file creation events in the dispatcher directory, excluding known legitimate processes and file types, thus highlighting potential abuse.

### Possible investigation steps

- Review the file creation event details to identify the specific script created in the /etc/NetworkManager/dispatcher.d/ directory, noting the file path and name.
- Examine the process that created the script by checking the process.executable field to determine if it is an unexpected or suspicious process not listed in the known legitimate processes.
- Investigate the contents of the newly created script to identify any potentially malicious code or commands that could indicate an attempt to maintain persistence or execute unauthorized actions.
- Check the system's recent network events and changes to see if the script has been triggered and executed, which could provide further context on its intended use.
- 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 or compromise.

### False positive analysis

- Package management tools like dpkg, rpm, and yum may trigger false positives when they create or modify dispatcher scripts during software installations or updates. To handle these, ensure that the process executables for these tools are included in the exclusion list within the detection rule.
- Automated system management tools such as Puppet, Chef, and Ansible can also cause false positives when they deploy or update configurations. Verify that the executables for these tools are part of the exclusion criteria to prevent unnecessary alerts.
- Temporary files created by text editors like Vim may be mistakenly flagged. These files typically have extensions like swp or swpx. Ensure these extensions are included in the exclusion list to avoid false positives.
- Custom scripts or applications that are known to create or modify dispatcher scripts for legitimate purposes should be reviewed. If deemed safe, add their process executables to the exclusion list to prevent them from being flagged.
- Consider monitoring the frequency and context of script creation events. If certain scripts are frequently created by known processes, evaluate the need to adjust the rule to reduce noise while maintaining security efficacy.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further execution of potentially malicious scripts and limit the attacker's ability to maintain persistence.
- Review and remove any unauthorized scripts found in the /etc/NetworkManager/dispatcher.d/ directory to eliminate the immediate threat.
- Conduct a thorough examination of the system for additional signs of compromise, such as unexpected processes or network connections, to identify any further malicious activity.
- Restore any affected systems from a known good backup to ensure the removal of any persistent threats that may have been established.
- Implement stricter access controls and monitoring on the /etc/NetworkManager/dispatcher.d/ directory to prevent unauthorized script creation in the future.
- Escalate the incident to the security operations team for further investigation and to determine if the threat is part of a larger attack campaign.
- Update and enhance endpoint detection and response (EDR) solutions to improve detection capabilities for similar threats, leveraging the MITRE ATT&CK framework for guidance on persistence and execution techniques."""
risk_score = 21
rule_id = "86aa8579-1526-4dff-97cd-3635eb0e0545"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "creation" and file.path like "/etc/NetworkManager/dispatcher.d/*" and
not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe",  "/usr/bin/pamac-daemon", "./usr/bin/podman",
    "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "/usr/bin/crio", "/usr/sbin/crond",
    "/opt/puppetlabs/puppet/bin/ruby", "/usr/libexec/platform-python", "/kaniko/kaniko-executor",
    "/usr/local/bin/dockerd", "/usr/bin/podman", "/bin/install", "/proc/self/exe", "/usr/lib/systemd/systemd",
    "/usr/sbin/sshd", "/usr/bin/gitlab-runner", "/opt/gitlab/embedded/bin/ruby", "/usr/sbin/gdm", "/usr/bin/install",
    "/usr/local/manageengine/uems_agent/bin/dcregister", "/usr/local/bin/pacman", "./usr/bin/qemu-aarch64-static"
  ) or
  process.executable like~ (
    "/nix/store/*", "/var/lib/dpkg/*", "/tmp/vmis.*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*"
  ) or
  file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
  (process.name == "sed" and file.name : "sed*") or
  (
    process.executable like ("/kaniko/executor", "/usr/libexec/platform-python*") and
    file.path like "/etc/NetworkManager/dispatcher.d/11-dhclient*"
  )
)
'''

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

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

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.type == "creation" and file.path like "/etc/NetworkManager/dispatcher.d/*" and
not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe",  "/usr/bin/pamac-daemon", "./usr/bin/podman",
    "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "/usr/bin/crio", "/usr/sbin/crond",
    "/opt/puppetlabs/puppet/bin/ruby", "/usr/libexec/platform-python", "/kaniko/kaniko-executor",
    "/usr/local/bin/dockerd", "/usr/bin/podman", "/bin/install", "/proc/self/exe", "/usr/lib/systemd/systemd",
    "/usr/sbin/sshd", "/usr/bin/gitlab-runner", "/opt/gitlab/embedded/bin/ruby", "/usr/sbin/gdm", "/usr/bin/install",
    "/usr/local/manageengine/uems_agent/bin/dcregister", "/usr/local/bin/pacman", "./usr/bin/qemu-aarch64-static"
  ) or
  process.executable like~ (
    "/nix/store/*", "/var/lib/dpkg/*", "/tmp/vmis.*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*"
  ) or
  file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
  (process.name == "sed" and file.name : "sed*") or
  (
    process.executable like ("/kaniko/executor", "/usr/libexec/platform-python*") and
    file.path like "/etc/NetworkManager/dispatcher.d/11-dhclient*"
  )
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.namestarts_withsedexcludes:file.name field:"file.name" value:"sed"
process.nameeqsedexcludes:process.name field:"process.name" value:"sed"
file.pathstarts_with/etc/NetworkManager/dispatcher.d/11-dhclientexcludes:file.path field:"file.path" value:"/etc/NetworkManager/dispatcher.d/11-dhclient"
process.executablewildcard/kaniko/executor, /usr/libexec/platform-python*excludes:process.executable field:"process.executable" value:"/kaniko/executor" field:"process.executable" value:"/usr/libexec/platform-python*"
file.extensionindpkg-remove, swp, swpx, swxexcludes:file.extension
process.executablein./usr/bin/podman, ./usr/bin/qemu-aarch64-static, /bin/autossl_check, /bin/chef-client, /bin/dnf, /bin/dnf-automatic, /bin/dockerd, /bin/dpkg, /bin/dpkg-divert, /bin/install, /bin/microdnf, /bin/pacman, /bin/pamac-daemon, /bin/podman, /bin/puppet, /bin/rpm, /bin/snapd, /bin/yum, /kaniko/kaniko-executor, /opt/gitlab/embedded/bin/ruby, /opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /proc/self/exe, /sbin/apk, /usr/bin/apt, /usr/bin/autossl_check, /usr/bin/chef-client, /usr/bin/crio, /usr/bin/dnf, /usr/bin/dnf-automatic, /usr/bin/dockerd, /usr/bin/dpkg, /usr/bin/dpkg-divert, /usr/bin/gitlab-runner, /usr/bin/install, /usr/bin/microdnf, /usr/bin/pacman, /usr/bin/pamac-daemon, /usr/bin/podman, /usr/bin/puppet, /usr/bin/rpm, /usr/bin/snapd, /usr/bin/yum, /usr/lib/snapd/snapd, /usr/lib/systemd/systemd, /usr/libexec/platform-python, /usr/local/bin/dockerd, /usr/local/bin/pacman, /usr/local/manageengine/uems_agent/bin/dcregister, /usr/local/sbin/apk, /usr/sbin/apk, /usr/sbin/crond, /usr/sbin/dockerd, /usr/sbin/gdm, /usr/sbin/pacman, /usr/sbin/sshdexcludes:process.executable
process.executablestarts_with/nix/store/, /var/lib/dpkg/, /tmp/vmis., /snap/, /dev/fd/, /usr/lib/virtualbox/excludes:process.executable

Okta User Session Impersonation

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

A user has initiated a session impersonation granting them access to the environment with the permissions of the user they are impersonating. This would likely indicate Okta administrative access and should only ever occur if requested and expected.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2022/03/22"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
A user has initiated a session impersonation granting them access to the environment with the permissions of the user
they are impersonating. This would likely indicate Okta administrative access and should only ever occur if requested
and expected.
"""
from = "now-30m"
index = ["filebeat-*", "logs-okta*"]
interval = "15m"
language = "kuery"
license = "Elastic License v2"
name = "Okta User Session Impersonation"
note = """## Triage and analysis

### Investigating Okta User Session Impersonation

The detection of an Okta User Session Impersonation indicates that a user has initiated a session impersonation which grants them access with the permissions of the user they are impersonating. This type of activity typically indicates Okta administrative access and should only ever occur if requested and expected.

#### Possible investigation steps

- Identify the actor associated with the impersonation event by checking the `okta.actor.id`, `okta.actor.type`, `okta.actor.alternate_id`, or `okta.actor.display_name` fields.
- Review the `event.action` field to confirm the initiation of the impersonation event.
- Check the `event.time` field to understand the timing of the event.
- Check the `okta.target.id`, `okta.target.type`, `okta.target.alternate_id`, or `okta.target.display_name` to identify the user who was impersonated.
- Review any activities that occurred during the impersonation session. Look for any activities related to the impersonated user's account during and after the impersonation event.

### False positive analysis

- Verify if the session impersonation was part of an approved activity. Check if it was associated with any documented administrative tasks or troubleshooting efforts.
- Ensure that the impersonation session was initiated by an authorized individual. You can check this by verifying the `okta.actor.id` or `okta.actor.display_name` against the list of approved administrators.

### Response and remediation

- If the impersonation was not authorized, consider it as a breach. Suspend the user account of the impersonator immediately.
- Reset the user session and invalidate any active sessions related to the impersonated user.
- If a specific impersonation technique was used, ensure that systems are patched or configured to prevent such techniques.
- Conduct a thorough investigation to understand the extent of the breach and the potential impact on the systems and data.
- Review and update your security policies to prevent such incidents in the future.
- Implement additional monitoring and logging of Okta events to improve visibility of user actions.

## Setup

The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://blog.cloudflare.com/cloudflare-investigation-of-the-january-2022-okta-compromise/",
    "https://www.elastic.co/security-labs/testing-okta-visibility-and-detection-dorothy",
    "https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
    "https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
    "https://www.elastic.co/security-labs/okta-and-lapsus-what-you-need-to-know",
]
risk_score = 73
rule_id = "cdbebdc1-dc97-43c6-a538-f26a20c0a911"
severity = "high"
tags = [
    "Use Case: Identity and Access Audit",
    "Tactic: Credential Access",
    "Data Source: Okta",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:okta.system and event.action:user.session.impersonation.initiate
'''


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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:okta.system and event.action:user.session.impersonation.initiate

Indicators

These rows show field, operator, and value matches.

Payload Execution by Node.js Web Server

#
Source
github.com/elastic/protections-artifacts

This rule detects when a Node.js web server executes a payload. Attackers may exploit RCE or file upload vulnerabilities to execute malicious payloads on Node.js web servers to gain/maintain access and to establish a command and control channel.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects when a Node.js web server executes a payload. Attackers may exploit RCE or file upload vulnerabilities
to execute malicious payloads on Node.js web servers to gain/maintain access and to establish a command and control
channel.
"""
id = "b982a098-f3c6-42d7-958a-86c46f06360b"
license = "Elastic License v2"
name = "Payload Execution by Node.js Web Server"
os_list = ["linux"]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and process.parent.interactive == false and
process.parent.name == "node" and process.parent.command_line like~ (
  "*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
  "*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
) and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and
process.args in ("-c", "-cl", "-lc") and (
  process.command_line like~ (

    /* Suspicious Paths */
    "* /tmp/* ", "* /var/tmp/* ", "* /dev/shm/*", "* /run/*", "* /var/run/*",

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

    /* Interpreter Execution */
    "*python -c*", "*python3 -c*", "*php -r*", "*perl -e*", "*ruby -e*", "*lua -e*", "*node -e *",

    /* Reverse Shells */
    "*netcat *", "* nc *", "*ncat *", "*/dev/tcp*", "*/dev/udp/*", "*socat *", "*openssl*s_client *", "*stty*raw*-echo*",
    "*mkfifo /tmp/*", 

    /* File Access */
    "*>*/etc/cron*", "*crontab*", "*/etc/ssh*", "*/home/*/.ssh/*", "*/root/.ssh*", "*~/.ssh/*", "*/etc/shadow*",
    "*/etc/passwd*", "*/etc/master.passwd*",

    /* Enumeration & Discovery */
    "*/etc/hosts*", "*/etc/resolv.conf*", "*/etc/hostname*", "*/etc/issue*", "*/etc/os-release*", "*lsb_release*",
    "*/proc/*/environ*", "*sudo -l*", "*/proc/*/cgroup*", "*dockerenv*", "*/proc/*/mountinfo*", "*printenv*",
    "*cat*.env *", "*getcap*", "*capsh*", "*find / *", "*netstat *",

    /* AWS Credentials */
    "*aws_access_key_id*", "*aws_secret_access_key*", "*aws_session_token*", "*accesskeyid*", "*secretaccesskey*",
    "*.aws/credentials*", "*/.aws/config*",

    /* Azure Credentials */
    "*AZURE_CLIENT_ID*", "*AZURE_TENANT_ID*", "*AZURE_CLIENT_SECRET*", "*AZURE_FEDERATED_TOKEN_FILE*",
    "*IDENTITY_ENDPOINT*", "*IDENTITY_HEADER*", "*MSI_ENDPOINT*", "*MSI_SECRET*", "*/.azure/*",
    "*/run/secrets/azure/*",

    /* GCP Credentials */
    "*/.config/gcloud/*", "*application_default_credentials.json*", "*type: service_account*",
    "*client_email*", "*private_key_id*", "*/run/secrets/google/*", "*GOOGLE_APPLICATION_CREDENTIALS*",

    /* Misc. Cloud */
    "*/.npmrc*", "*/secrets/kubernetes.io/serviceaccount/*",

    /* Helpers */
    "*timeout *sh -c *", "*env *sh *-c*", "*exec -a*",

    /* Miscellaneous */
    "*chattr *", "*busybox *",  "*#!*", "*chmod +x *", "*chmod 777*", "*chpasswd*",
    "*<?php*?>*", "*kworker*",
    
    /* Decompression */
    "*gzip -*d *", "*bzip2 -*d *", "*xz -*d *", "*tar -*x*",
    
    /* Path Traversal */
    "*../../../*etc/*", "*/.../*", "*../../../*home/*/*", "*../../../*root/*",

    /* File Upload/Download */
    "*pastebin.com*", "*transfer.sh*", "*bashupload.com*"
  ) or
  process.args in ("id", "whoami", "hostname")
) and
not (
  process.command_line like (
    "sh -c node -v || nodejs -v", "*./postinstall*", "*./_postinstall*", "/bin/sh -c lsb_release -sd",
    "*/etc/freepbx.conf*", "*betterme/image-processing-service-admin-frontend*", "/bin/sh -c exit 0 || node patches/*.js",
    """/bin/sh -c export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\|SYN_SENT\|SYN_RECV\|FIN_WAIT1\|FIN_WAIT2\|TIME_WAIT\|CLOSE\|CLOSE_WAIT\|LAST_ACK\|LISTEN\|CLOSING\|UNKNOWN"; unset LC_ALL"""
  ) or
  process.parent.args like (
    "/opt/bitdefender/*", "/opt/cursor-agent/*", "/home/*/*", "/root/*", "/var/www/html/ext/.deloreanbuild",
    "/usr/lib/node_modules/openclaw/dist/index.js", "/opt/yarn*", "*anthropic-ai/claude-code/cli.js*",
    "/usr/bin/docker-builder", "/opt/jenkins/.nvm/versions/node/*/bin/npm", "/usr/local/renovate/node",
    "/opt/buildagent/work/*/node_modules/.bin/cypress", "/var/www/html/ext/node_modules/.bin/webpack",
    "/opt/containerbase/tools/node/*/bin/node", "/opt/*/bin/*/node_modules/.bin/bower", "/usr/local/bin/cursor-agent"
  ) or
  process.args like ("npx *", "node /var/www/html/ext/node_modules/.bin/webpack*", "grep* | awk*") or
  process.parent.executable like "/opt/jenkins/workspace/*/bin/node" or
  process.working_directory == "/runner/_work/personify/personify/node_modules/snyk" or
  (process.command_line like "*REPO_NAME*" and process.parent.command_line like "node /usr/bin/n8n*") or
  (process.parent.command_line == "node /var/www/html/fs-ws-api/controller/cronJob.js" and process.command_line like "/bin/sh -c nc -zv 10.*") or
  (
    process.parent.executable == "/opt/liongard/node/bin/node" and
    process.command_line in (
     "/bin/sh -c cut -d: -f1 /etc/passwd", "/bin/sh -c hostname", "/bin/sh -c sudo cat /etc/ssh/sshd_config", "/bin/sh -c whoami"
    )
  ) or
  (
    process.executable like "/opt/node-*-linux-x64/bin/node" and
    process.working_directory == "/aplicaciones/backend/label-printing" and
    process.command_line like "/bin/sh -c python3 ./socket/main.py*"
  ) or
  (process.parent.executable like "/opt/actions-runner/_work/_tool/node/*/x64/bin/node" and process.command_line == "/bin/sh -c cat /etc/os-release") or
  (process.parent.executable == "/opt/node/bin/node" and process.parent.command_line == "node /opt/node/bin/npm ci") or
  (
    process.parent.executable like "/opt/hostedtoolcache/node/*/x64/bin/node" and
    process.parent.args in ("install", "ci") and
    process.parent.args like "/opt/hostedtoolcache/node/*"
  ) or
  (process.parent.executable like "/opt/plesk/node/*/bin/node" and process.parent.args in ("install", "ci")) or
  (
    process.parent.command_line == "node /opt/app-root/app/build/index.js" and
    process.command_line == "/bin/sh -c netstat -tunlp"
  ) or
  process.parent.executable like (
    "*/.cursor-server/bin/linux-x64/*/node", "*/.vscode-server/*/node",
    "*/.vscode-server/cli/servers/*/server/node", "*/code-server/*/lib/node"
  )
)
'''

min_endpoint_version = "8.2.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.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 = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"
[[threat.technique.subtechnique]]
id = "T1505.003"
name = "Web Shell"
reference = "https://attack.mitre.org/techniques/T1505/003/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"


[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[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 = "8.2.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.parent.interactive == false and
process.parent.name == "node" and process.parent.command_line like~ (
  "*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
  "*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
) and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and
process.args in ("-c", "-cl", "-lc") and (
  process.command_line like~ (
    "* /tmp/* ", "* /var/tmp/* ", "* /dev/shm/*", "* /run/*", "* /var/run/*",
    "*|sh", "*| sh *", "*| sh ", "*|bash*", "*| bash*", "*|zsh*",  "*| zsh*", "*|dash*",  "*| dash*",
    "*|python*", "*| python*", "*|php*", "*| php*", "*|perl*", "*| perl*", "*|ruby*", "*| ruby*",
    "*|node*", "*| node*", "*|lua*",  "*| lua*", "*|busybox*", "*| busybox*", "*|*base64 -d*", "*|*base64 --decode*",
    "*|*base64 --decode*", "*|*openssl base64 -d*", "*xxd *", "*| openssl*enc * -d *", "*b64decode -r*",
    "*python -c*", "*python3 -c*", "*php -r*", "*perl -e*", "*ruby -e*", "*lua -e*", "*node -e *",
    "*netcat *", "* nc *", "*ncat *", "*/dev/tcp*", "*/dev/udp/*", "*socat *", "*openssl*s_client *", "*stty*raw*-echo*",
    "*mkfifo /tmp/*",
    "*>*/etc/cron*", "*crontab*", "*/etc/ssh*", "*/home/*/.ssh/*", "*/root/.ssh*", "*~/.ssh/*", "*/etc/shadow*",
    "*/etc/passwd*", "*/etc/master.passwd*",
    "*/etc/hosts*", "*/etc/resolv.conf*", "*/etc/hostname*", "*/etc/issue*", "*/etc/os-release*", "*lsb_release*",
    "*/proc/*/environ*", "*sudo -l*", "*/proc/*/cgroup*", "*dockerenv*", "*/proc/*/mountinfo*", "*printenv*",
    "*cat*.env *", "*getcap*", "*capsh*", "*find / *", "*netstat *",
    "*aws_access_key_id*", "*aws_secret_access_key*", "*aws_session_token*", "*accesskeyid*", "*secretaccesskey*",
    "*.aws/credentials*", "*/.aws/config*",
    "*AZURE_CLIENT_ID*", "*AZURE_TENANT_ID*", "*AZURE_CLIENT_SECRET*", "*AZURE_FEDERATED_TOKEN_FILE*",
    "*IDENTITY_ENDPOINT*", "*IDENTITY_HEADER*", "*MSI_ENDPOINT*", "*MSI_SECRET*", "*/.azure/*",
    "*/run/secrets/azure/*",
    "*/.config/gcloud/*", "*application_default_credentials.json*", "*type: service_account*",
    "*client_email*", "*private_key_id*", "*/run/secrets/google/*", "*GOOGLE_APPLICATION_CREDENTIALS*",
    "*/.npmrc*", "*/secrets/kubernetes.io/serviceaccount/*",
    "*timeout *sh -c *", "*env *sh *-c*", "*exec -a*",
    "*chattr *", "*busybox *",  "*#!*", "*chmod +x *", "*chmod 777*", "*chpasswd*",
    "*<?php*?>*", "*kworker*",
    "*gzip -*d *", "*bzip2 -*d *", "*xz -*d *", "*tar -*x*",
    "*../../../*etc/*", "*/.../*", "*../../../*home/*/*", "*../../../*root/*",
    "*pastebin.com*", "*transfer.sh*", "*bashupload.com*"
  ) or
  process.args in ("id", "whoami", "hostname")
) and
not (
  process.command_line like (
    "sh -c node -v || nodejs -v", "*./postinstall*", "*./_postinstall*", "/bin/sh -c lsb_release -sd",
    "*/etc/freepbx.conf*", "*betterme/image-processing-service-admin-frontend*", "/bin/sh -c exit 0 || node patches/*.js",
    """/bin/sh -c export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\|SYN_SENT\|SYN_RECV\|FIN_WAIT1\|FIN_WAIT2\|TIME_WAIT\|CLOSE\|CLOSE_WAIT\|LAST_ACK\|LISTEN\|CLOSING\|UNKNOWN"; unset LC_ALL"""
  ) or
  process.parent.args like (
    "/opt/bitdefender/*", "/opt/cursor-agent/*", "/home/*/*", "/root/*", "/var/www/html/ext/.deloreanbuild",
    "/usr/lib/node_modules/openclaw/dist/index.js", "/opt/yarn*", "*anthropic-ai/claude-code/cli.js*",
    "/usr/bin/docker-builder", "/opt/jenkins/.nvm/versions/node/*/bin/npm", "/usr/local/renovate/node",
    "/opt/buildagent/work/*/node_modules/.bin/cypress", "/var/www/html/ext/node_modules/.bin/webpack",
    "/opt/containerbase/tools/node/*/bin/node", "/opt/*/bin/*/node_modules/.bin/bower", "/usr/local/bin/cursor-agent"
  ) or
  process.args like ("npx *", "node /var/www/html/ext/node_modules/.bin/webpack*", "grep* | awk*") or
  process.parent.executable like "/opt/jenkins/workspace/*/bin/node" or
  process.working_directory == "/runner/_work/personify/personify/node_modules/snyk" or
  (process.command_line like "*REPO_NAME*" and process.parent.command_line like "node /usr/bin/n8n*") or
  (process.parent.command_line == "node /var/www/html/fs-ws-api/controller/cronJob.js" and process.command_line like "/bin/sh -c nc -zv 10.*") or
  (
    process.parent.executable == "/opt/liongard/node/bin/node" and
    process.command_line in (
     "/bin/sh -c cut -d: -f1 /etc/passwd", "/bin/sh -c hostname", "/bin/sh -c sudo cat /etc/ssh/sshd_config", "/bin/sh -c whoami"
    )
  ) or
  (
    process.executable like "/opt/node-*-linux-x64/bin/node" and
    process.working_directory == "/aplicaciones/backend/label-printing" and
    process.command_line like "/bin/sh -c python3 ./socket/main.py*"
  ) or
  (process.parent.executable like "/opt/actions-runner/_work/_tool/node/*/x64/bin/node" and process.command_line == "/bin/sh -c cat /etc/os-release") or
  (process.parent.executable == "/opt/node/bin/node" and process.parent.command_line == "node /opt/node/bin/npm ci") or
  (
    process.parent.executable like "/opt/hostedtoolcache/node/*/x64/bin/node" and
    process.parent.args in ("install", "ci") and
    process.parent.args like "/opt/hostedtoolcache/node/*"
  ) or
  (process.parent.executable like "/opt/plesk/node/*/bin/node" and process.parent.args in ("install", "ci")) or
  (
    process.parent.command_line == "node /opt/app-root/app/build/index.js" and
    process.command_line == "/bin/sh -c netstat -tunlp"
  ) or
  process.parent.executable like (
    "*/.cursor-server/bin/linux-x64/*/node", "*/.vscode-server/*/node",
    "*/.vscode-server/cli/servers/*/server/node", "*/code-server/*/lib/node"
  )
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argsin
  • -c
  • -cl
  • -lc
  • hostname
  • id
  • whoami
field:"process.args" kind:in
process.command_linewildcard
  • * /dev/shm/*
  • * /run/*
  • * /tmp/*
  • * /var/run/*
  • * /var/tmp/*
  • * nc *
  • *#!*
  • *../../../*etc/*
  • *../../../*home/*/*
  • *../../../*root/*
  • *.aws/credentials*
  • */.../*
  • */.aws/config*
  • */.azure/*
  • */.config/gcloud/*
  • */.npmrc*
  • */dev/tcp*
  • */dev/udp/*
  • */etc/hostname*
  • */etc/hosts*
  • */etc/issue*
  • */etc/master.passwd*
  • */etc/os-release*
  • */etc/passwd*
  • */etc/resolv.conf*
  • */etc/shadow*
  • */etc/ssh*
  • */home/*/.ssh/*
  • */proc/*/cgroup*
  • */proc/*/environ*
  • */proc/*/mountinfo*
  • */root/.ssh*
  • */run/secrets/azure/*
  • */run/secrets/google/*
  • */secrets/kubernetes.io/serviceaccount/*
  • *<?php*?>*
  • *>*/etc/cron*
  • *AZURE_CLIENT_ID*
  • *AZURE_CLIENT_SECRET*
  • *AZURE_FEDERATED_TOKEN_FILE*
  • +84 more values (see full rule source)
field:"CommandLine" kind:wildcard
process.namein
  • bash
  • busybox
  • csh
  • dash
  • fish
  • ksh
  • mksh
  • sh
  • tcsh
  • zsh
field:"process_basename" kind:in
process.parent.command_linewildcard
  • *--port*
  • */app/*.js*
  • */apps/*/*.js*
  • */build/*.js*
  • */dist/*.js*
  • */index.js*
  • */main.js*
  • */opt/*
  • */server/*.js*
  • */srv/*
  • */var/www/*
  • *0.0.0.0*
  • *HOST=*
  • *PORT=*
  • *n8n*
  • *next start*
field:"ParentCommandLine" kind:wildcard
process.parent.interactiveeq
  • false transforms: boolean
field:"process.parent.interactive" kind:eq value:"false"
process.parent.nameeq
  • node
field:"parent_process_basename" kind:eq value:"node"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_lineeq/bin/sh -c cat /etc/os-releaseexcludes:process.command_line field:"process.command_line" value:"/bin/sh -c cat /etc/os-release"
process.parent.executablewildcard/opt/actions-runner/_work/_tool/node/*/x64/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/actions-runner/_work/_tool/node/*/x64/bin/node"
process.command_lineeq/bin/sh -c netstat -tunlpexcludes:process.command_line field:"process.command_line" value:"/bin/sh -c netstat -tunlp"
process.parent.command_lineeqnode /opt/app-root/app/build/index.jsexcludes:process.parent.command_line field:"process.parent.command_line" value:"node /opt/app-root/app/build/index.js"
process.command_linein/bin/sh -c cut -d: -f1 /etc/passwd, /bin/sh -c hostname, /bin/sh -c sudo cat /etc/ssh/sshd_config, /bin/sh -c whoamiexcludes:process.command_line
process.parent.executableeq/opt/liongard/node/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/liongard/node/bin/node"
process.command_linematchREPO_NAMEexcludes:process.command_line field:"process.command_line" value:"REPO_NAME"
process.parent.command_linestarts_withnode /usr/bin/n8nexcludes:process.parent.command_line field:"process.parent.command_line" value:"node /usr/bin/n8n"
process.command_linestarts_with/bin/sh -c nc -zv 10.excludes:process.command_line field:"process.command_line" value:"/bin/sh -c nc -zv 10."
process.parent.command_lineeqnode /var/www/html/fs-ws-api/controller/cronJob.jsexcludes:process.parent.command_line field:"process.parent.command_line" value:"node /var/www/html/fs-ws-api/controller/cronJob.js"
process.command_linestarts_with/bin/sh -c python3 ./socket/main.pyexcludes:process.command_line field:"process.command_line" value:"/bin/sh -c python3 ./socket/main.py"
process.executablewildcard/opt/node-*-linux-x64/bin/nodeexcludes:process.executable field:"process.executable" value:"/opt/node-*-linux-x64/bin/node"
process.working_directoryeq/aplicaciones/backend/label-printingexcludes:process.working_directory field:"process.working_directory" value:"/aplicaciones/backend/label-printing"
process.parent.argsinci, installexcludes:process.parent.args field:"process.parent.args" value:"ci" field:"process.parent.args" value:"install"
process.parent.argsstarts_with/opt/hostedtoolcache/node/excludes:process.parent.args field:"process.parent.args" value:"/opt/hostedtoolcache/node/"
process.parent.executablewildcard/opt/hostedtoolcache/node/*/x64/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/hostedtoolcache/node/*/x64/bin/node"
process.parent.executablewildcard/opt/plesk/node/*/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/plesk/node/*/bin/node"
process.parent.command_lineeqnode /opt/node/bin/npm ciexcludes:process.parent.command_line field:"process.parent.command_line" value:"node /opt/node/bin/npm ci"
process.parent.executableeq/opt/node/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/node/bin/node"
process.argswildcardnpx *, node /var/www/html/ext/node_modules/.bin/webpack*, grep* | awk*excludes:process.args field:"process.args" value:"npx *" field:"process.args" value:"node /var/www/html/ext/node_modules/.bin/webpack*" field:"process.args" value:"grep* | awk*"
process.command_linewildcardsh -c node -v || nodejs -v, *./postinstall*, *./_postinstall*, /bin/sh -c lsb_release -sd, */etc/freepbx.conf*, *betterme/image-processing-service-admin-frontend*, /bin/sh -c exit 0 || node patches/*.js, /bin/sh -c export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\|SYN_SENT\|SYN_RECV\|FIN_WAIT1\|FIN_WAIT2\|TIME_WAIT\|CLOSE\|CLOSE_WAIT\|LAST_ACK\|LISTEN\|CLOSING\|UNKNOWN"; unset LC_ALLexcludes:process.command_line
process.parent.argswildcard/opt/bitdefender/*, /opt/cursor-agent/*, /home/*/*, /root/*, /var/www/html/ext/.deloreanbuild, /usr/lib/node_modules/openclaw/dist/index.js, /opt/yarn*, *anthropic-ai/claude-code/cli.js*, /usr/bin/docker-builder, /opt/jenkins/.nvm/versions/node/*/bin/npm, /usr/local/renovate/node, /opt/buildagent/work/*/node_modules/.bin/cypress, /var/www/html/ext/node_modules/.bin/webpack, /opt/containerbase/tools/node/*/bin/node, /opt/*/bin/*/node_modules/.bin/bower, /usr/local/bin/cursor-agentexcludes:process.parent.args
process.parent.executablewildcard*/.cursor-server/bin/linux-x64/*/node, */.vscode-server/*/node, */.vscode-server/cli/servers/*/server/node, */code-server/*/lib/nodeexcludes:process.parent.executable
process.parent.executablewildcard/opt/jenkins/workspace/*/bin/nodeexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/jenkins/workspace/*/bin/node"
process.working_directoryeq/runner/_work/personify/personify/node_modules/snykexcludes:process.working_directory field:"process.working_directory" value:"/runner/_work/personify/personify/node_modules/snyk"

Persistence via TelemetryController Scheduled Task Hijack

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

Detects the successful hijack of Microsoft Compatibility Appraiser scheduled task to establish persistence with an integrity level of system.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects the successful hijack of Microsoft Compatibility Appraiser scheduled task to establish persistence with an
integrity level of 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 = "Persistence via TelemetryController Scheduled Task Hijack"
references = ["https://www.trustedsec.com/blog/abusing-windows-telemetry-for-persistence"]
risk_score = 73
rule_id = "68921d85-d0dc-48b3-865f-43291ca2c4f2"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.parent.name : "CompatTelRunner.exe" and process.args : "-cv*" and
  not process.name : ("conhost.exe",
                      "DeviceCensus.exe",
                      "CompatTelRunner.exe",
                      "DismHost.exe",
                      "rundll32.exe",
                      "powershell.exe")
'''

note = """## Triage and analysis

### Investigating Persistence via TelemetryController Scheduled Task Hijack

#### Possible investigation steps

- What behavior path did the alert preserve from CompatTelRunner to the child?
  - Why: "-cv" marks the TelemetryController handoff; the executable path before it is the key artifact.
  - Focus: `process.parent.executable`, `process.command_line`, `process.executable`, `process.Ext.token.integrity_level_name`, and `user.id`.
  - Implication: escalate when "CompatTelRunner.exe" launches a user-writable, script-hosted, renamed, or newly introduced child with SYSTEM context; lower suspicion only when the handoff resolves to a stable Microsoft telemetry component for this host, then still validate the registry state that produced it.

- Does the child binary identity match the command path and expected telemetry role?
  - Focus: `process.pe.original_file_name`, `process.hash.sha256`, `process.code_signature.subject_name`, `process.code_signature.trusted`, and `process.Ext.relative_file_creation_time`.
  - Implication: escalate when metadata, signer, hash, or recent file age conflicts with the path or Microsoft telemetry role; lower suspicion when identity, signer, path, and age fit a stable Windows or enterprise diagnostic binary.

- Which TelemetryController values enabled this launch, and which process wrote them?
  - Focus: recovered registry events on `host.id` for TelemetryController `registry.path`, `registry.value`, `registry.data.strings`, and writer `process.executable`.
  - Range: search back several days; the registry hijack can precede scheduled task execution.
  - Hint: search the TelemetryController root and subkeys, compare command-like `registry.data.strings` to the alert child, and treat registry telemetry as recovery evidence; missing registry history leaves persistence unresolved. Do not clear only because startup folders or service keys are clean.
  - Implication: escalate when a command value points to the alert child or another non-Windows binary or script and the same subkey enables execution; an unexpected writer exposes the privileged component that planted HKLM persistence. Lower suspicion only when values, writer, and child path all match one controlled diagnostic or test workflow.

- Did the launched child stage or reuse artifacts that extend the persistence chain?
  - Focus: same-process file events on `host.id` using `process.entity_id`, or `process.pid` in a tight alert window: `file.path`, `file.Ext.original.path`, `file.origin_url`, `file.Ext.windows.zone_identifier`, and later `process.executable` reuse. $investigate_0
  - Implication: escalate when the child writes executable or scriptable content to user-writable, startup, service, or task paths, especially with external provenance or later execution; absent file telemetry does not clear a suspicious command or registry handoff.

- Did the launched child contact destinations inconsistent with telemetry or the signer?
  - Focus: same-process DNS and connection events on `host.id`: `dns.question.name`, `dns.resolved_ip`, `destination.ip`, `destination.port`, and `destination.as.organization.name`. $investigate_1
  - Hint: Missing network telemetry is unresolved, not benign. Treat infrastructure ownership as context rather than a verdict.
  - Implication: escalate when the child reaches public, rare, or signer-misaligned infrastructure; lower suspicion when destinations consistently fit Microsoft telemetry, internal servicing, or the same verified diagnostic workflow.

- If local evidence remains suspicious or unresolved, is this a local test pattern or repeated TelemetryController persistence?
  - Focus: recent alerts for the same `process.executable` before broader host review. $investigate_2
  - Hint: use host alert history only after child identity, command line, registry, file, or network evidence remains suspicious or unresolved. $investigate_3
  - Implication: broaden when the same child path, TelemetryController pattern, or follow-on alert chain appears on unrelated hosts; keep scope local when telemetry ties the exact child, writer, values, and host scope to one verified lab or diagnostic workflow.

- Escalate when the handoff, child identity, registry writer/values, artifacts, destinations, or alert history show arbitrary or staged execution through TelemetryController; close only when the same evidence ties the exact child, writer, values, and scope to a controlled diagnostic or validation workflow; preserve artifacts and escalate when registry, file, or network evidence is missing or contradictory.

### False positive analysis

- Non-Microsoft TelemetryController command registration is an operational anti-pattern. Controlled image-validation or compatibility-lab workflows can still trigger this rule when they register a signed diagnostic or servicing binary. Close benign only when telemetry ties `process.command_line`, `process.executable`, `process.hash.sha256`, TelemetryController `registry.path`, `registry.data.strings`, writer `process.executable`, and the `host.id` cohort to the same build or lab workflow. Use records only as corroboration; before exceptioning, validate recurrence for the same payload identity, writer, value pattern, and lab-host scope.
- Authorized adversary-emulation or detection-validation tests can deliberately hijack TelemetryController. Close benign only when `process.command_line`, `process.hash.sha256`, TelemetryController `registry.path`, expected `host.id` or `user.id` test scope, and registry-writing `process.executable` all match exercise telemetry. Use engagement records only as corroboration; before exceptioning, verify the same payload hash or path and writer recur only on known test assets and not unrelated production hosts. Do not exception on `process.parent.name`, "CompatTelRunner.exe", "-cv", or `process.name` alone.

### Response and remediation

- If confirmed benign:
  - Record the TelemetryController `registry.path`, child `process.executable` or `process.hash.sha256`, writer `process.executable`, host scope, and telemetry that proved the workflow, then reverse any temporary containment. Build exceptions from that minimum pattern plus `host.id`, not from `process.parent.name`, "CompatTelRunner.exe", or "-cv" alone.
- If suspicious but unconfirmed:
  - Preserve the alert process record, recovered TelemetryController registry events, writer lineage, written `file.path` artifacts, and any `dns.question.name` or `destination.ip` indicators before cleanup.
  - Apply reversible containment tied to the findings, such as temporarily disabling the suspect TelemetryController subkey or blocking the child binary or destination. Escalate to host isolation only when host criticality allows it and same-process artifacts or destinations show active follow-on behavior.
- If confirmed malicious:
  - Isolate the host and terminate the malicious child only after recording the child process identity, command line, TelemetryController values, writer lineage, written `file.path`, `process.hash.sha256`, and destination indicators. If direct endpoint response is unavailable, escalate with that evidence set to the team that can contain the asset.
  - Remove the malicious TelemetryController subkey or restore its values to known-good state, then remove only the payloads and additional persistence artifacts identified during the investigation. Validate that the "Microsoft Compatibility Appraiser" task no longer launches the malicious child, and scope other hosts for the same child path or registry pattern before deleting artifacts.
- Post-incident hardening:
  - Restrict local admin rights on exposed hosts, keep process, registry, file, and network telemetry for this key family enabled, and record any TelemetryController visibility gaps in the case notes.
"""

setup = """## Setup

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

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

### Additional data sources

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

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.pid",
    "process.executable",
    "process.command_line",
    "process.pe.original_file_name",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "process.parent.executable",
    "process.parent.command_line",
    "process.Ext.token.integrity_level_name",
    "process.hash.sha256",
]

[transform]

[[transform.investigate]]
label = "File events for the launched child"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Network events for the launched child"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts involving the same child path"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "process.executable", queryType = "phrase", value = "{{process.executable}}", 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 = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"

[[rule.threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"

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

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

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

[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"

[[rule.threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.parent.name : "CompatTelRunner.exe" and process.args : "-cv*" and
  not process.name : ("conhost.exe",
                      "DeviceCensus.exe",
                      "CompatTelRunner.exe",
                      "DismHost.exe",
                      "rundll32.exe",
                      "powershell.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqconhost.exe, DeviceCensus.exe, CompatTelRunner.exe, DismHost.exe, rundll32.exe, powershell.exeexcludes:process.name

Potential Azure OpenAI Model Theft

#
Status
production
Severity
medium
Time window
1h
Group by
azure.resource.group, azure.resource.name
Author
Elastic
Source
github.com/elastic/detection-rules

Monitors for suspicious activities that may indicate theft or unauthorized duplication of machine learning (ML) models, such as unauthorized API calls, atypical access patterns, or large data transfers that are unusual during model interactions.

Known False Positives

  • Authorized model training
  • Legitimate high volume data exchanges during scheduled updates

MITRE ATLAS Coverage

Adversarial-ML threat framework (not MITRE ATT&CK).

TacticTechniques
AI Model Access

Rule Body

[metadata]
creation_date = "2025/02/25"
integration = ["azure_openai"]
maturity = "production"
updated_date = "2025/09/25"

[rule]
author = ["Elastic"]
description = """
Monitors for suspicious activities that may indicate theft or unauthorized duplication of machine learning (ML) models,
such as unauthorized API calls, atypical access patterns, or large data transfers that are unusual during model
interactions.
"""
false_positives = ["Authorized model training", "Legitimate high volume data exchanges during scheduled updates"]
from = "now-60m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Potential Azure OpenAI Model Theft"
note = """## Triage and analysis

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

### Investigating Potential Azure OpenAI Model Theft

Azure OpenAI models are integral to many applications, providing advanced machine learning capabilities. Adversaries may exploit these models by making unauthorized API calls or transferring large volumes of data, potentially indicating model theft. The detection rule identifies such threats by monitoring audit logs for unusual access patterns or excessive data transfers, flagging activities that deviate from normal usage.

### Possible investigation steps

- Review the audit logs for the specific resource group and resource name flagged in the alert to understand the context of the access patterns.
- Analyze the timestamps associated with the suspicious activities to determine if they align with known operational periods or if they occur during unusual times.
- Investigate the source of the API calls by identifying the IP addresses or user accounts involved in the "ListKey" operations to determine if they are authorized or known entities.
- Examine the response length data to assess whether the volume of data transferred is consistent with legitimate use cases or if it suggests potential data exfiltration.
- Cross-reference the flagged activities with other security logs or alerts to identify any correlated suspicious behavior or potential indicators of compromise.

### False positive analysis

- High-frequency legitimate API calls from automated scripts or applications may trigger the rule. Users can create exceptions for known scripts by identifying their specific access patterns and excluding them from the rule.
- Large data transfers during scheduled model updates or backups can be mistaken for suspicious activity. Users should whitelist these operations by correlating them with scheduled maintenance windows or known update events.
- Regular access by trusted internal teams for model evaluation or testing might appear as atypical patterns. Users can mitigate this by maintaining a list of authorized personnel and their expected access behaviors, then excluding these from the alert criteria.
- Integration with other Azure services that require frequent access to OpenAI models could generate false positives. Users should document these integrations and adjust the rule to recognize and exclude these legitimate interactions.

### Response and remediation

- Immediately isolate the affected Azure resources by restricting network access to prevent further unauthorized API calls or data transfers.
- Revoke and regenerate API keys associated with the compromised Azure OpenAI resources to prevent further unauthorized access.
- Conduct a thorough review of audit logs to identify any additional unauthorized access attempts or data transfers, and document all findings for further analysis.
- Notify the security operations team and relevant stakeholders about the potential model theft incident to ensure coordinated response efforts.
- Implement additional monitoring on the affected resources to detect any further suspicious activities, focusing on access patterns and data transfer volumes.
- Escalate the incident to the organization's incident response team for a comprehensive investigation and to determine if any data exfiltration occurred.
- Review and update access controls and permissions for Azure OpenAI resources to ensure they adhere to the principle of least privilege, reducing the risk of future unauthorized access.
"""
references = ["https://genai.owasp.org/llmrisk/llm10-model-theft", "https://atlas.mitre.org/techniques/AML.T0044"]
risk_score = 47
rule_id = "4021e78d-5293-48d3-adee-a70fa4c18fab"
setup = """## Setup

For more information on
streaming events, see the Azure OpenAI documentation:

https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/stream-monitoring-data-event-hubs
"""
severity = "medium"
tags = [
    "Domain: LLM",
    "Data Source: Azure OpenAI",
    "Data Source: Azure Event Hubs",
    "Use Case: Model Theft",
    "Mitre Atlas: T0044",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-azure_openai.logs-*
| where
    azure.open_ai.operation_name == "ListKey" and
    azure.open_ai.category == "Audit"
| keep
    @timestamp,
    azure.open_ai.operation_name,
    azure.open_ai.category,
    azure.resource.group,
    azure.resource.name,
    azure.open_ai.properties.response_length
| stats
    Esql.event_count = count(*),
    Esql.azure_open_ai_properties_response_length_max = max(azure.open_ai.properties.response_length)
  by
    azure.resource.group,
    azure.resource.name
| where
    Esql.event_count >= 100 or
    Esql.azure_open_ai_properties_response_length_max >= 1000000
| sort
    Esql.event_count desc
'''

Stages and Predicates

Stage 1: from

from logs-azure_openai.logs-*

Stage 2: where

| where
    azure.open_ai.operation_name == "ListKey" and
    azure.open_ai.category == "Audit"

Stage 3: keep

| keep
    @timestamp,
    azure.open_ai.operation_name,
    azure.open_ai.category,
    azure.resource.group,
    azure.resource.name,
    azure.open_ai.properties.response_length

Stage 4: stats

| stats
    Esql.event_count = count(*),
    Esql.azure_open_ai_properties_response_length_max = max(azure.open_ai.properties.response_length)
  by
    azure.resource.group,
    azure.resource.name

Stage 5: where

| where
    Esql.event_count >= 100 or
    Esql.azure_open_ai_properties_response_length_max >= 1000000

Stage 6: sort

| sort
    Esql.event_count desc

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.event_countSTATS Esql.event_count = count(*)
Esql.azure_open_ai_properties_response_length_maxSTATS Esql.azure_open_ai_properties_response_length_max = max(azure.open_ai.properties.response_length)
azure.resource.groupSTATS BY
azure.resource.nameSTATS BY

Suspicious Lsass Process Access

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

Identifies access attempts to LSASS handle, this may indicate an attempt to dump credentials from Lsass memory.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 10: ProcessAccess

Rule Body

[metadata]
creation_date = "2023/01/22"
integration = ["windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = "Identifies access attempts to LSASS handle, this may indicate an attempt to dump credentials from Lsass memory.\n"
from = "now-9m"
index = ["winlogbeat-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Lsass Process Access"
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 Lsass Process Access

The Local Security Authority Subsystem Service (LSASS) is crucial for enforcing security policies and managing user logins in Windows environments. Adversaries often target LSASS to extract credentials, enabling unauthorized access. The detection rule identifies unusual access attempts to LSASS by filtering out legitimate processes and access patterns, focusing on anomalies that suggest credential dumping activities.

### Possible investigation steps

- Review the process details that triggered the alert, focusing on the process name and executable path to determine if it is a known legitimate application or potentially malicious.
- Examine the GrantedAccess value in the event data to understand the level of access attempted on the LSASS process and compare it against typical access patterns.
- Investigate the parent process of the suspicious process to identify how it was spawned and assess if it is part of a legitimate workflow or an anomaly.
- Check the CallTrace field for any unusual or suspicious DLLs that might indicate malicious activity or exploitation attempts.
- Correlate the alert with other security events or logs from the same host to identify any related suspicious activities or patterns, such as network connections or file modifications.
- Verify the host's security posture, including the status of antivirus or endpoint protection solutions, to ensure they are functioning correctly and have not been tampered with.

### False positive analysis

- Legitimate security tools like Sysinternals Process Explorer and Process Monitor can trigger false positives. Exclude these by adding their process names to the exception list.
- Windows Defender and other antivirus software may access LSASS for legitimate scanning purposes. Exclude their executable paths from the detection rule to prevent false alerts.
- System processes such as csrss.exe, lsm.exe, and wmiprvse.exe are known to access LSASS as part of normal operations. Ensure these are included in the process executable exceptions to avoid unnecessary alerts.
- Software updates and installers, like those from Cisco AnyConnect or Oracle, may access LSASS during legitimate operations. Add these specific paths to the exclusion list to reduce false positives.
- Custom enterprise applications that interact with LSASS for authentication purposes should be identified and their paths added to the exceptions to prevent disruption in monitoring.

### Response and remediation

- Isolate the affected system from the network immediately to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes identified in the alert that are attempting to access the LSASS process, ensuring that legitimate processes are not disrupted.
- Conduct a memory dump analysis of the affected system to identify any malicious tools or scripts used for credential dumping, focusing on the LSASS process.
- Change all potentially compromised credentials, especially those with administrative privileges, to prevent unauthorized access using stolen credentials.
- Apply patches and updates to the affected system to address any vulnerabilities that may have been exploited by the adversary.
- Monitor the network for any signs of further suspicious activity or attempts to access LSASS on other systems, using enhanced logging and alerting mechanisms.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = ["https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1003.001/T1003.001.md"]
risk_score = 47
rule_id = "128468bf-cab1-4637-99ea-fdf3780a4609"
setup = """## Setup

This rule requires Sysmon telemetry to be enabled and ingested.

Setup instructions: https://ela.st/sysmon-event-10-setup
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.code == "10" and
  winlog.event_data.TargetImage : "?:\\WINDOWS\\system32\\lsass.exe" and
  not winlog.event_data.GrantedAccess :
                ("0x1000", "0x1400", "0x101400", "0x101000", "0x101001", "0x100000", "0x100040", "0x3200", "0x40", "0x3200") and
  not process.name : ("procexp64.exe", "procmon.exe", "procexp.exe", "Microsoft.Identity.AadConnect.Health.AadSync.Host.ex") and
  not process.executable : (
        "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*",
        "?:\\ProgramData\\WebEx\\webex\\*",
        "?:\\Program Files (x86)\\*",
        "?:\\Program Files\\*",
        "?:\\Windows\\CCM\\CcmExec.exe",
        "?:\\Windows\\LTSvc\\LTSVC.exe",
        "?:\\Windows\\Sysmon.exe",
        "?:\\Windows\\Sysmon64.exe",
        "C:\\Windows\\CynetMS.exe",
        "?:\\Windows\\system32\\csrss.exe",
        "?:\\Windows\\System32\\lsm.exe",
        "?:\\Windows\\system32\\MRT.exe",
        "?:\\Windows\\System32\\msiexec.exe",
        "?:\\Windows\\system32\\wbem\\wmiprvse.exe",
        "?:\\Windows\\system32\\wininit.exe",
        "?:\\Windows\\SystemTemp\\GUM*.tmp\\GoogleUpdate.exe",
        "?:\\Windows\\sysWOW64\\wbem\\wmiprvse.exe",
        "C:\\oracle\\64\\02\\instantclient_19_13\\sqlplus.exe",
        "C:\\oracle\\64\\02\\instantclient_19_13\\sqlldr.exe",
        "d:\\oracle\\product\\19\\dbhome1\\bin\\ORACLE.EXE",
        "C:\\wamp\\bin\\apache\\apache*\\bin\\httpd.exe",
        "C:\\Windows\\system32\\netstat.exe",
        "C:\\PROGRA~1\\INFORM~1\\apps\\jdk\\*\\jre\\bin\\java.exe",
        "C:\\PROGRA~2\\CyberCNSAgentV2\\osqueryi.exe",
        "C:\\Utilityw2k19\\packetbeat\\packetbeat.exe",
        "C:\\ProgramData\\Cisco\\Cisco AnyConnect Secure Mobility Client\\Temp\\CloudUpdate\\vpndownloader.exe",
        "C:\\ProgramData\\Cisco\\Cisco Secure Client\\Temp\\CloudUpdate\\vpndownloader.exe"
  ) and
  not winlog.event_data.CallTrace : ("*mpengine.dll*", "*appresolver.dll*", "*sysmain.dll*")
'''


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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.code == "10" and
  winlog.event_data.TargetImage : "?:\\WINDOWS\\system32\\lsass.exe" and
  not winlog.event_data.GrantedAccess :
                ("0x1000", "0x1400", "0x101400", "0x101000", "0x101001", "0x100000", "0x100040", "0x3200", "0x40", "0x3200") and
  not process.name : ("procexp64.exe", "procmon.exe", "procexp.exe", "Microsoft.Identity.AadConnect.Health.AadSync.Host.ex") and
  not process.executable : (
        "?:\\ProgramData\\Microsoft\\Windows Defender\\platform\\*",
        "?:\\ProgramData\\WebEx\\webex\\*",
        "?:\\Program Files (x86)\\*",
        "?:\\Program Files\\*",
        "?:\\Windows\\CCM\\CcmExec.exe",
        "?:\\Windows\\LTSvc\\LTSVC.exe",
        "?:\\Windows\\Sysmon.exe",
        "?:\\Windows\\Sysmon64.exe",
        "C:\\Windows\\CynetMS.exe",
        "?:\\Windows\\system32\\csrss.exe",
        "?:\\Windows\\System32\\lsm.exe",
        "?:\\Windows\\system32\\MRT.exe",
        "?:\\Windows\\System32\\msiexec.exe",
        "?:\\Windows\\system32\\wbem\\wmiprvse.exe",
        "?:\\Windows\\system32\\wininit.exe",
        "?:\\Windows\\SystemTemp\\GUM*.tmp\\GoogleUpdate.exe",
        "?:\\Windows\\sysWOW64\\wbem\\wmiprvse.exe",
        "C:\\oracle\\64\\02\\instantclient_19_13\\sqlplus.exe",
        "C:\\oracle\\64\\02\\instantclient_19_13\\sqlldr.exe",
        "d:\\oracle\\product\\19\\dbhome1\\bin\\ORACLE.EXE",
        "C:\\wamp\\bin\\apache\\apache*\\bin\\httpd.exe",
        "C:\\Windows\\system32\\netstat.exe",
        "C:\\PROGRA~1\\INFORM~1\\apps\\jdk\\*\\jre\\bin\\java.exe",
        "C:\\PROGRA~2\\CyberCNSAgentV2\\osqueryi.exe",
        "C:\\Utilityw2k19\\packetbeat\\packetbeat.exe",
        "C:\\ProgramData\\Cisco\\Cisco AnyConnect Secure Mobility Client\\Temp\\CloudUpdate\\vpndownloader.exe",
        "C:\\ProgramData\\Cisco\\Cisco Secure Client\\Temp\\CloudUpdate\\vpndownloader.exe"
  ) and
  not winlog.event_data.CallTrace : ("*mpengine.dll*", "*appresolver.dll*", "*sysmain.dll*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.codeeq
  • 10 corpus 7 (elastic 6, kusto 1)
field:"EventID" kind:eq value:"10"
winlog.event_data.TargetImagewildcard
  • ?:\WINDOWS\system32\lsass.exe corpus 4 (elastic 4)
field:"TargetImage" kind:wildcard value:"?:\WINDOWS\system32\lsass.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\ProgramData\Microsoft\Windows Defender\platform\*, ?:\ProgramData\WebEx\webex\*, ?:\Program Files (x86)\*, ?:\Program Files\*, ?:\Windows\CCM\CcmExec.exe, ?:\Windows\LTSvc\LTSVC.exe, ?:\Windows\Sysmon.exe, ?:\Windows\Sysmon64.exe, C:\Windows\CynetMS.exe, ?:\Windows\system32\csrss.exe, ?:\Windows\System32\lsm.exe, ?:\Windows\system32\MRT.exe, ?:\Windows\System32\msiexec.exe, ?:\Windows\system32\wbem\wmiprvse.exe, ?:\Windows\system32\wininit.exe, ?:\Windows\SystemTemp\GUM*.tmp\GoogleUpdate.exe, ?:\Windows\sysWOW64\wbem\wmiprvse.exe, C:\oracle\64\02\instantclient_19_13\sqlplus.exe, C:\oracle\64\02\instantclient_19_13\sqlldr.exe, d:\oracle\product\19\dbhome1\bin\ORACLE.EXE, C:\wamp\bin\apache\apache*\bin\httpd.exe, C:\Windows\system32\netstat.exe, C:\PROGRA~1\INFORM~1\apps\jdk\*\jre\bin\java.exe, C:\PROGRA~2\CyberCNSAgentV2\osqueryi.exe, C:\Utilityw2k19\packetbeat\packetbeat.exe, C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Temp\CloudUpdate\vpndownloader.exe, C:\ProgramData\Cisco\Cisco Secure Client\Temp\CloudUpdate\vpndownloader.exeexcludes:process.executable
process.nameeqprocexp64.exe, procmon.exe, procexp.exe, Microsoft.Identity.AadConnect.Health.AadSync.Host.exexcludes:process.name
winlog.event_data.CallTracematchmpengine.dll, appresolver.dll, sysmain.dllexcludes:winlog.event_data.CallTrace field:"winlog.event_data.CallTrace" value:"mpengine.dll" field:"winlog.event_data.CallTrace" value:"appresolver.dll" field:"winlog.event_data.CallTrace" value:"sysmain.dll"
winlog.event_data.GrantedAccesseq0x1000, 0x1400, 0x101400, 0x101000, 0x101001, 0x100000, 0x100040, 0x3200, 0x40, 0x3200excludes:winlog.event_data.GrantedAccess

Suspicious Microsoft Office Child Process

#
Source
github.com/elastic/protections-artifacts

Identifies suspicious child processes of frequently targeted Microsoft Office applications (Word, PowerPoint, Excel). These child processes are often launched during exploitation of Office applications or from documents with malicious macros.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[rule]
description = """
Identifies suspicious child processes of frequently targeted Microsoft Office applications (Word, PowerPoint, Excel).
These child processes are often launched during exploitation of Office applications or from documents with malicious
macros.
"""
id = "c34a9dca-66cf-4283-944d-1800b28ae690"
license = "Elastic License v2"
name = "Suspicious Microsoft Office Child Process"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/"]
version = "1.0.39"

query = '''
process where event.action == "start" and
  process.parent.name : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (
		(process.pe.original_file_name : (
		    "rundll32.exe", 
		    "regsvr32.exe", 
		    "bitsadmin.exe",
		    "certutil.exe", 
		    "installutil.exe", 
		    "schtasks.exe", 
		    "wmic.exe", 
		    "cscript.exe",
		    "cmstp.exe", 
		    "Microsoft.Workflow.Compiler.exe", 
		    "regasm.exe", 
		    "regsvcs.exe", 
		    "mshta.exe", 
		    "msxsl.exe", 
		    "ieexec.exe", 
		    "sc.exe",
		    "javaw.exe",
		    "pcalua.exe",
		    "curl.exe",
		    "ScriptRunner.exe",
		    "CertOC.exe",
		    "Workfolders.exe",
		    "odbcconf.exe",
		    "extrac32.exe",
		    "expand"
		   ) and
		not process.args : ("-Embedding", "-hashfile")
		) or
		
		(process.pe.original_file_name : "wscript.exe" and
		 process.command_line : ("*:\\ProgramData\\*",
		                         "*:\\Users\\Public\\*",
		                         "*\\AppData\\*",
		                         "*\\Windows\\Temp\\*",
		                         /* CVE-2021-40444 */
		                         "*../../..*", "*..\\..\\*", "*js:..*", "*vbs:..*", "*wsf:..*", "*jse:..*", "*vbe:..*")) or
		
		(process.pe.original_file_name : "msiexec.exe" and process.args : "http*") or
		/* Issue #439 */
		(process.name : "explorer.exe" and
		 process.args : ("*.hta*", "*.vb*", "*.wsh*", "*.js*", "*.ps*", "*.scr*", "*.pif*", "*bat*", "*.cmd*") and
		 /* FPs related to execution from file share */
		 not process.working_directory : "\\\\*"
		 ) or

		/* Masquerading as WerFault or Splwow64 both of which are common MS Office Child Processes */
		(process.name : ("WerFault.exe", "splwow64.exe") and process.args_count == 1) or

        /* in the wild 0 day - 52945af1def85b171870b31fa4782e52 */
		(process.pe.original_file_name == "msdt.exe" and process.command_line : "*IT_BrowseForFile*")

  ) and

	/* FP related to printing */
	not (process.name : "rundll32.exe" and process.command_line : "*\\system32\\spool\\*") and

	/* Issue #458 */
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll")) and

    /* Issue #568 */
	not (process.name : "schtasks.exe" and process.args : "/change" and process.args : "Microsoft\\Office\\Office Serviceability Manager") and

	/* Issue #568 */
	not (process.name : "regsvr32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\system32\\*.dll", "?:\\Windows\\system32\\*.ocx")) and

	not (process.executable : "?:\\Windows\\hh.exe" and process.args : "-mapid") and
	not (process.executable : "?:\\Windows\\System32\\sc.exe" and process.args : "queryex") and
	not (process.name : "rundll32.exe" and process.command_line : ("?:\\Windows\\SysWOW64\\rundll32.exe --eoim", "*--enable-speech-input --auto-scan-plugin --lang=*")) and
	not (process.name : "RegAsm.exe" and process.args :  "?:\\Program Files (x86)\\Thomson Reuters\\WSF\\*.dll") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
	                     "printui.dll,PrintUIEntry",
	                     "InetCpl.cpl,ClearMyTracksByProcess",
	                     "url.dll,FileProtocolHandler")) and
	not (process.name : "hh.exe" and process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files (x86)\\*")) and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\WINDOWS\\SysWOW64\\rundll32.exe\" --eoim") and
	not (process.name : "rundll32.exe" and process.args : "?:\\PROGRA~2\\MICROS~*\\Office*\\GrooveUtil.DLL,GetResourceModulePath") and
	not (process.name : "hh.exe" and process.args : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and
	not (process.name : "javaw.exe" and process.args : "?:\\PROGRA~2\\Andar\\ANDARP~1\\bin\\andar.jar") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Windows\\System32\\LogiLDA.dll,LogiFetch", "?:\\Windows\\System32\\dfshim.dll,ShOpenVerbShortcut")) and
	not (process.name : "rundll32.exe" and process.args : "-localserver" and process.args : "22d8c27b-47a1-48d1-ad08-7da7abd79617") and
	not process.executable : "?:\\Program Files (x86)\\Andar\\Jre*\\bin\\javaw.exe" and
	not (process.name : "mshta.exe" and process.args : "vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))") and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\Windows\\system32\\rundll32.exe\" --eoim")
'''

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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.parent.name : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (
		(process.pe.original_file_name : (
		    "rundll32.exe",
		    "regsvr32.exe",
		    "bitsadmin.exe",
		    "certutil.exe",
		    "installutil.exe",
		    "schtasks.exe",
		    "wmic.exe",
		    "cscript.exe",
		    "cmstp.exe",
		    "Microsoft.Workflow.Compiler.exe",
		    "regasm.exe",
		    "regsvcs.exe",
		    "mshta.exe",
		    "msxsl.exe",
		    "ieexec.exe",
		    "sc.exe",
		    "javaw.exe",
		    "pcalua.exe",
		    "curl.exe",
		    "ScriptRunner.exe",
		    "CertOC.exe",
		    "Workfolders.exe",
		    "odbcconf.exe",
		    "extrac32.exe",
		    "expand"
		   ) and
		not process.args : ("-Embedding", "-hashfile")
		) or
		(process.pe.original_file_name : "wscript.exe" and
		 process.command_line : ("*:\\ProgramData\\*",
		                         "*:\\Users\\Public\\*",
		                         "*\\AppData\\*",
		                         "*\\Windows\\Temp\\*",
		                         "*../../..*", "*..\\..\\*", "*js:..*", "*vbs:..*", "*wsf:..*", "*jse:..*", "*vbe:..*")) or
		(process.pe.original_file_name : "msiexec.exe" and process.args : "http*") or
		(process.name : "explorer.exe" and
		 process.args : ("*.hta*", "*.vb*", "*.wsh*", "*.js*", "*.ps*", "*.scr*", "*.pif*", "*bat*", "*.cmd*") and
		 not process.working_directory : "\\\\*"
		 ) or
		(process.name : ("WerFault.exe", "splwow64.exe") and process.args_count == 1) or
		(process.pe.original_file_name == "msdt.exe" and process.command_line : "*IT_BrowseForFile*")
  ) and
	not (process.name : "rundll32.exe" and process.command_line : "*\\system32\\spool\\*") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll")) and
	not (process.name : "schtasks.exe" and process.args : "/change" and process.args : "Microsoft\\Office\\Office Serviceability Manager") and
	not (process.name : "regsvr32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\system32\\*.dll", "?:\\Windows\\system32\\*.ocx")) and
	not (process.executable : "?:\\Windows\\hh.exe" and process.args : "-mapid") and
	not (process.executable : "?:\\Windows\\System32\\sc.exe" and process.args : "queryex") and
	not (process.name : "rundll32.exe" and process.command_line : ("?:\\Windows\\SysWOW64\\rundll32.exe --eoim", "*--enable-speech-input --auto-scan-plugin --lang=*")) and
	not (process.name : "RegAsm.exe" and process.args :  "?:\\Program Files (x86)\\Thomson Reuters\\WSF\\*.dll") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
	                     "printui.dll,PrintUIEntry",
	                     "InetCpl.cpl,ClearMyTracksByProcess",
	                     "url.dll,FileProtocolHandler")) and
	not (process.name : "hh.exe" and process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files (x86)\\*")) and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\WINDOWS\\SysWOW64\\rundll32.exe\" --eoim") and
	not (process.name : "rundll32.exe" and process.args : "?:\\PROGRA~2\\MICROS~*\\Office*\\GrooveUtil.DLL,GetResourceModulePath") and
	not (process.name : "hh.exe" and process.args : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and
	not (process.name : "javaw.exe" and process.args : "?:\\PROGRA~2\\Andar\\ANDARP~1\\bin\\andar.jar") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Windows\\System32\\LogiLDA.dll,LogiFetch", "?:\\Windows\\System32\\dfshim.dll,ShOpenVerbShortcut")) and
	not (process.name : "rundll32.exe" and process.args : "-localserver" and process.args : "22d8c27b-47a1-48d1-ad08-7da7abd79617") and
	not process.executable : "?:\\Program Files (x86)\\Andar\\Jre*\\bin\\javaw.exe" and
	not (process.name : "mshta.exe" and process.args : "vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))") and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\Windows\\system32\\rundll32.exe\" --eoim")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • *.cmd* corpus 2 (elastic 2)
  • *.hta* corpus 2 (elastic 2)
  • *.js* corpus 2 (elastic 2)
  • *.pif* corpus 2 (elastic 2)
  • *.ps* corpus 2 (elastic 2)
  • *.scr* corpus 2 (elastic 2)
  • *.vb* corpus 2 (elastic 2)
  • *.wsh* corpus 2 (elastic 2)
  • *bat* corpus 2 (elastic 2)
  • http* corpus 8 (elastic 8)
field:"process.args" kind:wildcard
process.args_counteq
  • 1 transforms: number corpus 50 (elastic 50)
field:"process.args_count" kind:eq value:"1"
process.command_linewildcard
  • *../../..*
  • *..\..\* corpus 2 (elastic 2)
  • *:\ProgramData\* corpus 11 (sigma 9, elastic 2)
  • *:\Users\Public\* corpus 20 (sigma 18, elastic 2)
  • *IT_BrowseForFile*
  • *\AppData\* corpus 11 (sigma 8, elastic 3)
  • *\Windows\Temp\* corpus 13 (sigma 12, elastic 1)
  • *js:..*
  • *jse:..*
  • *vbe:..*
  • *vbs:..*
  • *wsf:..*
field:"CommandLine" kind:wildcard
process.namewildcard
  • WerFault.exe corpus 7 (elastic 7)
  • explorer.exe corpus 21 (elastic 19, splunk 2)
  • splwow64.exe
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • powerpnt.exe corpus 23 (elastic 23)
  • winword.exe corpus 26 (elastic 26)
field:"parent_process_basename" kind:wildcard
process.pe.original_file_nameeq
  • msdt.exe corpus 3 (elastic 3)
field:"OriginalFileName" kind:eq value:"msdt.exe"
process.pe.original_file_namewildcard
  • CertOC.exe corpus 8 (sigma 6, elastic 2)
  • Microsoft.Workflow.Compiler.exe corpus 11 (elastic 6, sigma 3, splunk 2)
  • ScriptRunner.exe corpus 6 (sigma 3, elastic 3)
  • Workfolders.exe corpus 4 (sigma 2, elastic 2)
  • bitsadmin.exe corpus 19 (sigma 9, elastic 8, splunk 2)
  • certutil.exe corpus 26 (sigma 14, elastic 6, splunk 6)
  • cmstp.exe corpus 9 (sigma 5, elastic 4)
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • curl.exe corpus 22 (sigma 13, elastic 6, splunk 3)
  • expand
  • extrac32.exe corpus 2 (sigma 1, elastic 1)
  • ieexec.exe corpus 5 (sigma 3, elastic 2)
  • installutil.exe corpus 19 (elastic 9, sigma 6, splunk 4)
  • javaw.exe corpus 4 (sigma 2, elastic 2)
  • mshta.exe corpus 40 (elastic 21, sigma 13, splunk 6)
  • msiexec.exe corpus 18 (elastic 9, sigma 5, splunk 4)
  • msxsl.exe corpus 9 (elastic 6, sigma 3)
  • odbcconf.exe corpus 11 (sigma 9, elastic 2)
  • pcalua.exe corpus 4 (sigma 2, elastic 2)
  • regasm.exe corpus 13 (sigma 6, elastic 6, splunk 1)
  • regsvcs.exe corpus 12 (elastic 6, sigma 5, splunk 1)
  • regsvr32.exe corpus 37 (sigma 17, elastic 15, splunk 5)
  • rundll32.exe corpus 72 (sigma 35, splunk 21, elastic 16)
  • sc.exe corpus 28 (sigma 12, splunk 10, elastic 6)
  • schtasks.exe corpus 29 (sigma 18, elastic 7, splunk 4)
  • wmic.exe corpus 74 (sigma 38, elastic 18, splunk 18)
  • wscript.exe corpus 37 (elastic 20, sigma 17)
field:"OriginalFileName" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-localserverexcludes:process.args field:"process.args" value:"-localserver"
process.argseq22d8c27b-47a1-48d1-ad08-7da7abd79617excludes:process.args field:"process.args" value:"22d8c27b-47a1-48d1-ad08-7da7abd79617"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.argseq-mapidexcludes:process.args field:"process.args" value:"-mapid"
process.executableeq?:\Windows\hh.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\hh.exe"
process.argseq/changeexcludes:process.args field:"process.args" value:"/change"
process.argseqMicrosoft\Office\Office Serviceability Managerexcludes:process.args field:"process.args" value:"Microsoft\Office\Office Serviceability Manager"
process.nameeqschtasks.exeexcludes:process.name field:"process.name" value:"schtasks.exe"
process.argseq?:\PROGRA~2\Andar\ANDARP~1\bin\andar.jarexcludes:process.args field:"process.args" value:"?:\PROGRA~2\Andar\ANDARP~1\bin\andar.jar"
process.nameeqjavaw.exeexcludes:process.name field:"process.name" value:"javaw.exe"
process.argseq?:\WINDOWS\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification, printui.dll,PrintUIEntry, InetCpl.cpl,ClearMyTracksByProcess, url.dll,FileProtocolHandlerexcludes:process.args
process.argseq?:\Windows\System32\LogiLDA.dll,LogiFetch, ?:\Windows\System32\dfshim.dll,ShOpenVerbShortcutexcludes:process.args field:"process.args" value:"?:\Windows\System32\LogiLDA.dll,LogiFetch" field:"process.args" value:"?:\Windows\System32\dfshim.dll,ShOpenVerbShortcut"
process.argseqqueryexexcludes:process.args field:"process.args" value:"queryex"
process.executableeq?:\Windows\System32\sc.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\sc.exe"
process.argseqvbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))excludes:process.args field:"process.args" value:"vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))"
process.nameeqmshta.exeexcludes:process.name field:"process.name" value:"mshta.exe"
process.argsmatch:\Program Files\, :\Program Files (x86)\excludes:process.args field:"process.args" value:":\Program Files\" field:"process.args" value:":\Program Files (x86)\"
process.nameeqhh.exeexcludes:process.name field:"process.name" value:"hh.exe"
process.argsstarts_with?:\Program Files (x86)\, ?:\Program Files (x86)\excludes:process.args field:"process.args" value:"?:\Program Files (x86)\" field:"process.args" value:"?:\Program Files (x86)\"
process.argswildcard?:\PROGRA~2\MICROS~*\Office*\GrooveUtil.DLL,GetResourceModulePathexcludes:process.args field:"process.args" value:"?:\PROGRA~2\MICROS~*\Office*\GrooveUtil.DLL,GetResourceModulePath"
process.argswildcard?:\Program Files (x86)\Thomson Reuters\WSF\*.dllexcludes:process.args field:"process.args" value:"?:\Program Files (x86)\Thomson Reuters\WSF\*.dll"
process.nameeqRegAsm.exeexcludes:process.name field:"process.name" value:"RegAsm.exe"
process.argswildcard?:\Program Files\*, ?:\Program Files (x86)\*, ?:\Windows\system32\*.dll, ?:\Windows\system32\*.ocxexcludes:process.args
process.nameeqregsvr32.exeexcludes:process.name field:"process.name" value:"regsvr32.exe"
process.argswildcard?:\Program Files\*, ?:\Program Files (x86)\*, ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile, shwebsvc.dll,AddNetPlaceRunDllexcludes:process.args
process.command_lineeq"C:\WINDOWS\SysWOW64\rundll32.exe" --eoimexcludes:process.command_line
process.command_lineeq"C:\Windows\system32\rundll32.exe" --eoimexcludes:process.command_line
process.command_linematch\system32\spool\excludes:process.command_line field:"process.command_line" value:"\system32\spool\"
process.command_linewildcard?:\Windows\SysWOW64\rundll32.exe --eoim, *--enable-speech-input --auto-scan-plugin --lang=*excludes:process.command_line field:"process.command_line" value:"?:\Windows\SysWOW64\rundll32.exe --eoim" field:"process.command_line" value:"*--enable-speech-input --auto-scan-plugin --lang=*"
process.executablewildcard?:\Program Files (x86)\Andar\Jre*\bin\javaw.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Andar\Jre*\bin\javaw.exe"

Unusual Login via System User

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

This rule identifies successful logins by system users that are uncommon to authenticate. These users have "nologin" set by default, and must be modified to allow SSH access. Adversaries may backdoor these users to gain unauthorized access to the system.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/01/07"
integration = ["system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule identifies successful logins by system users that are uncommon to authenticate. These users
have "nologin" set by default, and must be modified to allow SSH access. Adversaries may backdoor these users to
gain unauthorized access to the system.
"""
from = "now-9m"
index = ["filebeat-*", "logs-system.auth-*"]
language = "kuery"
license = "Elastic License v2"
name = "Unusual Login via System User"
note = """## Triage and analysis

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

### Investigating Unusual Login via System User

In Linux environments, system users typically have restricted login capabilities to prevent unauthorized access. These accounts, often set with `nologin`, are not meant for interactive sessions. Adversaries may exploit these accounts by altering their configurations to enable SSH access, thus bypassing standard security measures. The detection rule identifies successful logins by these uncommon system users, flagging potential unauthorized access attempts for further investigation.

### Possible investigation steps

- Review the login event details to identify the specific system user account involved in the successful login, focusing on the user.name field.
- Check the system logs for any recent changes to the user account's configuration, particularly modifications that might have enabled SSH access for accounts typically set with nologin.
- Investigate the source IP address associated with the login event to determine if it is known or suspicious, and assess whether it aligns with expected access patterns.
- Examine the timeline of events leading up to and following the login to identify any unusual activities or patterns that could indicate malicious behavior.
- Verify if there are any other successful login attempts from the same source IP or involving other system user accounts, which could suggest a broader compromise.
- Consult with system administrators to confirm whether any legitimate changes were made to the system user account's login capabilities and document any authorized modifications.

### False positive analysis

- System maintenance tasks may require temporary login access for system users. Verify if the login corresponds with scheduled maintenance and consider excluding these events during known maintenance windows.
- Automated scripts or services might use system accounts for legitimate purposes. Identify these scripts and whitelist their associated activities to prevent false alerts.
- Some system users might be configured for specific applications that require login capabilities. Review application requirements and exclude these users if their access is deemed necessary and secure.
- In environments with custom configurations, certain system users might be intentionally modified for operational needs. Document these changes and adjust the detection rule to exclude these known modifications.
- Regularly review and update the list of system users in the detection rule to ensure it reflects the current environment and operational requirements, minimizing unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any active sessions associated with the unusual system user accounts identified in the alert to disrupt ongoing unauthorized access.
- Review and revert any unauthorized changes to the system user accounts, such as modifications to the shell configuration that enabled login capabilities.
- Conduct a thorough audit of the system for any additional unauthorized changes or backdoors, focusing on SSH configurations and user account settings.
- Reset passwords and update authentication mechanisms for all system user accounts to prevent further exploitation.
- Implement additional monitoring and alerting for any future login attempts by system users, ensuring rapid detection and response to similar threats.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on other systems within the network."""
references = [
    "https://blog.exatrack.com/Perfctl-using-portainer-and-new-persistences/",
    "https://x.com/RFGroenewoud/status/1875112050218922010",
]
risk_score = 47
rule_id = "428e9109-dc13-4ae9-84cb-100464d4c6fa"
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: Persistence",
    "Tactic: Defense Evasion",
    "Data Source: System",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:authentication and host.os.type:linux and event.action:("ssh_login" or "user_login") and
user.name:(
  "deamon" or "bin" or "sys" or "games" or "man" or "lp" or "mail" or "news" or "uucp" or "proxy" or "www-data" or "backup" or
  "list" or "irc" or "gnats" or "nobody" or "systemd-timesync" or "systemd-network" or "systemd-resolve" or "messagebus" or
  "avahi" or "sshd" or "dnsmasq"
) and event.outcome:success
'''

[[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.003"
name = "Local Accounts"
reference = "https://attack.mitre.org/techniques/T1078/003/"

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1564.002"
name = "Hidden Users"
reference = "https://attack.mitre.org/techniques/T1564/002/"

[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 = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

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

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.new_terms]
field = "new_terms_fields"
value = ["user.name", "host.id"]

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

Stages and Predicates

Stage 1: new_terms

event.category:authentication and host.os.type:linux and event.action:("ssh_login" or "user_login") and
user.name:(
  "deamon" or "bin" or "sys" or "games" or "man" or "lp" or "mail" or "news" or "uucp" or "proxy" or "www-data" or "backup" or
  "list" or "irc" or "gnats" or "nobody" or "systemd-timesync" or "systemd-network" or "systemd-resolve" or "messagebus" or
  "avahi" or "sshd" or "dnsmasq"
) and event.outcome:success

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ssh_login
  • user_login
field:"EventType" kind:in
event.categoryeq
  • authentication
field:"event.category" kind:eq value:"authentication"
event.outcomeeq
  • success
field:"event.outcome" kind:eq value:"success"
user.namein
  • avahi
  • backup
  • bin
  • deamon
  • dnsmasq
  • games
  • gnats
  • irc
  • list
  • lp
  • mail
  • man
  • messagebus
  • news
  • nobody
  • proxy
  • sshd
  • sys
  • systemd-network
  • systemd-resolve
  • systemd-timesync
  • uucp
  • www-data
field:"user" kind:in

Web Browser Credential Access via Unsigned Process

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

Identifies an unsigned process accessing the password store of commonly used web browsers. Adversaries may steal credentials from web browsers by reading files specific to the target browser.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies an unsigned process accessing the password store of commonly used web browsers. Adversaries may steal
credentials from web browsers by reading files specific to the target browser.
"""
id = "9ed4ee4a-bc91-4d38-b6dd-11467b774460"
license = "Elastic License v2"
name = "Web Browser Credential Access via Unsigned Process"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/detect-credential-access",
    "https://www.elastic.co/security-labs/globally-distributed-stealers",
]
version = "1.0.39"

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

    (process.Ext.relative_file_creation_time <= 500 and
     (process.code_signature.trusted == false or process.code_signature.exists == false) and
     not process.code_signature.status : "errorCode_endpoint*" and
     not (process.code_signature.subject_name == "Rapid7 LLC" and process.code_signature.status == "errorBadDigest"))
    ) and
    not (process.code_signature.subject_name == "Guardicore Ltd" and process.code_signature.status == "errorExpired") and
    not process.hash.sha256 : ("589c5f680eefb085a3c67c8115febbfb134dcd61e43acda83d8a2cc9c4eee035",
                               "67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68",
                               "2ef4b2d23912e15a1b0a47e17e249a909df5d973381c93741a6adbf119182e3d",
                               "6d167aee7013d61b0832937773cd71d77493a05d6ffb1849bdfb1477622e54c2",
                               "8ab494be664d7bb9a7e0dda2bc4fc6592ab26f6bb5d44b6b71b80297a532a517",
                               "eeae738673b6d694c0669fb8cd4c498b7ec6af2239d0ce3e2e6370fe75c2a771",
                               "1ea6c21fb667401513fc8c2106523510f77647a271be4f9cc1abc5b06d0e3eb5",
                               "5094013ae4283c70eeea7e2b1b4f2c084439ea8cc538473273586cf80dd79caf",
                               "84618d4ac2894c5febaf545f24285fe75cd8b4e166d5bde923661ca0d0fb7c4c")
    ]
  [file where event.type == "access" and
    /* domain user RID */
    user.id : ("S-1-5-21*", "S-1-12-*") and
    not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
    (
     file.name : ("logins.json", "cert?.db", "key?.db", "signons.sqlite", "cookies.sqlite") or 
     file.path : 
           ("?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Local State",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Local State", 
            "?:\\users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data", 
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data")
     ) 
     and not (process.name : "certutil.exe" and file.name : ("key?.db", "cert?.db"))
    ]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"

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



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

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

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

Stage 1: process

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

    (process.Ext.relative_file_creation_time <= 500 and
     (process.code_signature.trusted == false or process.code_signature.exists == false) and
     not process.code_signature.status : "errorCode_endpoint*" and
     not (process.code_signature.subject_name == "Rapid7 LLC" and process.code_signature.status == "errorBadDigest"))
    ) and
    not (process.code_signature.subject_name == "Guardicore Ltd" and process.code_signature.status == "errorExpired") and
    not process.hash.sha256 : ("589c5f680eefb085a3c67c8115febbfb134dcd61e43acda83d8a2cc9c4eee035",
                               "67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68",
                               "2ef4b2d23912e15a1b0a47e17e249a909df5d973381c93741a6adbf119182e3d",
                               "6d167aee7013d61b0832937773cd71d77493a05d6ffb1849bdfb1477622e54c2",
                               "8ab494be664d7bb9a7e0dda2bc4fc6592ab26f6bb5d44b6b71b80297a532a517",
                               "eeae738673b6d694c0669fb8cd4c498b7ec6af2239d0ce3e2e6370fe75c2a771",
                               "1ea6c21fb667401513fc8c2106523510f77647a271be4f9cc1abc5b06d0e3eb5",
                               "5094013ae4283c70eeea7e2b1b4f2c084439ea8cc538473273586cf80dd79caf",
                               "84618d4ac2894c5febaf545f24285fe75cd8b4e166d5bde923661ca0d0fb7c4c")
    ]

Stage 2: file

[file where event.type == "access" and
    user.id : ("S-1-5-21*", "S-1-12-*") and
    not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
    (
     file.name : ("logins.json", "cert?.db", "key?.db", "signons.sqlite", "cookies.sqlite") or
     file.path :
           ("?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Local State",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Local State",
            "?:\\users\\*\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data")
     )
     and not (process.name : "certutil.exe" and file.name : ("key?.db", "cert?.db"))
    ]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.typeeq
  • access corpus 9 (elastic 9)
field:"event.type" kind:eq value:"access"
file.namewildcard
  • cert?.db corpus 3 (elastic 3)
  • cookies.sqlite corpus 11 (elastic 11)
  • key?.db corpus 11 (elastic 11)
  • logins.json corpus 11 (elastic 11)
  • signons.sqlite corpus 4 (elastic 4)
field:"file.name" kind:wildcard
file.pathwildcard
  • ?:\Users\*\AppData\Local\Google\Chrome\User Data\Local State corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Microsoft\Edge\User Data\Default\Login Data corpus 4 (elastic 4)
  • ?:\Users\*\AppData\Local\Microsoft\Edge\User Data\Local State corpus 4 (elastic 4)
  • ?:\users\*\AppData\Local\Google\Chrome\User Data\Default\Login Data corpus 4 (elastic 4)
field:"TargetFilename" kind:wildcard
process.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.hash.sha256is_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
user.idwildcard
  • S-1-12-* corpus 25 (elastic 25)
  • S-1-5-21* corpus 26 (elastic 26)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statuseqerrorExpiredexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorExpired"
process.code_signature.subject_nameeqGuardicore Ltdexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Guardicore Ltd"
process.hash.sha256eq589c5f680eefb085a3c67c8115febbfb134dcd61e43acda83d8a2cc9c4eee035, 67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68, 2ef4b2d23912e15a1b0a47e17e249a909df5d973381c93741a6adbf119182e3d, 6d167aee7013d61b0832937773cd71d77493a05d6ffb1849bdfb1477622e54c2, 8ab494be664d7bb9a7e0dda2bc4fc6592ab26f6bb5d44b6b71b80297a532a517, eeae738673b6d694c0669fb8cd4c498b7ec6af2239d0ce3e2e6370fe75c2a771, 1ea6c21fb667401513fc8c2106523510f77647a271be4f9cc1abc5b06d0e3eb5, 5094013ae4283c70eeea7e2b1b4f2c084439ea8cc538473273586cf80dd79caf, 84618d4ac2894c5febaf545f24285fe75cd8b4e166d5bde923661ca0d0fb7c4cexcludes:process.hash.sha256
file.nameeqkey?.db, cert?.dbexcludes:file.name field:"file.name" value:"key?.db" field:"file.name" value:"cert?.db"
process.nameeqcertutil.exeexcludes:process.name field:"process.name" value:"certutil.exe"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe"

Whoami Process Activity

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

Identifies suspicious use of whoami.exe which displays user, group, and privileges information for the user who is currently logged on to the local system.

Known False Positives

  • Some normal use of this program, at varying levels of frequency, may originate from scripts, automation tools and frameworks. Usage by non-engineers and ordinary users is unusual.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies suspicious use of whoami.exe which displays user, group, and privileges information for the user who is
currently logged on to the local system.
"""
false_positives = [
    """
    Some normal use of this program, at varying levels of frequency, may originate from scripts, automation tools and
    frameworks. Usage by non-engineers and ordinary users is unusual.
    """,
]
from = "now-9m"
index = [
    "endgame-*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Whoami Process Activity"
note = """## Triage and analysis

### Investigating Whoami Process Activity

After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.

This rule looks for the execution of the `whoami` utility. Attackers commonly use this utility to measure their current privileges, discover the current user, determine if a privilege escalation was successful, etc.

#### 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.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.

### False positive analysis

- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.

### Related rules

- Account Discovery Command via SYSTEM Account - 2856446a-34e6-435b-9fb5-f8f040bfa7ed

### 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).
"""

setup = """## Setup

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

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

### Additional data sources

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

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""

risk_score = 21
rule_id = "ef862985-3f13-4262-a686-5f357bbb9bc2"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and process.name : "whoami.exe" and
(
  (
    /* scoped for whoami execution under system privileges */
    (
      (
        user.domain : ("NT *", "* NT", "IIS APPPOOL") and
        user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20", "S-1-5-82-*") and
        not ?winlog.event_data.SubjectUserName : "*$" and

        /* Sysmon will always populate user.id as S-1-5-18, leading to FPs */
        not data_stream.dataset : ("windows.sysmon_operational", "windows.sysmon")
      ) or
      (?process.Ext.token.integrity_level_name : "System" or ?winlog.event_data.IntegrityLevel : "System")
    ) and
    not (
      process.parent.name : "cmd.exe" and
      process.parent.args : (
          "chcp 437>nul 2>&1 & C:\\WINDOWS\\System32\\whoami.exe  /groups",
          "chcp 437>nul 2>&1 & %systemroot%\\system32\\whoami /user",
          "C:\\WINDOWS\\System32\\whoami.exe /groups",
          "*WINDOWS\\system32\\config\\systemprofile*"
      )
    ) and
    not (process.parent.executable : "C:\\Windows\\system32\\inetsrv\\appcmd.exe" and process.parent.args : "LIST") and
    not process.parent.executable : (
        "C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe",
        "C:\\Program Files\\Cohesity\\cohesity_windows_agent_service.exe"
    )
  ) or
  process.parent.name : ("wsmprovhost.exe", "w3wp.exe", "wmiprvse.exe", "rundll32.exe", "regsvr32.exe")
)
'''


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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and process.name : "whoami.exe" and
(
  (
    (
      (
        user.domain : ("NT *", "* NT", "IIS APPPOOL") and
        user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20", "S-1-5-82-*") and
        not ?winlog.event_data.SubjectUserName : "*$" and
        not data_stream.dataset : ("windows.sysmon_operational", "windows.sysmon")
      ) or
      (?process.Ext.token.integrity_level_name : "System" or ?winlog.event_data.IntegrityLevel : "System")
    ) and
    not (
      process.parent.name : "cmd.exe" and
      process.parent.args : (
          "chcp 437>nul 2>&1 & C:\\WINDOWS\\System32\\whoami.exe  /groups",
          "chcp 437>nul 2>&1 & %systemroot%\\system32\\whoami /user",
          "C:\\WINDOWS\\System32\\whoami.exe /groups",
          "*WINDOWS\\system32\\config\\systemprofile*"
      )
    ) and
    not (process.parent.executable : "C:\\Windows\\system32\\inetsrv\\appcmd.exe" and process.parent.args : "LIST") and
    not process.parent.executable : (
        "C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\MonitoringHost.exe",
        "C:\\Program Files\\Cohesity\\cohesity_windows_agent_service.exe"
    )
  ) or
  process.parent.name : ("wsmprovhost.exe", "w3wp.exe", "wmiprvse.exe", "rundll32.exe", "regsvr32.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.Ext.token.integrity_level_namewildcard
  • System corpus 8 (elastic 8)
field:"process.Ext.token.integrity_level_name" kind:wildcard value:"System"
process.namewildcard
  • whoami.exe corpus 14 (elastic 11, splunk 2, kusto 1)
field:"process_basename" kind:wildcard value:"whoami.exe"
process.parent.namewildcard
  • regsvr32.exe corpus 13 (elastic 13)
  • rundll32.exe corpus 20 (elastic 20)
  • w3wp.exe corpus 8 (elastic 8)
  • wmiprvse.exe corpus 24 (elastic 19, splunk 5)
  • wsmprovhost.exe corpus 4 (elastic 2, splunk 2)
field:"parent_process_basename" kind:wildcard
user.domainwildcard
  • * NT
  • IIS APPPOOL
  • NT *
field:"TargetDomainName" kind:wildcard
user.idwildcard
  • S-1-5-18 corpus 2 (elastic 2)
  • S-1-5-19
  • S-1-5-20
  • S-1-5-82-*
field:"user.id" kind:wildcard
winlog.event_data.IntegrityLevelwildcard
  • System corpus 31 (sigma 22, splunk 5, elastic 3, kusto 1)
field:"IntegrityLevel" kind:wildcard value:"System"

Windows Command Shell Spawned via Microsoft Office

#
Source
github.com/elastic/protections-artifacts

Identifies a Microsoft Office application starting a Windows command prompt with suspicious command line arguments. This behavior is consistent with a victim opening a malicious document and executing an attacker's malicious code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies a Microsoft Office application starting a Windows command prompt with suspicious command line arguments. This
behavior is consistent with a victim opening a malicious document and executing an attacker's malicious code.
"""
id = "2a396a3c-b343-42a9-b74b-c5b9925b6ee2"
license = "Elastic License v2"
name = "Windows Command Shell Spawned via Microsoft Office"
os_list = ["windows"]
reference = ["https://github.com/danielbohannon/Invoke-DOSfuscation"]
version = "1.0.33"

query = '''
process where event.action == "start" and
  process.parent.name : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (process.pe.original_file_name == "Cmd.Exe" or process.name : "cmd.exe") and
  process.command_line :
              ("*^*^*^*^*^*",
              "*set *set *set *",
              "*set *for *call *",
              "*set *for *cmd *",
              "*$*$*$*$*",
              "*comspec*",
              "*powershell*",
              "*wscript*",
              "*cscript*",
              "*mshta*", 
              "*certutil*", 
              "*bitsadmin*", 
              "*/transfer*",
              "*-transfer*",
              "*urlcache*", 
              "*-decode*", 
              "*addfile*",
              "*msbuild*",
              "*msiexec*",
              "*rundll32*",
              "*regsvr32*", 
              "*ping * -n *&*",
              "*http://*",
              "*%%*%%*%%*", 
              "*copy*.exe*") and
  not process.command_line : 
             ("*:\\Program Files\\Tableau\\*--server*http://tableau*", 
              "*:\\Program Files (x86)\\Tableau\\*--server*http://tableau*", 
              "\"C:\\Windows\\System32\\cmd.exe\" /c C:\\windows\\System32\\rundll32 advpack.dll,LaunchINFSection \"C:\\Users\\*\\AppData\\Roaming\\McGowan Partners LLC UAT\\setup.inf\", DefaultInstall*") and 
  not process.args : "$bytes=[System.Text.Encoding]::UTF8.GetBytes('*');$hash=[System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes);[BitConverter]::ToString($hash).Replace('-','').ToLower()"
'''

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


[[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.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 : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (process.pe.original_file_name == "Cmd.Exe" or process.name : "cmd.exe") and
  process.command_line :
              ("*^*^*^*^*^*",
              "*set *set *set *",
              "*set *for *call *",
              "*set *for *cmd *",
              "*$*$*$*$*",
              "*comspec*",
              "*powershell*",
              "*wscript*",
              "*cscript*",
              "*mshta*", 
              "*certutil*", 
              "*bitsadmin*", 
              "*/transfer*",
              "*-transfer*",
              "*urlcache*", 
              "*-decode*", 
              "*addfile*",
              "*msbuild*",
              "*msiexec*",
              "*rundll32*",
              "*regsvr32*", 
              "*ping * -n *&*",
              "*http://*",
              "*%%*%%*%%*", 
              "*copy*.exe*") and
  not process.command_line : 
             ("*:\\Program Files\\Tableau\\*--server*http://tableau*", 
              "*:\\Program Files (x86)\\Tableau\\*--server*http://tableau*", 
              "\"C:\\Windows\\System32\\cmd.exe\" /c C:\\windows\\System32\\rundll32 advpack.dll,LaunchINFSection \"C:\\Users\\*\\AppData\\Roaming\\McGowan Partners LLC UAT\\setup.inf\", DefaultInstall*") and 
  not process.args : "$bytes=[System.Text.Encoding]::UTF8.GetBytes('*');$hash=[System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes);[BitConverter]::ToString($hash).Replace('-','').ToLower()"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *$*$*$*$* corpus 3 (elastic 3)
  • *%%*%%*%%* corpus 2 (elastic 2)
  • *-decode*
  • *-transfer*
  • */transfer*
  • *^*^*^*^*^*
  • *addfile*
  • *bitsadmin* corpus 2 (elastic 2)
  • *certutil* corpus 2 (elastic 2)
  • *comspec* corpus 3 (elastic 3)
  • *copy*.exe*
  • *cscript*
  • *http://*
  • *msbuild*
  • *mshta* corpus 4 (elastic 4)
  • *msiexec* corpus 2 (elastic 2)
  • *ping * -n *&*
  • *powershell* corpus 4 (elastic 4)
  • *regsvr32*
  • *rundll32*
  • *set *for *call * corpus 2 (elastic 2)
  • *set *for *cmd * corpus 2 (elastic 2)
  • *set *set *set * corpus 4 (elastic 4)
  • *urlcache*
  • *wscript*
field:"CommandLine" kind:wildcard
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
field:"process_basename" kind:wildcard value:"cmd.exe"
process.parent.namewildcard
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • powerpnt.exe corpus 23 (elastic 23)
  • winword.exe corpus 26 (elastic 26)
field:"parent_process_basename" kind:wildcard
process.pe.original_file_nameeq
  • Cmd.Exe corpus 7 (elastic 7)
field:"OriginalFileName" kind:eq value:"Cmd.Exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard$bytes=[System.Text.Encoding]::UTF8.GetBytes('*');$hash=[System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes);[BitConverter]::ToString($hash).Replace('-','').ToLower()excludes:process.args field:"process.args" value:"$bytes=[System.Text.Encoding]::UTF8.GetBytes('*');$hash=[System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes);[BitConverter]::ToString($hash).Replace('-','').ToLower()"
process.command_linewildcard*:\Program Files\Tableau\*--server*http://tableau*, *:\Program Files (x86)\Tableau\*--server*http://tableau*, "C:\Windows\System32\cmd.exe" /c C:\windows\System32\rundll32 advpack.dll,LaunchINFSection "C:\Users\*\AppData\Roaming\McGowan Partners LLC UAT\setup.inf", DefaultInstall*excludes:process.command_line

Back to all Elastic rules