Detection rules › Elastic

Elastic rules: 29

RuleSeverity
At Utility Launched through Udevadm
AWS Bedrock Guardrail Deleted or Weakenedmedium
AWS SES Enumeration via Long-Term Access Keylow
Behavior - Detected - Elastic Defendmedium
Connection to Dynamic DNS Provider by an Unsigned Binary
Entra ID Protection User Alert and Device Registrationhigh
Enumeration of Users or Groups via Built-in Commandslow
Initramfs Unpacking via unmkinitramfslow
Installation of Security Support Providermedium
Kubernetes Pod Exec Sensitive File or Credential Path Accesshigh
M365 Exchange Anti-Phish Rule Modificationmedium
M365 Exchange MFA Notification Email Deleted or Movedlow
Manual Loading of a Suspicious Chromium Extensionhigh
Microsoft Common Language Runtime Loaded from Suspicious Memory
Modification of Dynamic Linker Preload Shared Objectmedium
Newly Observed Elastic Defend Behavior Alerthigh
Nodejs Initial Access via VSCode Auto-run Task
Outlook Home Page Registry Modification
Polkit Policy Creationlow
Potential Kubectl Masquerading via Unexpected Processmedium
Potential Network Share Discoverylow
Potential PowerShell Obfuscated Script via High Entropylow
Potential Shellcode Injection via Node.js
Potential Successful SSH Brute Force Attackhigh
Privilege Escalation via Rogue Named Pipe Impersonationhigh
Remote File Creation in World Writeable Directorymedium
Suspicious Finder Cache File Modification
Suspicious NullSessionPipe Registry Modification
Suspicious Process Execution via Renamed PsExec Executablemedium
Thrift RPC Method from an External Clientmedium
Unauthorized Access to an Okta Applicationlow
Unsigned or Untrusted Process Execution and Immediate Self-Deletion

At Utility Launched through Udevadm

#
Source
github.com/elastic/protections-artifacts

This rule detects the at utility being launched through udevadm. The at utility is used to schedule tasks to be run at a later time. This could be used by an attacker to establish persistence on a system. The udevadm utility is used to manage device events and could be used to trigger the at utility to run at a specific time, providing a threat actor with persistence.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects the `at` utility being launched through `udevadm`. The `at` utility is used to schedule tasks to be
run at a later time. This could be used by an attacker to establish persistence on a system. The `udevadm` utility is
used to manage device events and could be used to trigger the `at` utility to run at a specific time, providing a threat
actor with persistence.
"""
id = "47e5595e-1920-4fdd-9a1c-cf712e1112d1"
license = "Elastic License v2"
name = "At Utility Launched through Udevadm"
os_list = ["linux"]
reference = [
    "https://ch4ik0.github.io/en/posts/leveraging-Linux-udev-for-persistence/",
    "https://www.elastic.co/security-labs/sequel-on-persistence-mechanisms",
]
version = "1.0.4"

query = '''
process where event.type == "start" and event.action == "exec" and process.parent.name == "udevadm" and
process.name == "at"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.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 = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"


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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.parent.name == "udevadm" and
process.name == "at"

Indicators

These rows show field, operator, and value matches.

AWS Bedrock Guardrail Deleted or Weakened

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

Detects deletion, weakening, or version management of AWS Bedrock guardrails via the DeleteGuardrail, UpdateGuardrail, DeleteEnforcedGuardrailConfiguration, or PutEnforcedGuardrailConfiguration APIs. Bedrock guardrails enforce content, topic, word, and sensitive-information policies on model invocations. Deleting a guardrail, loosening its policies, removing or overwriting the organization-enforced guardrail configuration, or creating a new version to enforce a weakened configuration allows an adversary to bypass these protections — the cloud control-plane equivalent of disabling a security tool. This activity should be validated against approved change management and the responsible identity.

Known False Positives

  • Platform or ML engineering teams may legitimately tune, iterate on, or decommission guardrails as part of normal development. If this is expected in your environment, the responsible identities can be exempted from the rule.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/04"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
description = """
Detects deletion, weakening, or version management of AWS Bedrock guardrails via the DeleteGuardrail, UpdateGuardrail,
DeleteEnforcedGuardrailConfiguration, or PutEnforcedGuardrailConfiguration APIs. Bedrock
guardrails enforce content, topic, word, and sensitive-information policies on model invocations. Deleting a guardrail,
loosening its policies, removing or overwriting the organization-enforced guardrail configuration, or creating a new
version to enforce a weakened configuration allows an adversary to bypass these protections — the cloud control-plane
equivalent of disabling a security tool. This activity should be validated against approved change management and the
responsible identity.
"""
false_positives = [
  """
  Platform or ML engineering teams may legitimately tune, iterate on, or decommission guardrails as part of normal
  development. If this is expected in your environment, the responsible identities can be exempted from the rule.
  """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Bedrock Guardrail Deleted or Weakened"
note = """## Triage and analysis

### Investigating AWS Bedrock Guardrail Deleted or Weakened

AWS Bedrock guardrails enforce content, topic, word, and sensitive-information policies on model
invocations. Adversaries who gain access to the Bedrock control plane may delete a guardrail (`DeleteGuardrail`),
loosen its policies (`UpdateGuardrail`), remove or overwrite the organization-enforced guardrail
configuration (`DeleteEnforcedGuardrailConfiguration` / `PutEnforcedGuardrailConfiguration`) to then enforce it on
model deployments. This detection identifies those control-plane changes so responders can confirm
intent before accepting the change.

#### Possible investigation steps

- **Identify the actor and context**
  - Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`,
    `aws.cloudtrail.user_identity.access_key_id`, `source.ip`, and `user_agent.original`.
  - Confirm a related change request exists and that the identity is authorized to manage guardrails.
- **Validate the change**
  - For `UpdateGuardrail` / `PutEnforcedGuardrailConfiguration`, inspect
    `aws.cloudtrail.flattened.request_parameters` and `aws.cloudtrail.response_elements` to determine
    which content, topic, word, or sensitive-information policies were removed or weakened.
  - For `DeleteGuardrail` / `DeleteEnforcedGuardrailConfiguration`, identify the targeted guardrail
    or org configuration and whether protected workloads still reference it.
- **Correlate activity**
  - Look for surrounding Bedrock `InvokeModel` / `Converse` activity and other defense-impairing
    actions (e.g., logging or detector changes) from the same identity.
  - Check for prior enumeration such as `ListGuardrails` or `GetGuardrail`.

### Response and remediation

- If unauthorized, restore the guardrail and/or org-enforced configuration to its approved state and
  re-associate it with affected Bedrock workloads.
- Disable the access key in `aws.cloudtrail.user_identity.access_key_id` and review the actor's
  recent activity; rotate credentials if compromise is suspected.
- Restrict `bedrock:DeleteGuardrail`, `bedrock:UpdateGuardrail`, and the enforced-configuration
  permissions to a small set of admin roles, and enforce guardrail state via AWS Config or SCPs.
"""
references = [
    "https://docs.aws.amazon.com/bedrock/latest/APIReference/API_DeleteGuardrail.html",
    "https://docs.aws.amazon.com/bedrock/latest/APIReference/API_UpdateGuardrail.html",
    "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html"
]
risk_score = 47
rule_id = "cdf7b922-909c-440c-8df0-0efe72aa7bea"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: GenAI",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS Bedrock",
    "Tactic: Defense Evasion",
    "Rule Type: Custom Query (KQL)",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "bedrock.amazonaws.com"
    and event.action: (
        "DeleteGuardrail" or
        "UpdateGuardrail" or
        "DeleteEnforcedGuardrailConfiguration" or
        "PutEnforcedGuardrailConfiguration"
    ) and event.outcome: "success"
    and not user_agent.original: (*Terraform*)
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "bedrock.amazonaws.com"
    and event.action: (
        "DeleteGuardrail" or
        "UpdateGuardrail" or
        "DeleteEnforcedGuardrailConfiguration" or
        "PutEnforcedGuardrailConfiguration"
    ) and event.outcome: "success"
    and not user_agent.original: (*Terraform*)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • DeleteEnforcedGuardrailConfiguration
  • DeleteGuardrail
  • PutEnforcedGuardrailConfiguration
  • UpdateGuardrail
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • bedrock.amazonaws.com corpus 13 (elastic 13)
field:"Provider_Name" kind:eq value:"bedrock.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
user_agent.originalmatchTerraformexcludes:user_agent.original field:"user_agent.original" value:"Terraform"

AWS SES Enumeration via Long-Term Access Key

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

Detects enumeration of Amazon Simple Email Service (SES) resources using long-term IAM access keys (AKIA* prefix). Long-term access keys are associated with IAM users and are the credential type most commonly exfiltrated from repositories, configuration files, and environment variables. An adversary who obtains a long-term key may enumerate SES to discover verified email identities, sending quotas, and DKIM/MAIL FROM domain configurations as a precursor to phishing or spam campaigns launched from the compromised account's verified domains.

Known False Positives

  • Automated monitoring scripts, infrastructure inventory tools, or CI/CD pipelines that use long-term IAM keys to audit SES configuration will trigger this rule. Migrate automation to IAM roles with short-lived credentials; long-term keys used for SES management are a security anti-pattern regardless of this alert.

MITRE ATT&CK Coverage

TacticTechniques
Discovery

Telemetry Coverage

PlatformRecord / event type
AWSCloudTrail event DescribeActiveReceiptRuleSet: DescribeActiveReceiptRuleSet recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event GetEmailIdentity: GetEmailIdentity recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event GetSendQuota: GetSendQuota recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event ListEmailIdentities: ListEmailIdentities recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event ListIdentities: ListIdentities recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event ListReceiptRuleSets: ListReceiptRuleSets recorded by CloudTrail for Amazon Simple Email Service. Observed in real CloudTrail; no AWS SDK operation model documents it, so no description is available from the SDK.
AWSCloudTrail event GetAccountSendingEnabled: Returns the email sending status of the Amazon SES account for the current Region.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects enumeration of Amazon Simple Email Service (SES) resources using long-term IAM access
keys (AKIA* prefix). Long-term access keys are associated with IAM users and are the credential
type most commonly exfiltrated from repositories, configuration files, and environment variables.
An adversary who obtains a long-term key may enumerate SES to discover verified email identities,
sending quotas, and DKIM/MAIL FROM domain configurations as a precursor to phishing or spam
campaigns launched from the compromised account's verified domains.
"""
false_positives = [
    """
    Automated monitoring scripts, infrastructure inventory tools, or CI/CD pipelines that use
    long-term IAM keys to audit SES configuration will trigger this rule. Migrate automation
    to IAM roles with short-lived credentials; long-term keys used for SES management are a
    security anti-pattern regardless of this alert.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS SES Enumeration via Long-Term Access Key"
note = """## Triage and analysis

### Investigating AWS SES Enumeration via Long-Term Access Key

Amazon SES verified identities (email addresses and domains) are the sending credentials that allow SES to send email on behalf of a domain. Adversaries who exfiltrate long-term IAM keys may enumerate SES to identify available verified domains for phishing, discover DKIM configurations, or check sending limits before launching a bulk email campaign.

Long-term keys (AKIA* prefix) are lower-security than assumed-role credentials: they do not expire and are frequently exposed in source code, .env files, CI/CD configuration, and developer workstations. This makes them the most common compromised credential type in cloud environments.

### Possible investigation steps

- Identify the IAM user behind the long-term key from aws.cloudtrail.user_identity.arn.
- Check whether this access key has been rotated recently (GetAccessKeyLastUsed, ListAccessKeys). Confirm the user who owns the key initiated this activity.
- Review source.ip and source.as.organization.name against known developer or automation infrastructure. API calls from unexpected geographies using a long-term key are high-risk.
- Query CloudTrail for subsequent SES write operations (SendEmail, SendRawEmail, VerifyEmailIdentity, UpdateAccountSendingEnabled) using the same access key.
- Check GitHub, GitLab, and CI/CD logs for any public exposure of this key.

### Response and remediation

- Immediately deactivate the long-term access key (UpdateAccessKey --status Inactive).
- Rotate all credentials associated with the IAM user.
- Review all SES quotas and sending history to determine whether unauthorized email was sent.
- Migrate automation that used this key to IAM roles with short-lived assumed-role credentials.
"""
references = [
    "https://docs.aws.amazon.com/ses/latest/APIReference/API_ListIdentities.html",
    "https://permiso.io/blog/s/aws-ses-pionage-detecting-ses-abuse/",
    "https://stratus-red-team.cloud/attack-techniques/AWS/aws.discovery.ses-enumerate/",
]
risk_score = 21
rule_id = "8d05971b-5858-4b72-b09a-17e3cee0af54"
setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. SES management APIs are logged by default."
severity = "low"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS SES",
    "Rule Type: Custom Query (KQL)",
    "Tactic: Discovery",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "aws.cloudtrail"
    and event.provider: "ses.amazonaws.com"
    and event.action: (
        "ListIdentities" or
        "GetAccountSendingEnabled" or
        "GetSendQuota" or
        "ListEmailIdentities" or
        "GetEmailIdentity" or
        "DescribeActiveReceiptRuleSet" or
        "ListReceiptRuleSets"
    )
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.access_key_id: AKIA*
'''


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


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

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

Stages and Predicates

Stage 1: query

data_stream.dataset: "aws.cloudtrail"
    and event.provider: "ses.amazonaws.com"
    and event.action: (
        "ListIdentities" or
        "GetAccountSendingEnabled" or
        "GetSendQuota" or
        "ListEmailIdentities" or
        "GetEmailIdentity" or
        "DescribeActiveReceiptRuleSet" or
        "ListReceiptRuleSets"
    )
    and event.outcome: "success"
    and aws.cloudtrail.user_identity.access_key_id: AKIA*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
aws.cloudtrail.user_identity.access_key_idwildcard
  • AKIA* corpus 5 (elastic 5)
field:"aws::userIdentity.accessKeyId" kind:wildcard value:"AKIA*"
data_stream.dataseteq
  • aws.cloudtrail corpus 143 (elastic 143)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • DescribeActiveReceiptRuleSet
  • GetAccountSendingEnabled
  • GetEmailIdentity
  • GetSendQuota
  • ListEmailIdentities
  • ListIdentities
  • ListReceiptRuleSets
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • ses.amazonaws.com corpus 2 (elastic 2)
field:"Provider_Name" kind:eq value:"ses.amazonaws.com"

Behavior - Detected - Elastic Defend

#

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

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

Generates a detection alert each time an Elastic Defend alert for malicious behavior is received. Enabling this rule allows you to immediately begin investigating your Endpoint behavior alerts. This rule identifies Elastic Defend behavior detections only, and does not include prevention alerts.

Rule Body

[metadata]
creation_date = "2024/03/24"
integration = ["endpoint"]
maturity = "production"
promotion = true
updated_date = "2025/07/02"

[rule]
author = ["Elastic"]
description = """
Generates a detection alert each time an Elastic Defend alert for malicious behavior is received. Enabling this rule
allows you to immediately begin investigating your Endpoint behavior alerts. This rule identifies Elastic Defend
behavior detections only, and does not include prevention alerts.
"""
enabled = false
from = "now-2m"
index = ["logs-endpoint.alerts-*"]
interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "Behavior - Detected - Elastic Defend"
note = """## Triage and analysis

### Investigating Behavior - Detected - Elastic Defend

Malicious behavior protection is a foundational feature which can be used to protect against all manner of attacks on the endpoint. For example, it provides coverage against phishing such as malicious macros, many malware families based on their activities, privilege escalation attacks such as user account control bypasses (UAC), credential theft, and much more. It works by consuming an unfiltered feed of all events that are captured on the system (process, file, registry, network, dns, etc). These events are processed against a routinely updated set of rules written by Elastic threat experts. From there, malicious behaviors are identified and offending processes are terminated. The protection operates on the event stream asynchronously, but has been designed to be extremely efficient and typically requires just milliseconds (under standard load) to stop malicious activity.

### Possible investigation steps

- Assess whether this activity is prevalent in your environment by looking for similar occurrences across hosts.
- Verify the detailed activity of the process that triggered the alert (process tree, child process, process arguments, network, files, libraries and registry events).
- Verify the activity of the `user.name` associated with the alert (local or remote actity, privileged or standard user).
- Particular attention should be paid to instances where the same process is triggering multiple alerts (more than 2 or 3) within a short period of time.
- Even the the process is signed by a valid certificate, verify the if it's running from the expected location or if it's loading any suspicious libraries or any sign of code injection.

### False positive analysis

- Same alert observed on a high number of hosts with similar details.
- High count of the same alert on a specific host over a long period of time.

### Response and Remediation

- Initiate the incident response process based on the outcome of the triage.
  - If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
- Implement Elastic Endpoint Security to detect and prevent further post exploitation activities in the environment.
   - Contain the affected system by isolating it from the network to prevent further spread of the attack.
- If the triage identified malware, search the environment for additional compromised hosts.
  - Implement temporary network rules, procedures, and segmentation to contain the malware.
  - Stop suspicious processes.
  - Immediately block the identified indicators of compromise (IoCs).
  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Restore the affected system to its operational state by applying any necessary patches, updates, or configuration changes.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
    "https://github.com/elastic/protections-artifacts/tree/main/behavior",
    "https://docs.elastic.co/en/integrations/endpoint",
]
risk_score = 47
rule_id = "0f615fe4-eaa2-11ee-ae33-f661ea17fbce"
rule_name_override = "message"
setup = """## Setup

### Elastic Defend Alerts
This rule is designed to capture specific alerts generated by Elastic Defend.

To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules:

Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce)
Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce)
Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce)
Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce)
Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce)
Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce)
Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce)
Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce)

To avoid generating duplicate alerts, you should enable either all feature-specific protection rules or the Endpoint Security (Elastic Defend) rule (UUID: 9a1a2dae-0b5f-4c3d-8305-a268d404c306).

### Additional notes

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

query = '''
event.kind : alert and event.code : behavior and (event.type : allowed or (event.type: denied and event.outcome: failure))
'''


[[rule.exceptions_list]]
id = "endpoint_list"
list_id = "endpoint_list"
namespace_type = "agnostic"
type = "endpoint"

[[rule.risk_score_mapping]]
field = "event.risk_score"
operator = "equals"
value = ""

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

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

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

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


Stages and Predicates

Stage 1: query

event.kind : alert and event.code : behavior and (event.type : allowed or (event.type: denied and event.outcome: failure))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.codeeq
  • behavior corpus 2 (elastic 2)
field:"EventID" kind:eq value:"behavior"
event.kindeq
  • alert corpus 35 (elastic 35)
field:"event.kind" kind:eq value:"alert"
event.outcomeeq
  • failure corpus 14 (elastic 14)
field:"event.outcome" kind:eq value:"failure"
event.typeeq
  • allowed corpus 4 (elastic 4)
  • denied corpus 8 (elastic 8)
field:"event.type" kind:eq

Connection to Dynamic DNS Provider by an Unsigned Binary

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

Identifies DNS queries to known Dynamic DNS Providers by an unsigned program. Dynamic DNS providers are often misused to host malware Command and Control servers.

MITRE ATT&CK Coverage

TacticTechniques
Command & Control

Rule Body

[rule]
description = """
Identifies DNS queries to known Dynamic DNS Providers by an unsigned program. Dynamic DNS providers are often misused to
host malware Command and Control servers.
"""
id = "75b80e66-90d0-4ab6-9e6b-976f7d690906"
license = "Elastic License v2"
name = "Connection to Dynamic DNS Provider by an Unsigned Binary"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/doing-time-with-the-yipphb-dropper",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
]
version = "1.0.38"

query = '''
sequence by process.entity_id with maxspan=1m
 /* execution of an unsigned PEfollowed by dns request to dynamic dns provider */
  [process where event.action == "start" and user.id like ("S-1-5-21*", "S-1-12-*") and
   not process.code_signature.trusted == true and
   process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and 
   not process.hash.sha256 : 
              ("6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829", 
               "43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9", 
               "18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb",
               "94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601",
               "b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155",
               "fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd",
               "7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e",
               "e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a",
               "65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7",
               "18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24",
               "2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53",
               "1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1",
               "04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a",
               "d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251",
               "1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a",
               "495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f",
               "88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1",
               "8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a",
               "7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5f") and
   not (process.code_signature.subject_name == "MarWinCliente" and process.parent.name == "dfsvc.exe" and
        process.code_signature.status == "errorUntrustedRoot") and
   not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*.exe" and
   not (process.parent.name : "cmd.exe" and process.parent.command_line : "\"C:\\Windows\\system32\\cmd.exe\" ")
   ]
  [dns where
    dns.question.name :
         (
          "*.no-ip.com",
          "*.no-ip.org",
          "*.no-ip.biz",
          "*.no-ip.info",
          "*.noip.com",
          "*.afraid.org",
          "*.changeip.com",
          "*.ddns.net",
          "*.dyndns.org",
          "*.hopto.org",
          "*.zapto.org",
          "*.servehttp.com",
          "*.sytes.net",
          "*.myftp.biz",
          "*.myftp.org",
          "*.ddnsfree.com",
          "*.duckdns.org",
          "*.000webhostapp.com",
          "*.myddns.me",
          "*.dlinkddns.com",
          "*.chickenkiller.com", 
          "*.thddns.net", 
          "*.linkpc.net", 
          "*.gotdns.ch",
          "*.dynv6.net",
          "*.dns.army",
          "*.dns.navy",
          "*.v6.army",
          "*.v6.navy",
          "*.v6.rocks",
          "*.dyndns-office.com",
          "*.myvnc.com",
          "*.is-certified.com"
         ) and

    /* covered by rule Id dfe28e03-9b0b-47f5-9753-65ed2666663f */
    not dns.question.name : "checkip.dyndns.org"]
'''

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

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

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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and user.id like ("S-1-5-21*", "S-1-12-*") and
   not process.code_signature.trusted == true and
   process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and 
   not process.hash.sha256 : 
              ("6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829", 
               "43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9", 
               "18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb",
               "94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601",
               "b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155",
               "fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd",
               "7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e",
               "e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a",
               "65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7",
               "18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24",
               "2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53",
               "1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1",
               "04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a",
               "d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251",
               "1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a",
               "495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f",
               "88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1",
               "8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a",
               "7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5f") and
   not (process.code_signature.subject_name == "MarWinCliente" and process.parent.name == "dfsvc.exe" and
        process.code_signature.status == "errorUntrustedRoot") and
   not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*.exe" and
   not (process.parent.name : "cmd.exe" and process.parent.command_line : "\"C:\\Windows\\system32\\cmd.exe\" ")
   ]

Stage 2: dns

[dns where
    dns.question.name :
         (
          "*.no-ip.com",
          "*.no-ip.org",
          "*.no-ip.biz",
          "*.no-ip.info",
          "*.noip.com",
          "*.afraid.org",
          "*.changeip.com",
          "*.ddns.net",
          "*.dyndns.org",
          "*.hopto.org",
          "*.zapto.org",
          "*.servehttp.com",
          "*.sytes.net",
          "*.myftp.biz",
          "*.myftp.org",
          "*.ddnsfree.com",
          "*.duckdns.org",
          "*.000webhostapp.com",
          "*.myddns.me",
          "*.dlinkddns.com",
          "*.chickenkiller.com",
          "*.thddns.net",
          "*.linkpc.net",
          "*.gotdns.ch",
          "*.dynv6.net",
          "*.dns.army",
          "*.dns.navy",
          "*.v6.army",
          "*.v6.navy",
          "*.v6.rocks",
          "*.dyndns-office.com",
          "*.myvnc.com",
          "*.is-certified.com"
         ) and
    not dns.question.name : "checkip.dyndns.org"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.namewildcard
  • *.000webhostapp.com corpus 3 (elastic 3)
  • *.afraid.org corpus 3 (elastic 3)
  • *.changeip.com corpus 3 (elastic 3)
  • *.chickenkiller.com corpus 3 (elastic 3)
  • *.ddns.net corpus 3 (elastic 3)
  • *.ddnsfree.com corpus 3 (elastic 3)
  • *.dlinkddns.com corpus 3 (elastic 3)
  • *.dns.army corpus 3 (elastic 3)
  • *.dns.navy corpus 3 (elastic 3)
  • *.duckdns.org corpus 3 (elastic 3)
  • *.dyndns-office.com corpus 3 (elastic 3)
  • *.dyndns.org corpus 3 (elastic 3)
  • *.dynv6.net corpus 3 (elastic 3)
  • *.gotdns.ch corpus 3 (elastic 3)
  • *.hopto.org corpus 3 (elastic 3)
  • *.is-certified.com corpus 3 (elastic 3)
  • *.linkpc.net corpus 3 (elastic 3)
  • *.myddns.me corpus 3 (elastic 3)
  • *.myftp.biz corpus 3 (elastic 3)
  • *.myftp.org corpus 3 (elastic 3)
  • *.myvnc.com corpus 3 (elastic 3)
  • *.no-ip.biz corpus 3 (elastic 3)
  • *.no-ip.com corpus 3 (elastic 3)
  • *.no-ip.info corpus 3 (elastic 3)
  • *.no-ip.org corpus 3 (elastic 3)
  • *.noip.com corpus 3 (elastic 3)
  • *.servehttp.com corpus 3 (elastic 3)
  • *.sytes.net corpus 3 (elastic 3)
  • *.thddns.net corpus 3 (elastic 3)
  • *.v6.army corpus 3 (elastic 3)
  • *.v6.navy corpus 3 (elastic 3)
  • *.v6.rocks corpus 3 (elastic 3)
  • *.zapto.org corpus 3 (elastic 3)
field:"QueryName" kind:wildcard
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\* corpus 17 (elastic 17)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
field:"Image" kind:wildcard
user.idwildcard
  • S-1-12-* corpus 21 (elastic 21)
  • S-1-5-21* corpus 21 (elastic 21)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statuseqerrorUntrustedRootexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorUntrustedRoot"
process.code_signature.subject_nameeqMarWinClienteexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"MarWinCliente"
process.parent.nameeqdfsvc.exeexcludes:process.parent.name field:"process.parent.name" value:"dfsvc.exe"
process.parent.command_lineeq"C:\Windows\system32\cmd.exe" excludes:process.parent.command_line
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.hash.sha256eq6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829, 43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9, 18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb, 94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601, b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155, fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd, 7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e, e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a, 65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7, 18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24, 2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53, 1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1, 04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a, d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251, 1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a, 495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f, 88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1, 8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a, 7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5fexcludes:process.hash.sha256
process.parent.executablewildcardC:\Program Files\Microsoft Visual Studio\*.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Microsoft Visual Studio\*.exe"
dns.question.nameeqcheckip.dyndns.orgexcludes:dns.question.name field:"dns.question.name" value:"checkip.dyndns.org"

Entra ID Protection User Alert and Device Registration

#
Status
production
Severity
high
Time window
5m
Sequence by
azure.auditlogs.properties.initiated_by.user.userPrincipalName, azure.identityprotection.properties.user_principal_name
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies sequence of events where a Microsoft Entra ID protection alert is followed by an attempt to register a new device by the same user principal. This behavior may indicate an adversary using a compromised account to register a device, potentially leading to unauthorized access to resources or persistence in the environment.

MITRE ATT&CK Coverage

Telemetry Coverage

PlatformRecord / event type
AzureRegister device

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies sequence of events where a Microsoft Entra ID protection alert is followed by an attempt to register a new device by the same user principal. This behavior may indicate an adversary using a compromised account to register a device, potentially leading to unauthorized access to resources or persistence in the environment.
"""
from = "now-9m"
index = ["logs-azure.identity_protection-*", "logs-azure.auditlogs-*"]
language = "eql"
license = "Elastic License v2"
name = "Entra ID Protection User Alert and Device Registration"
note = """## Triage and analysis

### Investigating Entra ID Protection User Alert and Device Registration

#### Possible investigation steps

- Identify the Risk Detection that triggered the event. A list with descriptions can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/concept-identity-protection-risks#risk-types-and-detection).
- Identify the user account involved and validate whether the suspicious activity is normal for that user.
  - Consider the source IP address and geolocation for the involved user account. Do they look normal?
  - Consider the device used to sign in. Is it registered and compliant?
- Investigate other alerts associated with the user account during the past 48 hours.
- Contact the account owner and confirm whether they are aware of this activity.
- Check if this operation was approved and performed according to the organization's change management policy.
- 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.
- Consider the context of the user account and whether the activity is expected. For example, if the user is a developer or administrator, they may have legitimate reasons for accessing resources from various locations or devices.
- A Microsoft Entra ID Protection alert may be triggered by legitimate activities such as password resets, MFA changes, or device registrations. If the user is known to perform these actions regularly, it may not indicate a compromise.

### 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://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/overview-identity-protection",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk",
    "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk#investigation-framework",
]
risk_score = 73
rule_id = "a6d4e070-b9b9-4294-b028-d9e21ad47413"
severity = "high"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Data Source: Microsoft Entra ID",
    "Data Source: Microsoft Entra ID Protection Logs",
    "Data Source: Microsoft Entra ID Audit Logs",
    "Use Case: Identity and Access Audit",
    "Resources: Investigation Guide",
    "Tactic: Persistence",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence with maxspan=5m
[any where data_stream.dataset == "azure.identity_protection"] by azure.identityprotection.properties.user_principal_name
[any where data_stream.dataset == "azure.auditlogs" and event.action == "Register device"] by azure.auditlogs.properties.initiated_by.user.userPrincipalName
'''


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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.005"
name = "Device Registration"
reference = "https://attack.mitre.org/techniques/T1098/005/"

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

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by azure.auditlogs.properties.initiated_by.user.userPrincipalName, azure.identityprotection.properties.user_principal_name.

Stage 1: any

[any where data_stream.dataset == "azure.identity_protection"] by azure.identityprotection.properties.user_principal_name

Stage 2: any

[any where data_stream.dataset == "azure.auditlogs" and event.action == "Register device"] by azure.auditlogs.properties.initiated_by.user.userPrincipalName

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • azure.auditlogs corpus 4 (elastic 4)
  • azure.identity_protection corpus 2 (elastic 2)
field:"data_stream.dataset" kind:eq
event.actioneq
  • Register device
field:"EventType" kind:eq value:"Register device"

Enumeration of Users or Groups via Built-in Commands

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

Identifies the execution of macOS built-in commands related to account or group enumeration. Adversaries may use account and group information to orient themselves before deciding how to act.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2021/01/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies the execution of macOS built-in commands related to account or group enumeration. Adversaries may use account
and group information to orient themselves before deciding how to act.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Enumeration of Users or Groups via Built-in Commands"
risk_score = 21
rule_id = "6e9b351e-a531-4bdc-b73e-7034d6eed7ff"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "macos" and event.type in ("start", "process_started") and
  (
    process.name in ("ldapsearch", "dsmemberutil") or
    (process.name == "dscl" and
      process.args in ("read", "-read", "list", "-list", "ls", "search", "-search") and
      process.args like ("/Active Directory/*", "/Users*", "/Groups*"))
	) and
  ((process.Ext.effective_parent.executable like "/Volumes/*" or process.parent.executable like "/Volumes/*") or
   (process.Ext.effective_parent.name : ".*" or process.parent.name : ".*") or
   (process.parent.code_signature.trusted == false or process.parent.code_signature.exists == false))
'''
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 Enumeration of Users or Groups via Built-in Commands

Built-in macOS commands like `ldapsearch`, `dsmemberutil`, and `dscl` are essential for managing and querying user and group information. Adversaries exploit these to gather insights into system accounts and groups, aiding in lateral movement or privilege escalation. The detection rule identifies suspicious use of these commands, especially when executed from non-standard parent processes, excluding known legitimate applications, to flag potential misuse.

### Possible investigation steps

- Review the process details to identify the specific command executed, focusing on the process name and arguments, such as "ldapsearch", "dsmemberutil", or "dscl" with specific arguments like "read", "list", or "search".
- Examine the parent process information, including the executable path and name, to determine if the command was launched from a non-standard or suspicious parent process.
- Check the exclusion list of known legitimate applications to ensure the alert was not triggered by a benign process, such as those from QualysCloudAgent, Kaspersky, or ESET.
- Investigate the user account associated with the process execution to determine if it aligns with expected behavior or if it indicates potential compromise or misuse.
- Correlate the event with other logs or alerts to identify any patterns of suspicious activity, such as repeated enumeration attempts or other discovery tactics.
- Assess the system's recent activity for signs of lateral movement or privilege escalation attempts that may follow the enumeration of users or groups.

### False positive analysis

- Security and management tools like QualysCloudAgent, Kaspersky Anti-Virus, and ESET Endpoint Security may trigger false positives due to their legitimate use of built-in commands for system monitoring. To mitigate this, add these applications to the exclusion list in the detection rule.
- Development environments such as Xcode might execute these commands during normal operations. If Xcode is frequently triggering alerts, consider excluding its executable path from the rule.
- VPN and network management applications like NordVPN and Zscaler may use these commands for network configuration and user management. Exclude these applications if they are known to be safe and frequently used in your environment.
- Parallels Desktop and similar virtualization software might access user and group information as part of their functionality. If these applications are trusted, add their executable paths to the exclusion list.
- Regular administrative tasks performed by IT personnel using NoMAD or similar tools can also cause false positives. Ensure these tools are excluded if they are part of routine operations.

### Response and remediation

- Immediately isolate the affected macOS system from the network to prevent potential lateral movement by the adversary.
- Terminate any suspicious processes identified by the detection rule, specifically those involving `ldapsearch`, `dsmemberutil`, or `dscl` commands executed from non-standard parent processes.
- Conduct a thorough review of user and group accounts on the affected system to identify any unauthorized changes or additions, and revert any suspicious modifications.
- Reset passwords for all user accounts on the affected system, prioritizing those with administrative privileges, to mitigate potential unauthorized access.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems have been compromised.
- Implement additional monitoring on the affected system and network to detect any further unauthorized enumeration attempts or related suspicious activities.
- Review and update endpoint security configurations to ensure that legitimate applications are properly whitelisted and that unauthorized applications are blocked from executing enumeration commands."""


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

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"

[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 == "macos" and event.type in ("start", "process_started") and
  (
    process.name in ("ldapsearch", "dsmemberutil") or
    (process.name == "dscl" and
      process.args in ("read", "-read", "list", "-list", "ls", "search", "-search") and
      process.args like ("/Active Directory/*", "/Users*", "/Groups*"))
	) and
  ((process.Ext.effective_parent.executable like "/Volumes/*" or process.parent.executable like "/Volumes/*") or
   (process.Ext.effective_parent.name : ".*" or process.parent.name : ".*") or
   (process.parent.code_signature.trusted == false or process.parent.code_signature.exists == false))

Indicators

These rows show field, operator, and value matches.

Initramfs Unpacking via unmkinitramfs

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

This rule detects the unpacking of an initramfs image using the "unmkinitramfs" command on Linux systems. The "unmkinitramfs" command is used to extract the contents of an initramfs image, which is used to boot the system. Attackers may use "unmkinitramfs" to unpack an initramfs image and modify its contents to include malicious code or backdoors, allowing them to maintain persistence on the system.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the unpacking of an initramfs image using the "unmkinitramfs" command on Linux systems. The
"unmkinitramfs" command is used to extract the contents of an initramfs image, which is used to boot the system.
Attackers may use "unmkinitramfs" to unpack an initramfs image and modify its contents to include malicious code or
backdoors, allowing them to maintain persistence on the system.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process*",
    "endgame-*",
    "auditbeat-*",
    "logs-auditd_manager.auditd-*",
    "logs-crowdstrike.fdr*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Initramfs Unpacking via unmkinitramfs"
note = """## Triage and analysis

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

### Investigating Initramfs Unpacking via unmkinitramfs

Initramfs is a crucial component in Linux boot processes, containing essential drivers and scripts. The `unmkinitramfs` tool extracts its contents, which attackers might exploit to insert malicious code, ensuring persistence. The detection rule identifies the execution of `unmkinitramfs`, flagging potential unauthorized modifications by monitoring process initiation events on Linux systems.

### Possible investigation steps

- Review the process execution details to confirm the presence of the unmkinitramfs command, focusing on the process.name field to ensure it matches "unmkinitramfs".
- Check the user context under which the unmkinitramfs command was executed to determine if it aligns with expected administrative activities or if it was run by an unauthorized user.
- Investigate the parent process of the unmkinitramfs execution to understand how the command was initiated and if it was part of a legitimate script or an unexpected process chain.
- Examine recent system logs and audit logs for any other suspicious activities or anomalies around the time of the unmkinitramfs execution, such as unauthorized access attempts or changes to critical system files.
- Assess the integrity of the initramfs image by comparing it with a known good version, if available, to identify any unauthorized modifications or inclusions of malicious code.

### False positive analysis

- Routine system maintenance or updates may trigger the rule when legitimate processes unpack initramfs for kernel updates. Users can create exceptions for known maintenance scripts or processes that regularly perform these actions.
- Automated backup or recovery solutions might use unmkinitramfs to verify or restore system images. Identify and exclude these processes if they are part of trusted backup operations.
- Developers or system administrators testing or customizing initramfs images for legitimate purposes could trigger the rule. Establish a whitelist for specific user accounts or scripts that are authorized to perform these tasks.
- Security tools or monitoring solutions that analyze initramfs contents for integrity checks might inadvertently trigger the rule. Ensure these tools are recognized and excluded from detection to prevent unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent potential lateral movement or data exfiltration by the attacker.
- Terminate any suspicious processes related to `unmkinitramfs` to halt any ongoing malicious activity.
- Conduct a thorough review of the initramfs image and its contents to identify and remove any unauthorized modifications or malicious code.
- Restore the initramfs image from a known good backup to ensure system integrity and remove any potential backdoors.
- Monitor the system for any further attempts to execute `unmkinitramfs` and investigate any such occurrences to determine if they are legitimate or part of an ongoing attack.
- Escalate the incident to the security operations team for further analysis and to determine if additional systems may be affected.
- Implement additional logging and monitoring for process execution events on Linux systems to enhance detection capabilities for similar threats in the future."""
risk_score = 21
rule_id = "c5fc788c-7576-4a02-b3d6-d2c016eb85a6"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Auditd Manager",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed") and
process.name == "unmkinitramfs" and not (
  ?process.parent.executable == "/usr/bin/lsinitramfs" or
  ?process.working_directory == "/usr/local/nutanix/ngt/python/bin"
)
'''

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

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

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

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

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

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

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

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

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

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

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

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

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

[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") and
process.name == "unmkinitramfs" and not (
  ?process.parent.executable == "/usr/bin/lsinitramfs" or
  ?process.working_directory == "/usr/local/nutanix/ngt/python/bin"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executableeq/usr/bin/lsinitramfsexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/lsinitramfs"
process.working_directoryeq/usr/local/nutanix/ngt/python/binexcludes:process.working_directory field:"process.working_directory" value:"/usr/local/nutanix/ngt/python/bin"

Installation of Security Support Provider

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

Identifies registry modifications related to the Windows Security Support Provider (SSP) configuration. Adversaries may abuse this to establish persistence in an environment.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies registry modifications related to the Windows Security Support Provider (SSP) configuration. Adversaries may
abuse this to establish persistence in an environment.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.registry-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Installation of Security Support Provider"
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 Installation of Security Support Provider

Security Support Providers (SSPs) in Windows environments facilitate authentication processes. Adversaries may exploit SSPs by modifying registry entries to maintain persistence or evade defenses. The detection rule identifies suspicious changes to specific registry paths associated with SSPs, excluding legitimate processes like msiexec.exe, to flag potential unauthorized modifications indicative of malicious activity.

### Possible investigation steps

- Review the registry change event details to identify the specific registry path that was modified, focusing on paths related to "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Security Packages" and "HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\OSConfig\\Security Packages".
- Investigate the process responsible for the registry modification by examining the process executable path, ensuring it is not a legitimate process like "C:\\Windows\\System32\\msiexec.exe" or "C:\\Windows\\SysWOW64\\msiexec.exe".
- Check the historical activity of the identified process to determine if it has been involved in other suspicious activities or registry changes.
- Analyze the user account context under which the process was executed to assess if it aligns with expected behavior or if it indicates potential compromise.
- Correlate the event with other security alerts or logs from data sources such as Elastic Endgame, Elastic Defend, Sysmon, Microsoft Defender XDR, or SentinelOne to gather additional context and identify any related malicious activity.
- Evaluate the potential impact of the registry change on system security and persistence mechanisms, considering the MITRE ATT&CK tactic of Persistence and technique T1547.

### False positive analysis

- Legitimate software installations or updates may trigger registry changes in SSP paths. Users can create exceptions for known software installers or updaters that frequently modify these registry entries.
- System administrators performing routine maintenance or configuration changes might inadvertently cause registry modifications. Document and exclude these activities when they are verified as non-threatening.
- Security software updates, including those from Microsoft or third-party vendors, may alter SSP configurations as part of their normal operation. Monitor and whitelist these updates to prevent false alerts.
- Automated deployment tools or scripts that modify system settings could lead to false positives. Ensure these tools are accounted for and excluded if they are part of regular operations.
- Custom scripts or applications developed in-house that interact with SSP registry paths should be reviewed and excluded if they are deemed safe and necessary for business operations.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes that are not whitelisted, especially those modifying the registry paths associated with Security Support Providers.
- Restore the modified registry entries to their original state using a known good backup or by manually correcting the entries to remove unauthorized changes.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious software or artifacts.
- Review and update access controls and permissions to ensure that only authorized personnel can modify critical registry paths related to Security Support Providers.
- Monitor the affected system and network for any signs of re-infection or further suspicious activity, focusing on registry changes and process executions.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised."""
risk_score = 47
rule_id = "e86da94d-e54b-4fb5-b96c-cecff87e8787"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type == "change" and
  registry.value : "Security Packages" and
  registry.path : (
      "*\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Security Packages",
      "*\\SYSTEM\\*ControlSet*\\Control\\Lsa\\OSConfig\\Security Packages"
  ) and
  not process.executable : (
        "C:\\Windows\\System32\\msiexec.exe",
        "C:\\Windows\\SysWOW64\\msiexec.exe",
        /* Crowdstrike specific exclusion as it uses NT Object paths */
        "\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe",
        "\\Device\\HarddiskVolume*\\Windows\\SysWOW64\\msiexec.exe"
  )
'''

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 Registry Events](https://ela.st/sysmon-event-reg-setup)
"""


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



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


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

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type == "change" and
  registry.value : "Security Packages" and
  registry.path : (
      "*\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Security Packages",
      "*\\SYSTEM\\*ControlSet*\\Control\\Lsa\\OSConfig\\Security Packages"
  ) and
  not process.executable : (
        "C:\\Windows\\System32\\msiexec.exe",
        "C:\\Windows\\SysWOW64\\msiexec.exe",
        "\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe",
        "\\Device\\HarddiskVolume*\\Windows\\SysWOW64\\msiexec.exe"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • change corpus 89 (elastic 89)
field:"event.type" kind:eq value:"change"
registry.pathwildcard
  • *\SYSTEM\*ControlSet*\Control\Lsa\OSConfig\Security Packages
  • *\SYSTEM\*ControlSet*\Control\Lsa\Security Packages
field:"TargetObject" kind:wildcard
registry.valuewildcard
  • Security Packages
field:"registry_value_name" kind:wildcard value:"Security Packages"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcardC:\Windows\System32\msiexec.exe, C:\Windows\SysWOW64\msiexec.exe, \Device\HarddiskVolume*\Windows\System32\msiexec.exe, \Device\HarddiskVolume*\Windows\SysWOW64\msiexec.exeexcludes:process.executable

Kubernetes Pod Exec Sensitive File or Credential Path Access

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

Detects Kubernetes pod exec sessions whose decoded command line references high-value host or in-cluster paths and material types: mounted service account or platform tokens, kubelet and control-plane configuration areas, host identity stores, root dot-directories for cloud and kubeconfig material, common private-key and keystore extensions, process environment dumps, and configuration filenames suggestive of embedded secrets. The intent is to catch interactive or scripted access that often precedes lateral movement, privilege escalation, or credential theft from the node or workload boundary. A narrow exclusion ignores benign reads of resolv.conf. The query also labels an access_type bucket to speed triage without altering the detection predicates you validated.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Detects Kubernetes pod exec sessions whose decoded command line references high-value host or in-cluster paths and
material types: mounted service account or platform tokens, kubelet and control-plane configuration areas, host
identity stores, root dot-directories for cloud and kubeconfig material, common private-key and keystore extensions,
process environment dumps, and configuration filenames suggestive of embedded secrets. The intent is to catch
interactive or scripted access that often precedes lateral movement, privilege escalation, or credential theft from
the node or workload boundary. A narrow exclusion ignores benign reads of resolv.conf. The query also labels an
access_type bucket to speed triage without altering the detection predicates you validated.
"""
from = "now-6m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Kubernetes Pod Exec Sensitive File or Credential Path Access"
note = """## Triage and analysis

### Investigating Kubernetes Pod Exec Sensitive File or Credential Path Access

This alert ties Kubernetes audit exec events to reconstructed command text that matches sensitive path and filename
patterns. Use the Esql.access_type field to prioritize: IRSA token paths, default Kubernetes service account tokens,
other mounted secrets, certificates and keystores, Kubernetes static config, kubelet state, host passwd or shadow,
user home credential stores, and proc environ scraping.

### Possible investigation steps

- Identify the Kubernetes user, groups, impersonation, source IP, and user agent for the exec caller.
- Map objectRef namespace, pod, and container to an owning team, image digest, and change history.
- Compare Esql.executed_command against known runbooks; capture follow-on audit activity such as additional execs,
  secret reads at the API layer, or RBAC changes.
- If host-level paths appear, determine whether the workload runs privileged, with hostPath mounts, or on nodes where
  break-glass access is expected.

### False positive analysis

- Diagnostic images and vendor agents sometimes cat resolv.conf or kubeconfig-like paths; the rule excludes resolv.conf
  but other matches may still be legitimate—baseline stable automation identities.
- Training containers that deliberately demonstrate passwd reads can trigger; scope exceptions to those images and
  namespaces.

### Response and remediation

- If malicious, end the exec session, isolate the pod or node, rotate any credentials that could have been read,
  review and tighten pods exec RBAC and admission controls, and inspect for persistence added after the session.
"""
references = [
    "https://attack.mitre.org/techniques/T1552/001/",
    "https://attack.mitre.org/techniques/T1552/007/",
]
risk_score = 73
rule_id = "b2c3d4e5-f6a7-4890-b1c2-d3e4f5a60789"
severity = "high"
tags = [
    "Data Source: Kubernetes",
    "Data Source: Kubernetes API Server Audit Logs",
    "Domain: Kubernetes",
    "Platform: Kubernetes",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Execution",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-kubernetes.audit_logs-* metadata _id, _index, _version
| WHERE kubernetes.audit.objectRef.subresource == "exec"
  AND kubernetes.audit.requestURI LIKE "*command=*"
| EVAL Esql.decoded_uri = URL_DECODE(kubernetes.audit.requestURI)
| GROK Esql.decoded_uri "%{DATA}/exec\\?%{DATA:raw_commands}&(?:container|stdin|stdout|stderr)=%{GREEDYDATA}"
| EVAL command = REPLACE(raw_commands, "command=", "")
| EVAL command = REPLACE(command, "&", " ")
| EVAL Esql.executed_command = REPLACE(command, "\\+", " ")
| WHERE Esql.executed_command IS NOT NULL 
  AND Esql.executed_command RLIKE """.*(/var/run/secrets/|/etc/kubernetes/|/var/lib/kubelet/|/etc/shadow|/etc/passwd|/etc/sudoers|(/root|/home/[^/]+)/\.(ssh|aws|azure|kube|config/gcloud)|\.p12|\.pem|\.key|\.jks|\.keystore|/etc/.*\.conf.*(password|secret|key|token|credential)|/proc/.*/environ).*"""
  AND NOT Esql.executed_command RLIKE """.*/etc/resolv\.conf.*"""
| EVAL Esql.access_type = CASE(
    Esql.executed_command RLIKE """.*/var/run/secrets/eks\.amazonaws\.com.*""", "AWS_IRSA_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/azure/tokens/.*""", "AZURE_WORKLOAD_IDENTITY_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/tokens/gcp-ksa/.*""", "GCP_WORKLOAD_IDENTITY_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/kubernetes\.io/serviceaccount/token.*""", "K8S_SA_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/.*""", "MOUNTED_SECRET",
    Esql.executed_command RLIKE """.*\.(p12|pem|key|jks|keystore).*""", "CERTIFICATE_OR_KEY",
    Esql.executed_command RLIKE """.*/etc/kubernetes/.*""", "K8S_CONFIG",
    Esql.executed_command RLIKE """.*/var/lib/kubelet/.*""", "KUBELET_CONFIG",
    Esql.executed_command RLIKE """.*/etc/shadow.*""", "HOST_CREDENTIALS",
    Esql.executed_command RLIKE """.*/etc/passwd.*""", "USER_ENUMERATION",
    Esql.executed_command RLIKE """.*/etc/sudoers.*""", "SUDOERS_ACCESS",
    Esql.executed_command RLIKE """.*(/root|/home/[^/]+)/\.(ssh|aws|azure|kube|config/gcloud).*""", "USER_CREDENTIALS",
    Esql.executed_command RLIKE """.*/proc/.*/environ.*""", "PROCESS_ENV_SECRETS",
    Esql.executed_command RLIKE """.*/etc/.*\.conf.*(password|secret|key|token|credential).*""", "EMBEDDED_CONFIG_SECRET",
    "OTHER_SENSITIVE"
  )
| KEEP Esql.*, user.name, user_agent.original, event.*, source.ip, kubernetes.audit.*, _id, _version, _index, data_stream.namespace
'''

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: from

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

Stage 2: where

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

Stage 3: eval

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

Stage 4: grok

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

Stage 5: eval

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

Stage 6: eval

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

Stage 7: eval

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

Stage 8: where

| WHERE Esql.executed_command IS NOT NULL 
  AND Esql.executed_command RLIKE """.*(/var/run/secrets/|/etc/kubernetes/|/var/lib/kubelet/|/etc/shadow|/etc/passwd|/etc/sudoers|(/root|/home/[^/]+)/\.(ssh|aws|azure|kube|config/gcloud)|\.p12|\.pem|\.key|\.jks|\.keystore|/etc/.*\.conf.*(password|secret|key|token|credential)|/proc/.*/environ).*"""
  AND NOT Esql.executed_command RLIKE """.*/etc/resolv\.conf.*"""

Stage 9: eval

| EVAL Esql.access_type = CASE(
    Esql.executed_command RLIKE """.*/var/run/secrets/eks\.amazonaws\.com.*""", "AWS_IRSA_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/azure/tokens/.*""", "AZURE_WORKLOAD_IDENTITY_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/tokens/gcp-ksa/.*""", "GCP_WORKLOAD_IDENTITY_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/kubernetes\.io/serviceaccount/token.*""", "K8S_SA_TOKEN",
    Esql.executed_command RLIKE """.*/var/run/secrets/.*""", "MOUNTED_SECRET",
    Esql.executed_command RLIKE """.*\.(p12|pem|key|jks|keystore).*""", "CERTIFICATE_OR_KEY",
    Esql.executed_command RLIKE """.*/etc/kubernetes/.*""", "K8S_CONFIG",
    Esql.executed_command RLIKE """.*/var/lib/kubelet/.*""", "KUBELET_CONFIG",
    Esql.executed_command RLIKE """.*/etc/shadow.*""", "HOST_CREDENTIALS",
    Esql.executed_command RLIKE """.*/etc/passwd.*""", "USER_ENUMERATION",
    Esql.executed_command RLIKE """.*/etc/sudoers.*""", "SUDOERS_ACCESS",
    Esql.executed_command RLIKE """.*(/root|/home/[^/]+)/\.(ssh|aws|azure|kube|config/gcloud).*""", "USER_CREDENTIALS",
    Esql.executed_command RLIKE """.*/proc/.*/environ.*""", "PROCESS_ENV_SECRETS",
    Esql.executed_command RLIKE """.*/etc/.*\.conf.*(password|secret|key|token|credential).*""", "EMBEDDED_CONFIG_SECRET",
    "OTHER_SENSITIVE"
  )
Esql.access_type =
ifEsql.executed_command RLIKE """.*/var/run/secrets/eks\.amazonaws\.com.*""""AWS_IRSA_TOKEN"
elifEsql.executed_command RLIKE """.*/var/run/secrets/azure/tokens/.*""""AZURE_WORKLOAD_IDENTITY_TOKEN"
elifEsql.executed_command RLIKE """.*/var/run/secrets/tokens/gcp-ksa/.*""""GCP_WORKLOAD_IDENTITY_TOKEN"
elifEsql.executed_command RLIKE """.*/var/run/secrets/kubernetes\.io/serviceaccount/token.*""""K8S_SA_TOKEN"
elifEsql.executed_command RLIKE """.*/var/run/secrets/.*""""MOUNTED_SECRET"
elifEsql.executed_command RLIKE """.*\.(p12|pem|key|jks|keystore).*""""CERTIFICATE_OR_KEY"
elifEsql.executed_command RLIKE """.*/etc/kubernetes/.*""""K8S_CONFIG"
elifEsql.executed_command RLIKE """.*/var/lib/kubelet/.*""""KUBELET_CONFIG"
elifEsql.executed_command RLIKE """.*/etc/shadow.*""""HOST_CREDENTIALS"
elifEsql.executed_command RLIKE """.*/etc/passwd.*""""USER_ENUMERATION"
elifEsql.executed_command RLIKE """.*/etc/sudoers.*""""SUDOERS_ACCESS"
elifEsql.executed_command RLIKE """.*(/root|/home/[^/]+)/\.(ssh|aws|azure|kube|config/gcloud).*""""USER_CREDENTIALS"
elifEsql.executed_command RLIKE """.*/proc/.*/environ.*""""PROCESS_ENV_SECRETS"
elifEsql.executed_command RLIKE """.*/etc/.*\.conf.*(password|secret|key|token|credential).*""""EMBEDDED_CONFIG_SECRET"
else"OTHER_SENSITIVE"

Stage 10: keep

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

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Esql.executed_commandregex_match.*/etc/resolv.conf.*excludes:Esql.executed_command field:"Esql.executed_command" value:".*/etc/resolv.conf.*"

Output Fields

These fields are emitted when the rule matches.

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

M365 Exchange Anti-Phish Rule Modification

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

Identifies the modification of an anti-phishing rule in Microsoft 365. By default, Microsoft 365 includes built-in features that help protect users from phishing attacks. Anti-phishing rules increase this protection by refining settings to better detect and prevent attacks.

Known False Positives

  • An anti-phishing rule may be deleted by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies the modification of an anti-phishing rule in Microsoft 365. By default, Microsoft 365 includes built-in
features that help protect users from phishing attacks. Anti-phishing rules increase this protection by refining
settings to better detect and prevent attacks.
"""
false_positives = [
    """
    An anti-phishing rule may be deleted by a system or network administrator. Verify that the configuration change was
    expected. Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Anti-Phish Rule Modification"
note = """## Triage and analysis

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

### Investigating M365 Exchange Anti-Phish Rule Modification

Microsoft 365's anti-phishing rules are crucial for safeguarding users against phishing attacks by enhancing detection and prevention settings. Adversaries may attempt to modify or disable these rules to facilitate phishing campaigns, gaining unauthorized access. The detection rule monitors for successful modifications or disabling of anti-phishing rules, signaling potential malicious activity by tracking specific actions within the Exchange environment.

### Possible investigation steps

- Review the event logs for entries with event.dataset set to o365.audit and event.provider set to Exchange to confirm the context of the alert.
- Check the event.action field for "Remove-AntiPhishRule" or "Disable-AntiPhishRule" to identify the specific action taken on the anti-phishing rule.
- Verify the event.outcome field to ensure the action was successful, indicating a potential security concern.
- Identify the user or account associated with the modification by examining the relevant user fields in the event log.
- Investigate the user's recent activity and access patterns to determine if there are any other suspicious actions or anomalies.
- Assess the impact of the rule modification by reviewing any subsequent phishing attempts or security incidents that may have occurred.
- Consider reverting the changes to the anti-phishing rule and implementing additional security measures if unauthorized access is confirmed.

### False positive analysis

- Administrative changes: Legitimate administrative tasks may involve modifying or disabling anti-phishing rules for testing or configuration purposes. To manage this, create exceptions for known administrative accounts or scheduled maintenance windows.
- Security audits: Regular security audits might require temporary adjustments to anti-phishing rules. Document these activities and exclude them from alerts by correlating with audit logs.
- Third-party integrations: Some third-party security tools may interact with Microsoft 365 settings, triggering rule modifications. Identify these tools and exclude their actions from triggering alerts by using their specific identifiers.
- Policy updates: Organizational policy changes might necessitate updates to anti-phishing rules. Ensure these changes are documented and exclude them from alerts by associating them with approved change management processes.

### Response and remediation

- Immediately isolate the affected user accounts to prevent further unauthorized access and potential spread of phishing attacks.
- Revert any unauthorized changes to the anti-phishing rules by restoring them to their previous configurations using backup or documented settings.
- Conduct a thorough review of recent email logs and user activity to identify any potential phishing emails that may have bypassed the modified rules and take steps to quarantine or delete them.
- Notify the security team and relevant stakeholders about the incident, providing details of the rule modification and any identified phishing attempts.
- Escalate the incident to the incident response team for further investigation and to determine if additional systems or data have been compromised.
- Implement enhanced monitoring and alerting for any further attempts to modify anti-phishing rules, ensuring that similar activities are detected promptly.
- Review and update access controls and permissions for administrative actions within Microsoft 365 to ensure that only authorized personnel can modify security settings.

## Setup

The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://docs.microsoft.com/en-us/powershell/module/exchange/remove-antiphishrule?view=exchange-ps",
    "https://docs.microsoft.com/en-us/powershell/module/exchange/disable-antiphishrule?view=exchange-ps",
]
risk_score = 47
rule_id = "97314185-2568-4561-ae81-f3e480e5e695"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Microsoft 365",
    "Use Case: Configuration Audit",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

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


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


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

Stages and Predicates

Stage 1: query

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

Indicators

These rows show field, operator, and value matches.

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

M365 Exchange MFA Notification Email Deleted or Moved

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

Identifies when an MFA enrollment, registration, or security notification email is deleted or moved to deleted items in Microsoft 365 Exchange. Adversaries who compromise accounts and register their own MFA device often delete the notification emails to cover their tracks and prevent the legitimate user from noticing the unauthorized change. This technique is commonly observed in business email compromise (BEC) and account takeover attacks.

Known False Positives

  • Users legitimately deleting MFA notification emails after reviewing them.
  • Automated mailbox rules that move security notifications to specific folders.
  • Email retention policies that automatically delete old notification emails.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies when an MFA enrollment, registration, or security notification email is deleted or moved to deleted items in
Microsoft 365 Exchange. Adversaries who compromise accounts and register their own MFA device often delete the
notification emails to cover their tracks and prevent the legitimate user from noticing the unauthorized change. This
technique is commonly observed in business email compromise (BEC) and account takeover attacks.
"""
false_positives = [
    "Users legitimately deleting MFA notification emails after reviewing them.",
    "Automated mailbox rules that move security notifications to specific folders.",
    "Email retention policies that automatically delete old notification emails.",
]
from = "now-9m"
index = ["filebeat-*", "logs-o365.audit-*"]
language = "eql"
license = "Elastic License v2"
name = "M365 Exchange MFA Notification Email Deleted or Moved"
note = """## Triage and Analysis

### Investigating M365 Exchange MFA Notification Email Deleted or Moved

This rule detects when emails containing MFA enrollment or security notification keywords are deleted or moved to deleted items. Attackers who gain access to an account and register their own MFA device will often immediately delete the notification email to prevent the legitimate user from detecting the compromise.

#### Possible Investigation Steps

- Identify the user whose mailbox had the email deleted and determine if they recently enrolled a new MFA device.
- Review Azure AD sign-in logs for the user around the time of the deletion for authentication anomalies.
- Check Azure AD audit logs for recent MFA method registrations or changes for this user.
- Review the source IP address and determine if it matches the user's typical access patterns.
- Look for other suspicious mailbox activities from the same session (inbox rules, email forwarding).
- Determine if the user was aware of and initiated the MFA enrollment that generated the notification.

### False Positive Analysis

- Users may legitimately delete MFA notification emails after reviewing and confirming the enrollment.
- Some organizations have mailbox rules that automatically organize or delete notification emails.
- Consider creating exceptions for users who frequently manage MFA enrollments (IT help desk).

### Response and Remediation

- If unauthorized MFA enrollment is confirmed, immediately remove the attacker's MFA method from the account.
- Revoke all active sessions and refresh tokens for the affected user.
- Reset the user's credentials and require reauthentication.
- Review inbox rules for any malicious forwarding or deletion rules.
- Check for data exfiltration or other malicious activities during the compromise window.
- Implement conditional access policies to restrict MFA registration to trusted locations/devices.
"""
references = [
    "https://cloud.google.com/blog/topics/threat-intelligence/expansion-shinyhunters-saas-data-theft"
]
risk_score = 21
rule_id = "c9636a6e-125e-11f1-9cd3-f661ea17fbce"
severity = "low"
tags = [
    "Domain: Cloud",
    "Domain: SaaS",
    "Data Source: Microsoft 365",
    "Data Source: Microsoft 365 Audit Logs",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
web where data_stream.dataset == "o365.audit" and
    event.provider == "Exchange" and
    event.action in ("SoftDelete", "HardDelete", "MoveToDeletedItems") and
    event.outcome == "success" and
    (
        o365.audit.AffectedItems.Subject like~ (
            /* new + (mfa|multi-|factor|method|device|security) */
            "*new mfa*", "*new multi*", "*new factor*", "*new method*", "*new device*", "*new security*",
            /* 2fa and 2-step */
            "*2fa*", "*2-step*",
            /* mfa + action verbs */
            "*mfa enroll*", "*mfa register*", "*mfa added*", "*mfa change*",
            "*mfa verify*", "*mfa update*", "*mfa activate*", "*mfa configure*", "*mfa setup*",
            /* factor + action verbs */
            "*factor enroll*", "*factor register*", "*factor added*", "*factor change*",
            "*factor verify*", "*factor update*", "*factor activate*", "*factor configure*", "*factor setup*",
            /* method + action verbs */
            "*method enroll*", "*method register*", "*method added*", "*method change*",
            "*method verify*", "*method update*", "*method activate*", "*method configure*", "*method setup*",
            /* device + action verbs */
            "*device enroll*", "*device register*", "*device added*", "*device change*",
            "*device verify*", "*device update*", "*device activate*", "*device configure*", "*device setup*",
            /* security + action verbs */
            "*security enroll*", "*security register*", "*security added*", "*security change*",
            "*security verify*", "*security update*", "*security activate*", "*security configure*", "*security setup*",
            /* Additional security notifications */
            "*authenticator*", "*verification code*", "*security info*", "*security alert*"
        ) and not
        o365.audit.AffectedItems.Subject like~ ("*sign-in*", "*sign in*", "*log-in*", "*log in*", "*logon*")
    )
'''


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

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

[[rule.threat.technique.subtechnique]]
id = "T1070.008"
name = "Clear Mailbox Data"
reference = "https://attack.mitre.org/techniques/T1070/008/"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1098.005"
name = "Device Registration"
reference = "https://attack.mitre.org/techniques/T1098/005/"

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

Stages and Predicates

Stage 1: web

web where data_stream.dataset == "o365.audit" and
    event.provider == "Exchange" and
    event.action in ("SoftDelete", "HardDelete", "MoveToDeletedItems") and
    event.outcome == "success" and
    (
        o365.audit.AffectedItems.Subject like~ (
            "*new mfa*", "*new multi*", "*new factor*", "*new method*", "*new device*", "*new security*",
            "*2fa*", "*2-step*",
            "*mfa enroll*", "*mfa register*", "*mfa added*", "*mfa change*",
            "*mfa verify*", "*mfa update*", "*mfa activate*", "*mfa configure*", "*mfa setup*",
            "*factor enroll*", "*factor register*", "*factor added*", "*factor change*",
            "*factor verify*", "*factor update*", "*factor activate*", "*factor configure*", "*factor setup*",
            "*method enroll*", "*method register*", "*method added*", "*method change*",
            "*method verify*", "*method update*", "*method activate*", "*method configure*", "*method setup*",
            "*device enroll*", "*device register*", "*device added*", "*device change*",
            "*device verify*", "*device update*", "*device activate*", "*device configure*", "*device setup*",
            "*security enroll*", "*security register*", "*security added*", "*security change*",
            "*security verify*", "*security update*", "*security activate*", "*security configure*", "*security setup*",
            "*authenticator*", "*verification code*", "*security info*", "*security alert*"
        ) and not
        o365.audit.AffectedItems.Subject like~ ("*sign-in*", "*sign in*", "*log-in*", "*log in*", "*logon*")
    )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • o365.audit corpus 8 (elastic 8)
field:"data_stream.dataset" kind:eq value:"o365.audit"
event.actionin
  • HardDelete
  • MoveToDeletedItems
  • SoftDelete
field:"EventType" kind:in
event.outcomeeq
  • success corpus 82 (elastic 82)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • Exchange corpus 3 (elastic 3)
field:"Provider_Name" kind:eq value:"Exchange"
o365.audit.AffectedItems.Subjectwildcard
  • *2-step*
  • *2fa*
  • *authenticator*
  • *device activate*
  • *device added*
  • *device change*
  • *device configure*
  • *device enroll*
  • *device register*
  • *device setup*
  • *device update*
  • *device verify*
  • *factor activate*
  • *factor added*
  • *factor change*
  • *factor configure*
  • *factor enroll*
  • *factor register*
  • *factor setup*
  • *factor update*
  • *factor verify*
  • *method activate*
  • *method added*
  • *method change*
  • *method configure*
  • *method enroll*
  • *method register*
  • *method setup*
  • *method update*
  • *method verify*
  • *mfa activate*
  • *mfa added*
  • *mfa change*
  • *mfa configure*
  • *mfa enroll*
  • *mfa register*
  • *mfa setup*
  • *mfa update*
  • *mfa verify*
  • *new device*
  • *new factor*
  • *new method*
  • *new mfa*
  • *new multi*
  • *new security*
  • *security activate*
  • *security added*
  • *security alert*
  • *security change*
  • *security configure*
  • *security enroll*
  • *security info*
  • *security register*
  • *security setup*
  • *security update*
  • *security verify*
  • *verification code*
field:"o365.audit.AffectedItems.Subject" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
o365.audit.AffectedItems.Subjectmatchsign-in, sign in, log-in, log in, logonexcludes:o365.audit.AffectedItems.Subject

Manual Loading of a Suspicious Chromium Extension

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

Detects the manual loading of a Chromium-based browser extension via command line arguments. This activity is suspicious and could indicate a threat actor loading a malicious extension to persist or collect browsing secrets such as cookies and authentication tokens.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2026/01/30"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Detects the manual loading of a Chromium-based browser extension via command line arguments. This activity 
is suspicious and could indicate a threat actor loading a malicious extension to persist or collect browsing 
secrets such as cookies and authentication tokens.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Manual Loading of a Suspicious Chromium Extension"
references = [
    "https://cedowens.medium.com/remotely-dumping-chrome-cookies-revisited-b25343257209",
    "https://github.com/cedowens/Dump-Chrome-Cookies"
]
risk_score = 73
rule_id = "f1f3070e-045c-4e03-ae58-d11d43d2ee51"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Credential Access",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "eql"
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 Manual Loading of a Suspicious Chromium Extension

Chromium-based browsers support loading extensions from local directories using the --load-extension command line flag, bypassing the normal extension store installation process. Threat actors abuse this capability to load malicious extensions that can steal cookies, capture session tokens, intercept form submissions, or inject content into web pages. Unlike store-installed extensions, manually loaded extensions don't undergo security review and can request arbitrary permissions. This detection rule identifies browsers launched with the --load-extension flag from suspicious parent processes.

### Possible investigation steps

- Examine the process.args containing --load-extension to identify the full path of the extension being loaded.
- Navigate to the extension directory and review the manifest.json to understand the permissions requested, including access to cookies, tabs, or web requests.
- Analyze the extension's JavaScript files for malicious functionality such as cookie exfiltration, form interception, or communication with external servers.
- Review the process.parent.executable to understand how the browser was launched with the malicious extension and trace back to the initial execution vector.
- Check for network connections made by the browser process to identify potential data exfiltration endpoints.
- Review browser profile data for evidence of credential theft or session hijacking.
- Search for the same extension path across other systems to identify potential lateral movement or widespread deployment.

### False positive analysis

- Cypress and other automated testing frameworks load extensions for browser automation. These are already excluded in the query.
- ChromeDriver used for Selenium testing loads extensions programmatically. These paths are excluded in the query.
- Developer debugging may require manual extension loading during active development. Verify with development teams if such activities are expected.
- Enterprise browser customization may deploy internal extensions via command line. Review with IT operations to document approved extensions.

### Response and remediation

- Immediately terminate the browser process to stop any ongoing malicious activity such as cookie theft or session hijacking.
- Remove the malicious extension directory from the filesystem to prevent future loading.
- Clear browser session data including cookies, cached credentials, and saved passwords for the affected browser profile.
- Review and revoke any sessions for sensitive web applications that were accessed while the extension was loaded.
- Investigate how the malicious extension was deployed and remediate the initial access vector.
- Block the malicious extension path or hash in endpoint security policies to prevent reloading.
- Reset passwords for web accounts that may have been compromised through the malicious extension.
- Check browser sync settings to ensure the malicious extension doesn't propagate to other devices.
"""
query = '''
process where host.os.type == "macos" and event.action == "exec" and
  process.name in ("Google Chrome", "Brave Browser", "Microsoft Edge") and
  process.args like "--load-extension=/*" and
  not (process.args like "--load-extension=/Users/*/Library/Application Support/Cypress/*" and
       process.parent.executable like ("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
                                        "/Users/*/Library/Caches/Cypress/*/Cypress.app/Contents/MacOS/Cypress")) and
  not process.parent.executable like ("/opt/homebrew/Caskroom/chromedriver/*/chromedriver",
                                    "/Applications/Cypress.app/Contents/MacOS/Cypress",
                                    "/usr/local/bin/chromedriver")
'''

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

[[rule.threat.technique]]
id = "T1176"
name = "Software Extensions"
reference = "https://attack.mitre.org/techniques/T1176/"

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

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

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

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

[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 = "T1185"
name = "Browser Session Hijacking"
reference = "https://attack.mitre.org/techniques/T1185/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "macos" and event.action == "exec" and
  process.name in ("Google Chrome", "Brave Browser", "Microsoft Edge") and
  process.args like "--load-extension=/*" and
  not (process.args like "--load-extension=/Users/*/Library/Application Support/Cypress/*" and
       process.parent.executable like ("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
                                        "/Users/*/Library/Caches/Cypress/*/Cypress.app/Contents/MacOS/Cypress")) and
  not process.parent.executable like ("/opt/homebrew/Caskroom/chromedriver/*/chromedriver",
                                    "/Applications/Cypress.app/Contents/MacOS/Cypress",
                                    "/usr/local/bin/chromedriver")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
process.argswildcard
  • --load-extension=/*
field:"process.args" kind:wildcard value:"--load-extension=/*"
process.namein
  • Brave Browser corpus 3 (elastic 3)
  • Google Chrome corpus 4 (elastic 4)
  • Microsoft Edge corpus 2 (elastic 2)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard--load-extension=/Users/*/Library/Application Support/Cypress/*excludes:process.args field:"process.args" value:"--load-extension=/Users/*/Library/Application Support/Cypress/*"
process.parent.executablewildcard/Applications/Google Chrome.app/Contents/MacOS/Google Chrome, /Users/*/Library/Caches/Cypress/*/Cypress.app/Contents/MacOS/Cypressexcludes:process.parent.executable field:"process.parent.executable" value:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" field:"process.parent.executable" value:"/Users/*/Library/Caches/Cypress/*/Cypress.app/Contents/MacOS/Cypress"
process.parent.executablewildcard/opt/homebrew/Caskroom/chromedriver/*/chromedriver, /Applications/Cypress.app/Contents/MacOS/Cypress, /usr/local/bin/chromedriverexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/homebrew/Caskroom/chromedriver/*/chromedriver" field:"process.parent.executable" value:"/Applications/Cypress.app/Contents/MacOS/Cypress" field:"process.parent.executable" value:"/usr/local/bin/chromedriver"

Microsoft Common Language Runtime Loaded from Suspicious Memory

#
Source
github.com/elastic/protections-artifacts

Identifies the load of the Microsoft Common Language Runtime DLL CLR.dll from unbacked memory region with suspicious memory allocation properties. This could be the result of attempts to load an assembly from an already injected process.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies the load of the Microsoft Common Language Runtime DLL CLR.dll from unbacked memory region with suspicious
memory allocation properties. This could be the result of attempts to load an assembly from an already injected process.
"""
id = "ad2c6fcc-89d3-4939-85d9-d7114d6bbf14"
license = "Elastic License v2"
name = "Microsoft Common Language Runtime Loaded from Suspicious Memory"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.29"

query = '''
library where dll.name : "clr.dll" and
 process.thread.Ext.call_stack_summary : 
             ("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked", 
              "ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*mscoreei.dll!CreateInterface*") and
 not (process.executable : "?:\\Program Files\\Dell\\DTP\\DiagnosticsSubAgent\\Dell.TechHub.Diagnostics.SubAgent.exe" and
      process.code_signature.trusted == true and process.code_signature.subject_name : "Dell Inc") and
 not (process.code_signature.trusted == true and 
      process.code_signature.subject_name : ("Azul Systems, Inc.", "JetBrains s.r.o.", "HAYLEM Technologies Inc.", "MicroStrategy, Inc.", "Oracle America, Inc.")) and
 not (process.executable : "C:\\ManageEngine\\ADManager Plus\\jre\\bin\\java.exe" and 
      process.code_signature.subject_name : "Oracle America, Inc." and process.code_signature.trusted == true) and 
 not (process.executable : "?:\\Program Files*\\Amazon Corretto\\jdk*\\bin\\java.exe" and 
      process.code_signature.subject_name : ("Amazon.com Services LLC", "Amazon Services LLC", "Adaptive Protocols, Inc.") and process.code_signature.trusted == true)  and 
 not (process.executable : "?:\\ManageEngine\\PAM360\\jre\\bin\\java.exe" and
      process.code_signature.trusted == true and
      process.code_signature.subject_name : ("Oracle America, Inc.", "Eclipse.org Foundation, Inc.")) and
 not (process.executable : "*\\EL.AudioVideoConversion.Console.exe" and
      process.code_signature.trusted == true and
      process.code_signature.subject_name : "NEXUS / E&L GmbH") and
 not process.executable :
               ("?:\\Program Files\\Microsoft Visual Studio\\*.exe",
                "?:\\Program Files (x86)\\Microsoft Visual Studio\\*.exe",
                "?:\\Program Files (x86)\\PMP\\jre\\bin\\java.exe",
                "?:\\Program Files\\ManageEngine\\PMP\\jre\\bin\\java.exe",
                "?:\\Program Files\\ManageEngine\\PAM360\\jre\\bin\\java.exe",
                "?:\\Program Files (x86)\\Adaptiva\\AdaptivaClient\\bin\\AdaptivaClientService.exe",
                "?:\\Program Files\\Adaptiva\\AdaptivaClient\\bin\\AdaptivaClientService.exe",
                "C:\\Program Files\\Siemens\\teamplay\\bin\\*\\syngo.Cloud.Receiver.Plugin.DicomTagResolver.exe",
                "?:\\Program Files\\Sql Server Extension\\SqlServerExtension.Service.exe",
                "C:\\Program Files\\Siemens\\CloudLink\\*.exe",
                "C:\\Program Files (x86)\\Razer\\Razer Cortex\\RazerCortex.exe",
                "C:\\Program Files\\Guard\\Data Vault Publisher for Citect\\*.exe",
                "C:\\Program Files\\Koios\\Koios DS\\KoiosDS-MVC-App.exe",
                "?:\\Program Files\\Commvault\\ContentStore\\DotNetCore\\dotnet.exe",
                "?:\\Program Files\\Siemens\\ABT Site\\Bin\\Siemens.BASys.ABTSite.exe") and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes : ("c5f8774883ec10c5fb1104244883ec104889042449ba00000000000000004*",
                                                      "*488b8d48ffffff48894b104c8b658049894424084c896588c745c0*"))
'''

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

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


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

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

Stage 1: library

library where dll.name : "clr.dll" and
 process.thread.Ext.call_stack_summary : 
             ("ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked", 
              "ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*mscoreei.dll!CreateInterface*") and
 not (process.executable : "?:\\Program Files\\Dell\\DTP\\DiagnosticsSubAgent\\Dell.TechHub.Diagnostics.SubAgent.exe" and
      process.code_signature.trusted == true and process.code_signature.subject_name : "Dell Inc") and
 not (process.code_signature.trusted == true and 
      process.code_signature.subject_name : ("Azul Systems, Inc.", "JetBrains s.r.o.", "HAYLEM Technologies Inc.", "MicroStrategy, Inc.", "Oracle America, Inc.")) and
 not (process.executable : "C:\\ManageEngine\\ADManager Plus\\jre\\bin\\java.exe" and 
      process.code_signature.subject_name : "Oracle America, Inc." and process.code_signature.trusted == true) and 
 not (process.executable : "?:\\Program Files*\\Amazon Corretto\\jdk*\\bin\\java.exe" and 
      process.code_signature.subject_name : ("Amazon.com Services LLC", "Amazon Services LLC", "Adaptive Protocols, Inc.") and process.code_signature.trusted == true)  and 
 not (process.executable : "?:\\ManageEngine\\PAM360\\jre\\bin\\java.exe" and
      process.code_signature.trusted == true and
      process.code_signature.subject_name : ("Oracle America, Inc.", "Eclipse.org Foundation, Inc.")) and
 not (process.executable : "*\\EL.AudioVideoConversion.Console.exe" and
      process.code_signature.trusted == true and
      process.code_signature.subject_name : "NEXUS / E&L GmbH") and
 not process.executable :
               ("?:\\Program Files\\Microsoft Visual Studio\\*.exe",
                "?:\\Program Files (x86)\\Microsoft Visual Studio\\*.exe",
                "?:\\Program Files (x86)\\PMP\\jre\\bin\\java.exe",
                "?:\\Program Files\\ManageEngine\\PMP\\jre\\bin\\java.exe",
                "?:\\Program Files\\ManageEngine\\PAM360\\jre\\bin\\java.exe",
                "?:\\Program Files (x86)\\Adaptiva\\AdaptivaClient\\bin\\AdaptivaClientService.exe",
                "?:\\Program Files\\Adaptiva\\AdaptivaClient\\bin\\AdaptivaClientService.exe",
                "C:\\Program Files\\Siemens\\teamplay\\bin\\*\\syngo.Cloud.Receiver.Plugin.DicomTagResolver.exe",
                "?:\\Program Files\\Sql Server Extension\\SqlServerExtension.Service.exe",
                "C:\\Program Files\\Siemens\\CloudLink\\*.exe",
                "C:\\Program Files (x86)\\Razer\\Razer Cortex\\RazerCortex.exe",
                "C:\\Program Files\\Guard\\Data Vault Publisher for Citect\\*.exe",
                "C:\\Program Files\\Koios\\Koios DS\\KoiosDS-MVC-App.exe",
                "?:\\Program Files\\Commvault\\ContentStore\\DotNetCore\\dotnet.exe",
                "?:\\Program Files\\Siemens\\ABT Site\\Bin\\Siemens.BASys.ABTSite.exe") and
 not _arraysearch(process.thread.Ext.call_stack, $entry,
                    $entry.callsite_trailing_bytes : ("c5f8774883ec10c5fb1104244883ec104889042449ba00000000000000004*",
                                                      "*488b8d48ffffff48894b104c8b658049894424084c896588c745c0*"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • clr.dll corpus 5 (elastic 5)
field:"dll.name" kind:wildcard value:"clr.dll"
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked corpus 2 (elastic 2)
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked corpus 2 (elastic 2)
field:"process.thread.Ext.call_stack_summary" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqAmazon.com Services LLC, Amazon Services LLC, Adaptive Protocols, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Amazon.com Services LLC" field:"process.code_signature.subject_name" value:"Amazon Services LLC" field:"process.code_signature.subject_name" value:"Adaptive Protocols, Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files*\Amazon Corretto\jdk*\bin\java.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files*\Amazon Corretto\jdk*\bin\java.exe"
process.code_signature.subject_nameeqAzul Systems, Inc., JetBrains s.r.o., HAYLEM Technologies Inc., MicroStrategy, Inc., Oracle America, Inc.excludes:process.code_signature.subject_name
process.code_signature.subject_nameeqDell Incexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Dell Inc"
process.executableeq?:\Program Files\Dell\DTP\DiagnosticsSubAgent\Dell.TechHub.Diagnostics.SubAgent.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Dell\DTP\DiagnosticsSubAgent\Dell.TechHub.Diagnostics.SubAgent.exe"
process.code_signature.subject_nameeqNEXUS / E&L GmbHexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"NEXUS / E&L GmbH"
process.executableends_with\EL.AudioVideoConversion.Console.exeexcludes:process.executable field:"process.executable" value:"\EL.AudioVideoConversion.Console.exe"
process.code_signature.subject_nameeqOracle America, Inc., Eclipse.org Foundation, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Oracle America, Inc." field:"process.code_signature.subject_name" value:"Eclipse.org Foundation, Inc."
process.executableeq?:\ManageEngine\PAM360\jre\bin\java.exeexcludes:process.executable field:"process.executable" value:"?:\ManageEngine\PAM360\jre\bin\java.exe"
process.code_signature.subject_nameeqOracle America, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Oracle America, Inc."
process.executableeqC:\ManageEngine\ADManager Plus\jre\bin\java.exeexcludes:process.executable field:"process.executable" value:"C:\ManageEngine\ADManager Plus\jre\bin\java.exe"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.executablewildcard?:\Program Files\Microsoft Visual Studio\*.exe, ?:\Program Files (x86)\Microsoft Visual Studio\*.exe, ?:\Program Files (x86)\PMP\jre\bin\java.exe, ?:\Program Files\ManageEngine\PMP\jre\bin\java.exe, ?:\Program Files\ManageEngine\PAM360\jre\bin\java.exe, ?:\Program Files (x86)\Adaptiva\AdaptivaClient\bin\AdaptivaClientService.exe, ?:\Program Files\Adaptiva\AdaptivaClient\bin\AdaptivaClientService.exe, C:\Program Files\Siemens\teamplay\bin\*\syngo.Cloud.Receiver.Plugin.DicomTagResolver.exe, ?:\Program Files\Sql Server Extension\SqlServerExtension.Service.exe, C:\Program Files\Siemens\CloudLink\*.exe, C:\Program Files (x86)\Razer\Razer Cortex\RazerCortex.exe, C:\Program Files\Guard\Data Vault Publisher for Citect\*.exe, C:\Program Files\Koios\Koios DS\KoiosDS-MVC-App.exe, ?:\Program Files\Commvault\ContentStore\DotNetCore\dotnet.exe, ?:\Program Files\Siemens\ABT Site\Bin\Siemens.BASys.ABTSite.exeexcludes:process.executable

Modification of Dynamic Linker Preload Shared Object

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

Identifies modification of the dynamic linker preload shared object (ld.so.preload). Adversaries may execute malicious payloads by hijacking the dynamic linker used to load libraries.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2021/01/27"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies modification of the dynamic linker preload shared object (ld.so.preload). Adversaries may execute malicious
payloads by hijacking the dynamic linker used to load libraries.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"]
language = "kuery"
license = "Elastic License v2"
name = "Modification of Dynamic Linker Preload Shared Object"
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 Modification of Dynamic Linker Preload Shared Object

The dynamic linker preload mechanism in Linux, via `/etc/ld.so.preload`, allows preloading of shared libraries, influencing how executables load dependencies. Adversaries exploit this by inserting malicious libraries, hijacking execution flow for privilege escalation. The detection rule monitors changes to this file, excluding benign processes, to identify unauthorized modifications indicative of such abuse.

### Possible investigation steps

- Review the alert details to confirm the file path involved is /etc/ld.so.preload and verify the event action is one of the specified actions: updated, renamed, or file_rename_event.
- Identify the process responsible for the modification by examining the process.name field, ensuring it is not one of the excluded processes (wine or oneagentinstallaction).
- Investigate the process that triggered the alert by gathering additional context such as process ID, command line arguments, and parent process to understand its origin and purpose.
- Check the modification timestamp and correlate it with other system events or logs to identify any suspicious activity or patterns around the time of the modification.
- Analyze the contents of /etc/ld.so.preload to determine if any unauthorized or suspicious libraries have been added, and assess their potential impact on the system.
- Review user accounts and permissions associated with the process to determine if there has been any unauthorized access or privilege escalation attempt.
- If malicious activity is confirmed, isolate the affected system and follow incident response procedures to mitigate the threat and prevent further exploitation.

### False positive analysis

- Legitimate software installations or updates may modify /etc/ld.so.preload. To handle this, monitor the process names associated with these activities and consider adding them to the exclusion list if they are verified as benign.
- System management tools like configuration management software might update /etc/ld.so.preload as part of routine operations. Identify these tools and exclude their process names from the detection rule to prevent false alerts.
- Custom scripts or administrative tasks executed by trusted users could inadvertently trigger the rule. Review these scripts and, if necessary, exclude their process names or user accounts from the detection criteria.
- Security agents or monitoring tools that interact with system files might cause false positives. Verify these tools' activities and exclude their process names if they are known to be safe and necessary for system operations.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement by the adversary.
- Terminate any suspicious processes that are not part of the baseline or known benign applications, especially those related to the modification of `/etc/ld.so.preload`.
- Restore the `/etc/ld.so.preload` file from a known good backup to ensure no malicious libraries are preloaded.
- Conduct a thorough review of recent system changes and installed packages to identify any unauthorized software or modifications that may have facilitated the attack.
- Escalate the incident to the security operations team for a deeper forensic analysis to determine the scope of the compromise and identify any additional affected systems.
- Implement additional monitoring on the affected system and similar environments to detect any further attempts to modify the dynamic linker preload file.
- Review and enhance access controls and permissions on critical system files like `/etc/ld.so.preload` to prevent unauthorized modifications in the future."""
references = [
    "https://www.anomali.com/blog/rocke-evolves-its-arsenal-with-a-new-malware-family-written-in-golang",
]
risk_score = 47
rule_id = "717f82c2-7741-4f9b-85b8-d06aeb853f4f"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat

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

### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.

#### The following steps should be executed in order to add the Auditbeat 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/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:linux and event.category:file and event.action:(file_rename_event or rename or renamed or updated) and
not event.type:deletion and file.path:/etc/ld.so.preload and
process.name:(* and not (oneagentinstallaction or passwd or wine))
'''

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

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

[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"

[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 = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"

[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"

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

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

Stages and Predicates

Stage 1: new_terms

host.os.type:linux and event.category:file and event.action:(file_rename_event or rename or renamed or updated) and
not event.type:deletion and file.path:/etc/ld.so.preload and
process.name:(* and not (oneagentinstallaction or passwd or wine))

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Newly Observed Elastic Defend Behavior Alert

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

This rule detects Elastic Defend behavior alerts that are observed for the first time today when compared against the previous 5 days of alert history. It highlights low-volume, newly observed alerts tied to a specific detection rule, analysts can use this to prioritize triage and response.

Rule Body

[metadata]
creation_date = "2026/01/05"
maturity = "production"
updated_date = "2026/01/16"

[rule]
author = ["Elastic"]
description = """
This rule detects Elastic Defend behavior alerts that are observed for the first time today when compared against the previous
5 days of alert history. It highlights low-volume, newly observed alerts tied to a specific detection rule, analysts can use
this to prioritize triage and response.
"""
from = "now-7205m"
interval = "5m"
language = "esql"
license = "Elastic License v2"
name = "Newly Observed Elastic Defend Behavior Alert"
risk_score = 73
rule_id = "7306ce7d-5c90-4f42-aa6c-12b0dc2fe3b8"
severity = "high"
tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide", "Data Source: Elastic Defend"]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-endpoint.alerts-*
| WHERE event.code == "behavior" and rule.name is not null
| STATS Esql.alerts_count = count(*),
        Esql.first_time_seen = MIN(@timestamp),
        Esql.last_time_seen = MAX(@timestamp),
        Esql.agents_distinct_count = COUNT_DISTINCT(agent.id),
        Esql.process_executable = VALUES(process.executable),
        Esql.process_parent_executable = VALUES(process.parent.executable),
        Esql.process_command_line = VALUES(process.command_line),
        Esql.process_hash_sha256 = VALUES(process.hash.sha256),
        Esql.host_id_values = VALUES(host.id),
        Esql.user_name = VALUES(user.name) by rule.name
// first time seen in the last 5 days - defined in the rule schedule Additional look-back time
| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
// first time seen is within 10m of the rule execution time
| where Esql.recent <= 10 and Esql.agents_distinct_count == 1 and Esql.alerts_count <= 10 and (Esql.last_time_seen == Esql.first_time_seen)

// Move single values to their corresponding ECS fields for alerts exclusion
| eval host.id = mv_min(Esql.host_id_values)

| keep host.id, rule.name, Esql.*
'''
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 Newly Observed Elastic Defend Behavior Alert

Elastic Defend behavior alerts indicate suspicious activity observed on an endpoint that may not yet be widespread or repeated.
This rule surfaces newly observed, low-frequency behavior alerts affecting a single agent within the current day, which can
represent early-stage malware execution, initial persistence attempts, or hands-on-keyboard activity.

Because the alert has not been seen previously for this rule and host, it should be prioritized for validation to determine
whether it represents a true compromise or rare benign activity.

### Investigation Steps

- Identify the affected host and review the associated Elastic Defend rule name to understand the behavior that triggered the alert.
- Review the process details, including executable path, parent process, command line, and SHA-256 hash.
- Determine whether the process is expected on the host by validating its origin, signer, and execution context.
- Examine the alert timeline to confirm that all activity occurred within a short time window and assess whether behavior escalated.
- Correlate with additional endpoint telemetry such as:
  - Process creation and termination
  - File modifications
  - Network connections
  - Registry or persistence-related activity
- Check whether the process hash, command line, or related indicators are known malicious or associated with recent campaigns.
- Validate the user context under which the activity occurred and assess whether it aligns with normal behavior for that account.

### False Positive Considerations

- Newly deployed or updated software may introduce behavior not previously observed on the host.
- Administrative scripts or automation tools can trigger behavior-based detections when first introduced.
- Security tooling, IT management agents, or EDR integrations may generate new behavior alerts during updates or configuration changes.
- Development or testing environments may produce one-off behaviors that resemble malicious techniques.

### Response and Remediation

- If the activity is confirmed malicious, isolate the affected host to prevent further execution or lateral movement.
- Terminate malicious processes and remove any dropped files or persistence mechanisms.
- Collect forensic artifacts to understand initial access and execution flow.
- Patch or remediate any vulnerabilities or misconfigurations that enabled the behavior.
- If benign, document the finding and consider tuning or exception handling to reduce future noise.
- Continue monitoring the host and environment for recurrence of the behavior or related alerts."""
references = ["https://github.com/elastic/protections-artifacts/tree/main/behavior"]

Stages and Predicates

Stage 1: from

from logs-endpoint.alerts-*

Stage 2: where

| WHERE event.code == "behavior" and rule.name is not null

Stage 3: stats

| STATS Esql.alerts_count = count(*),
        Esql.first_time_seen = MIN(@timestamp),
        Esql.last_time_seen = MAX(@timestamp),
        Esql.agents_distinct_count = COUNT_DISTINCT(agent.id),
        Esql.process_executable = VALUES(process.executable),
        Esql.process_parent_executable = VALUES(process.parent.executable),
        Esql.process_command_line = VALUES(process.command_line),
        Esql.process_hash_sha256 = VALUES(process.hash.sha256),
        Esql.host_id_values = VALUES(host.id),
        Esql.user_name = VALUES(user.name) by rule.name

Stage 4: eval

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

Stage 5: where

| where Esql.recent <= 10 and Esql.agents_distinct_count == 1 and Esql.alerts_count <= 10 and (Esql.last_time_seen == Esql.first_time_seen)

Stage 6: eval

| eval host.id = mv_min(Esql.host_id_values)

Stage 7: keep

| keep host.id, rule.name, Esql.*

Indicators

These rows show field, operator, and value matches.

Output Fields

These fields are emitted when the rule matches.

FieldSource
host.idKEEP host.id
rule.nameKEEP rule.name
Esql.*KEEP Esql.*

Nodejs Initial Access via VSCode Auto-run Task

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

Detects when VSCode spawns Node.js in order to execute a JavaScript file, via an auto-run task, that results in an immediate outbound network connection. This technique has been observed in DPRK-attributed malware campaigns targeting developers.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when VSCode spawns Node.js in order to execute a JavaScript file, via an auto-run task, that results in an
immediate outbound network connection. This technique has been observed in DPRK-attributed malware campaigns targeting
developers.
"""
id = "cfe9e0b1-bee9-4cdf-9b25-d8f2d72f0056"
license = "Elastic License v2"
name = "Nodejs Initial Access via VSCode Auto-run Task"
os_list = ["macos"]
reference = ["https://kl4r10n.tech/blog/dprk-new-malware"]
version = "1.0.1"

query = '''
sequence with maxspan=20s
[process where event.type == "start" and event.action == "exec" and process.name == "node" and
  process.args_count == 2 and process.parent.name == "Code Helper" and
  process.parent.code_signature.team_id == "UBF8T346G9"] by process.entity_id
[network where event.type == "start" and process.name == "node"] by process.parent.entity_id
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1195"
name = "Supply Chain Compromise"
reference = "https://attack.mitre.org/techniques/T1195/"
[[threat.technique.subtechnique]]
id = "T1195.001"
name = "Compromise Software Dependencies and Development Tools"
reference = "https://attack.mitre.org/techniques/T1195/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.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name == "node" and
  process.args_count == 2 and process.parent.name == "Code Helper" and
  process.parent.code_signature.team_id == "UBF8T346G9"] by process.entity_id

Stage 2: network

[network where event.type == "start" and process.name == "node"] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Outlook Home Page Registry Modification

#
Source
github.com/elastic/protections-artifacts

Identifies modifications in registry keys associated with abuse of the Outlook Home Page functionality for command and control or persistence.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies modifications in registry keys associated with abuse of the Outlook Home Page functionality for command and
control or persistence.
"""
id = "f65102b4-15b1-4e9f-af76-3b8f67201185"
license = "Elastic License v2"
name = "Outlook Home Page Registry Modification"
os_list = ["windows"]
reference = [
    "https://cloud.google.com/blog/topics/threat-intelligence/breaking-the-rules-tough-outlook-for-home-page-attacks/",
    "https://github.com/trustedsec/specula",
]
version = "1.0.3"

query = '''
registry where event.action != "deletion" and
    registry.path : "HKEY_USERS\\S-1-5-*\\SOFTWARE\\Microsoft\\Office\\*\\Outlook\\Webview\\Inbox\\URL"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1137"
name = "Office Application Startup"
reference = "https://attack.mitre.org/techniques/T1137/"
[[threat.technique.subtechnique]]
id = "T1137.004"
name = "Outlook Home Page"
reference = "https://attack.mitre.org/techniques/T1137/004/"



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

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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: registry

registry where event.action != "deletion" and
    registry.path : "HKEY_USERS\\S-1-5-*\\SOFTWARE\\Microsoft\\Office\\*\\Outlook\\Webview\\Inbox\\URL"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionne
  • deletion corpus 90 (elastic 90)
field:"EventType" kind:ne value:"deletion"
registry.pathwildcard
  • HKEY_USERS\S-1-5-*\SOFTWARE\Microsoft\Office\*\Outlook\Webview\Inbox\URL
field:"TargetObject" kind:wildcard value:"HKEY_USERS\S-1-5-*\SOFTWARE\Microsoft\Office\*\Outlook\Webview\Inbox\URL"

Polkit Policy Creation

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

This rule monitors for the creation of Polkit policy files on Linux systems. Polkit policy files are used to define the permissions for system-wide services and applications. The creation of new Polkit policy files may indicate an attempt to modify the authentication process, which could be used for persistence by an adversary.

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 monitors for the creation of Polkit policy files on Linux systems. Polkit policy files are used to define the
permissions for system-wide services and applications. The creation of new Polkit policy files may indicate an attempt
to modify the authentication process, which could be used for persistence by an adversary.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Polkit Policy 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 Polkit Policy Creation

Polkit, or PolicyKit, is a system service in Linux environments that manages system-wide privileges, allowing non-privileged processes to communicate with privileged ones. Adversaries may exploit Polkit by creating or modifying policy files to gain unauthorized access or maintain persistence. The detection rule monitors the creation of these files in critical directories, excluding known legitimate processes, to identify potential malicious activity.

### Possible investigation steps

- Review the file path and extension to confirm if the created file is located in one of the critical directories specified in the query, such as /etc/polkit-1/rules.d/ or /usr/share/polkit-1/actions/.
- Identify the process executable responsible for the file creation and verify if it is listed in the exclusion list of known legitimate processes. If not, this may warrant further investigation.
- Check the timestamp of the file creation event to determine if it coincides with any known maintenance or update activities, which could explain the file creation.
- Investigate the user account associated with the process that created the file to determine if it has the necessary privileges and if the activity aligns with the user's typical behavior.
- Examine any recent changes or updates to the system that might have triggered the creation of the Polkit policy file, such as software installations or configuration changes.
- Look for any related alerts or logs that might indicate a broader pattern of suspicious activity, such as unauthorized access attempts or other policy modifications.

### False positive analysis

- System package managers like dpkg, rpm, and yum may create or modify Polkit policy files during legitimate software installations or updates. To handle these, ensure that the rule excludes processes associated with these package managers as specified in the rule's exception list.
- Container management tools such as Docker and Podman might also trigger false positives when managing containerized applications. Users should verify that these executables are included in the exclusion list to prevent unnecessary alerts.
- Automation tools like Puppet and Chef can modify policy files as part of their configuration management tasks. Confirm that these processes are part of the exclusion criteria to avoid false positives.
- Snap package installations and updates can lead to the creation of policy files. Ensure that paths related to Snap are covered in the exclusion patterns to minimize false alerts.
- Virtualization software such as VirtualBox may interact with Polkit policy files. Users should check that relevant paths and executables are included in the exceptions to reduce false positives.

### Response and remediation

- Isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes identified as creating or modifying Polkit policy files, especially those not listed in the known legitimate processes.
- Review and restore the integrity of the Polkit policy files by comparing them against a known good baseline or backup to ensure no unauthorized changes persist.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious files or processes.
- Implement additional monitoring on the affected system and similar systems to detect any further attempts to create or modify Polkit policy files.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat is part of a larger attack campaign.
- Review and update access controls and permissions related to Polkit policy files to ensure only authorized processes and users can create or modify these files, reducing the risk of future exploitation."""
risk_score = 21
rule_id = "0f54e947-9ab3-4dff-9e8d-fb42493eaa2f"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Tactic: Persistence",
    "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 process.executable != null and
file.extension in ("rules", "pkla", "policy") and file.path like~ (

  // Rule files
  "/etc/polkit-1/rules.d/*", "/usr/share/polkit-1/rules.d/*",

  // pkla files
  "/etc/polkit-1/localauthority/*", "/var/lib/polkit-1/localauthority/*",

  // Action files
  "/usr/share/polkit-1/actions/*",

  // Misc. legacy paths
  "/lib/polkit-1/rules.d/*", "/lib64/polkit-1/rules.d/*", "/var/lib/polkit-1/rules.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",
    "/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/podman",
    "/kaniko/executor", "/opt/kaniko/executor", "/usr/bin/buildah", "/usr/lib/cargo/bin/coreutils/install"
  ) or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/tmp/vmis.*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*",
    "/var/lib/containers/storage/overlay/*/dockerd", "/var/lib/docker/overlay2/*/dockerd"
  ) or
  (process.name like "python*" and file.name like ".ansible_tmp*.rules")
)
'''

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

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

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

[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"

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

[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 process.executable != null and
file.extension in ("rules", "pkla", "policy") and file.path like~ (
  "/etc/polkit-1/rules.d/*", "/usr/share/polkit-1/rules.d/*",
  "/etc/polkit-1/localauthority/*", "/var/lib/polkit-1/localauthority/*",
  "/usr/share/polkit-1/actions/*",
  "/lib/polkit-1/rules.d/*", "/lib64/polkit-1/rules.d/*", "/var/lib/polkit-1/rules.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",
    "/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/podman",
    "/kaniko/executor", "/opt/kaniko/executor", "/usr/bin/buildah", "/usr/lib/cargo/bin/coreutils/install"
  ) or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/tmp/vmis.*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*",
    "/var/lib/containers/storage/overlay/*/dockerd", "/var/lib/docker/overlay2/*/dockerd"
  ) or
  (process.name like "python*" and file.name like ".ansible_tmp*.rules")
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • creation
field:"event.type" kind:eq value:"creation"
file.extensionin
  • pkla
  • policy
  • rules
field:"file.extension" kind:in
file.pathwildcard
  • /etc/polkit-1/localauthority/*
  • /etc/polkit-1/rules.d/*
  • /lib/polkit-1/rules.d/*
  • /lib64/polkit-1/rules.d/*
  • /usr/share/polkit-1/actions/*
  • /usr/share/polkit-1/rules.d/*
  • /var/lib/polkit-1/localauthority/*
  • /var/lib/polkit-1/rules.d/*
field:"TargetFilename" kind:wildcard
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.namewildcard.ansible_tmp*.rulesexcludes:file.name field:"file.name" value:".ansible_tmp*.rules"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.executablein./usr/bin/podman, /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/executor, /kaniko/kaniko-executor, /opt/gitlab/embedded/bin/ruby, /opt/kaniko/executor, /opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /proc/self/exe, /sbin/apk, /usr/bin/apt, /usr/bin/autossl_check, /usr/bin/buildah, /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/cargo/bin/coreutils/install, /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.executablewildcard/nix/store/*, /var/lib/dpkg/*, /tmp/vmis.*, /snap/*, /dev/fd/*, /usr/lib/virtualbox/*, /var/lib/containers/storage/overlay/*/dockerd, /var/lib/docker/overlay2/*/dockerdexcludes:process.executable

Potential Kubectl Masquerading via Unexpected Process

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

This rule detects potential kubectl masquerading activity by monitoring for process events where the process name is not "kubectl" but the command line arguments include kubectl-related commands. This could indicate an adversary attempting to masquerade as legitimate kubectl activity to evade detection. This rule covers evasion gaps introduced by renaming the kubectl binary, or placing it in an unusual directory.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/06/19"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/03/30"

[rule]
author = ["Elastic"]
description = """
This rule detects potential kubectl masquerading activity by monitoring for process events where the process name
is not "kubectl" but the command line arguments include kubectl-related commands. This could indicate an adversary
attempting to masquerade as legitimate kubectl activity to evade detection. This rule covers evasion gaps
introduced by renaming the kubectl binary, or placing it in an unusual directory.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-cloud_defend.process*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Kubectl Masquerading via Unexpected Process"
note = """ ## Triage and analysis

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

### Investigating Potential Kubectl Masquerading via Unexpected Process

Kubectl is a command-line tool for interacting with Kubernetes clusters, crucial for managing containerized applications. Adversaries may exploit this by renaming the kubectl binary or placing it in unusual directories to mimic legitimate activity and evade detection. The detection rule identifies such masquerading by monitoring for non-standard process names executing kubectl-related commands, thus highlighting potential evasion attempts.

### Possible investigation steps

- Review the process executable path to determine if it is located in a non-standard directory such as /tmp, /var/tmp, /dev/shm, or other specified paths in the query.
- Examine the process name to check if it deviates from the expected "kubectl" name, which could indicate an attempt to masquerade the process.
- Analyze the command line arguments used in the process to identify any kubectl-related commands, such as "get", "describe", "exec", "port-forward", or authentication commands, which may suggest unauthorized access or activity.
- Investigate the user account associated with the process to determine if it has legitimate access to execute kubectl commands or if it might be compromised.
- Check for any recent changes or anomalies in the Kubernetes cluster that could correlate with the suspicious process activity, such as unauthorized deployments or configuration changes.
- Review system logs and other security alerts around the time of the event to identify any additional indicators of compromise or related suspicious activities.
- If possible, capture and analyze network traffic associated with the process to detect any unusual or unauthorized communication with the Kubernetes API server or other cluster components.

### False positive analysis

- Processes running in development or testing environments may trigger alerts if kubectl is executed from non-standard directories. To manage this, create exceptions for known development paths where kubectl is legitimately used.
- Automated scripts or CI/CD pipelines that use kubectl from custom directories might be flagged. Identify these scripts and exclude their specific paths or process names from the rule.
- Some legitimate applications might wrap kubectl commands for functionality, leading to unexpected process names. Review these applications and add their process names to the exclusion list if they are verified as non-threatening.
- Users with custom kubectl installations in home directories could cause false positives. Verify these installations and exclude the specific user paths if they are deemed safe.
- Temporary or experimental setups where kubectl is renamed for testing purposes might be mistakenly flagged. Document these setups and apply temporary exclusions during the testing phase.

### Response and remediation

- Immediately isolate the affected host to prevent further unauthorized access or lateral movement within the network.
- Terminate any suspicious processes identified by the detection rule that are masquerading as kubectl to halt potential malicious activity.
- Conduct a thorough review of the affected system's logs and command history to identify any unauthorized kubectl commands executed and assess the scope of the compromise.
- Revoke any potentially compromised credentials or access tokens associated with the Kubernetes cluster to prevent further unauthorized access.
- Restore any altered or deleted Kubernetes resources from backups, ensuring the integrity and availability of the cluster's services.
- Implement stricter access controls and monitoring on the Kubernetes cluster, such as enforcing the principle of least privilege and enabling audit logging for kubectl commands.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems or data have been affected.
"""
references = ["https://kubernetes.io/docs/reference/kubectl/"]
risk_score = 47
rule_id = "2388c687-cb2c-4b7b-be8f-6864a2385048"
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 or macOS system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "Domain: Container",
    "Domain: Kubernetes",
    "OS: Linux",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: Elastic Endgame",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Data Source: Elastic Defend for Containers",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type in ("linux", "macos") and event.type == "start" and
event.action in ("exec", "exec_event", "start", "executed", "process_started") and
(
  process.executable like~ (
    "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*", "/dev/shm/*", "/root/*", "/var/www/*", "/home/*", "/Users/*", "./kubectl"
  ) or
  process.name like ".*"
) and
process.args like~ (

  // get and describe commands
  "*get po*", "*get deploy*", "*get node*", "*get svc*", "*get service*", "*get secret*", "*get clusterrole*", "*get ingress*",
  "*get configmap*", "*describe po*", "*describe deploy*", "*describe node*", "*describe svc*", "*describe service*",
  "*describe secret*", "*describe configmap*", "*describe clusterrole*", "*describe ingress*",
  
  // exec commands
  "*exec -it*", "*exec --stdin*", "*exec --tty*",
  
  // networking commands
  "*port-forward* ", "*proxy --port*", "*run --image=*", "*expose*",

  // authentication/impersonation commands
  "*auth can-i*", "*--kubeconfig*", "*--as *", "*--as=*", "*--as-group*", "*--as-uid*"
) and not (
  process.executable like "/tmp/newroot/*" or
  process.name == ".flatpak-wrapped"
)
'''

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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.003"
name = "Rename Legitimate Utilities"
reference = "https://attack.mitre.org/techniques/T1036/003/"

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

[[rule.threat.technique.subtechnique]]
id = "T1564.001"
name = "Hidden Files and Directories"
reference = "https://attack.mitre.org/techniques/T1564/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 = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type in ("linux", "macos") and event.type == "start" and
event.action in ("exec", "exec_event", "start", "executed", "process_started") and
(
  process.executable like~ (
    "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*", "/dev/shm/*", "/root/*", "/var/www/*", "/home/*", "/Users/*", "./kubectl"
  ) or
  process.name like ".*"
) and
process.args like~ (
  "*get po*", "*get deploy*", "*get node*", "*get svc*", "*get service*", "*get secret*", "*get clusterrole*", "*get ingress*",
  "*get configmap*", "*describe po*", "*describe deploy*", "*describe node*", "*describe svc*", "*describe service*",
  "*describe secret*", "*describe configmap*", "*describe clusterrole*", "*describe ingress*",
  "*exec -it*", "*exec --stdin*", "*exec --tty*",
  "*port-forward* ", "*proxy --port*", "*run --image=*", "*expose*",
  "*auth can-i*", "*--kubeconfig*", "*--as *", "*--as=*", "*--as-group*", "*--as-uid*"
) and not (
  process.executable like "/tmp/newroot/*" or
  process.name == ".flatpak-wrapped"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec corpus 180 (elastic 180)
  • exec_event corpus 135 (elastic 135)
  • executed corpus 85 (elastic 85)
  • process_started corpus 77 (elastic 77)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • *--as *
  • *--as-group*
  • *--as-uid*
  • *--as=*
  • *--kubeconfig*
  • *auth can-i*
  • *describe clusterrole*
  • *describe configmap*
  • *describe deploy*
  • *describe ingress*
  • *describe node*
  • *describe po*
  • *describe secret*
  • *describe service*
  • *describe svc*
  • *exec --stdin*
  • *exec --tty*
  • *exec -it*
  • *expose*
  • *get clusterrole*
  • *get configmap*
  • *get deploy*
  • *get ingress*
  • *get node*
  • *get po*
  • *get secret*
  • *get service*
  • *get svc*
  • *port-forward*
  • *proxy --port*
  • *run --image=*
field:"process.args" kind:wildcard
process.executablewildcard
  • ./kubectl
  • /Users/*
  • /dev/shm/* corpus 14 (elastic 14)
  • /home/* corpus 2 (elastic 2)
  • /private/tmp/* corpus 4 (elastic 4)
  • /private/var/tmp/*
  • /root/* corpus 3 (elastic 3)
  • /tmp/* corpus 17 (elastic 17)
  • /var/tmp/* corpus 16 (elastic 16)
  • /var/www/* corpus 5 (elastic 5)
field:"Image" kind:wildcard
process.namewildcard
  • .* corpus 21 (elastic 21)
field:"process_basename" kind:wildcard value:".*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablestarts_with/tmp/newroot/excludes:process.executable field:"process.executable" value:"/tmp/newroot/"
process.nameeq.flatpak-wrappedexcludes:process.name field:"process.name" value:".flatpak-wrapped"

Potential Network Share Discovery

#
Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Time window
15s
Sequence by
source.ip, source.port, user.name
Author
Elastic
Source
github.com/elastic/detection-rules

Adversaries may look for folders and drives shared on remote systems to identify sources of information to gather as a precursor for collection and identify potential systems of interest for Lateral Movement.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/07/14"
integration = ["windows", "system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Adversaries may look for folders and drives shared on remote systems to identify sources of information to gather as a
precursor for collection and identify potential systems of interest for Lateral Movement.
"""
from = "now-119m"
index = ["logs-system.security*", "logs-windows.*", "winlogbeat-*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Potential Network Share Discovery"
risk_score = 21
rule_id = "b2318c71-5959-469a-a3ce-3a0768e63b9c"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Discovery",
    "Tactic: Collection",
    "Rule Type: BBR",
    "Data Source: Windows Security Event Logs",
]
type = "eql"

query = '''
sequence by user.name, source.port, source.ip with maxspan=15s 
 [file where event.action == "network-share-object-access-checked" and 
  winlog.event_data.ShareName in ("\\\\*\\ADMIN$", "\\\\*\\C$") and 
  source.ip != null and source.ip != "0.0.0.0" and source.ip != "::1" and source.ip != "::" and source.ip != "127.0.0.1"]
 [file where event.action == "network-share-object-access-checked" and 
  winlog.event_data.ShareName in ("\\\\*\\ADMIN$", "\\\\*\\C$") and 
  source.ip != null and source.ip != "0.0.0.0" and source.ip != "::1" and source.ip != "::" and source.ip != "127.0.0.1"]
'''


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

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

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

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

[[rule.threat.technique]]
id = "T1039"
name = "Data from Network Shared Drive"
reference = "https://attack.mitre.org/techniques/T1039/"

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

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

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

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

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

Stages and Predicates

Ordered sequence: each step below must occur in order within 15s, correlated by source.ip, source.port, user.name.

Stage 1: file

[file where event.action == "network-share-object-access-checked" and 
  winlog.event_data.ShareName in ("\\\\*\\ADMIN$", "\\\\*\\C$") and 
  source.ip != null and source.ip != "0.0.0.0" and source.ip != "::1" and source.ip != "::" and source.ip != "127.0.0.1"]

Stage 2: file

[file where event.action == "network-share-object-access-checked" and 
  winlog.event_data.ShareName in ("\\\\*\\ADMIN$", "\\\\*\\C$") and 
  source.ip != null and source.ip != "0.0.0.0" and source.ip != "::1" and source.ip != "::" and source.ip != "127.0.0.1"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • network-share-object-access-checked
field:"EventType" kind:eq value:"network-share-object-access-checked"
source.ipis_not_null
  • (no value, null check)
field:"src_ip" kind:is_not_null
source.ipne
  • 0.0.0.0 corpus 3 (elastic 3)
  • 127.0.0.1 corpus 22 (elastic 22)
  • :: corpus 3 (elastic 3)
  • ::1 corpus 20 (elastic 20)
field:"src_ip" kind:ne
winlog.event_data.ShareNamein
  • \\*\ADMIN$
  • \\*\C$
field:"ShareName" kind:in

Potential PowerShell Obfuscated Script via High Entropy

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

Identifies PowerShell script blocks with high entropy and non-uniform character distributions. Attackers may obfuscate PowerShell scripts using encoding, encryption, or compression techniques to evade signature-based detections and hinder manual analysis by security analysts.

Known False Positives

  • Legitimate large or encoded PowerShell scripts (automation frameworks, installers, or admin tooling) can exhibit high entropy or uneven character distributions.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies PowerShell script blocks with high entropy and non-uniform character distributions. Attackers may obfuscate
PowerShell scripts using encoding, encryption, or compression techniques to evade signature-based detections and hinder
manual analysis by security analysts.
"""
false_positives = [
  """
  Legitimate large or encoded PowerShell scripts (automation frameworks, installers, or admin tooling) can exhibit high
  entropy or uneven character distributions.
  """
]
from = "now-9m"
index = ["logs-windows.powershell*"]
language = "kuery"
license = "Elastic License v2"
name = "Potential PowerShell Obfuscated Script via High Entropy"
risk_score = 21
rule_id = "737b5532-cf2e-4d40-9209-d7aec9dd25d5"
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 PowerShell Obfuscated Script via High Entropy

This alert flags a large PowerShell script block with statistical characteristics consistent with obfuscated content (for example, encoded, compressed, or encrypted data embedded in a script). Triage should focus on establishing execution context (who/where), reconstructing the complete script content, identifying whether the high-entropy data is a benign embedded resource or a staged payload, and scoping for related activity.

#### Key alert fields to review

- `user.name`, `user.domain`, `user.id`: Account execution context for correlation, prioritization, and scoping.
- `host.name`, `host.id`: Host execution context for correlation, prioritization, and scoping.
- `file.path`, `file.directory`, `file.name`: File-origin context when the script block is sourced from an on-disk file.
- `powershell.file.script_block_text`: Script block content that matched the detection logic.
- `powershell.file.script_block_id`, `powershell.sequence`, `powershell.total`: Script block metadata to pivot to other fragments or reconstruct full script content when split across multiple events.
- `powershell.file.script_block_entropy_bits`: Shannon entropy of the script block. Higher values may indicate obfuscation.
- `powershell.file.script_block_surprisal_stdev`: Standard deviation of surprisal across the script block. Low values indicate uniform randomness. High values indicate mixed patterns and variability.
- `powershell.file.script_block_unique_symbols`: Count of distinct characters present in the script block.
- `powershell.file.script_block_length`: Script block length (size) context.

#### Possible investigation steps

- Triage the execution context and initial severity:
  - Review `@timestamp` to identify when the script block executed and align pivots to the same timeframe.
  - Review `host.name` and `host.id` to identify the endpoint and validate whether PowerShell use is expected for its role.
  - Review `user.name`, `user.domain`, and `user.id` to determine whether the account is expected to run PowerShell on this host and whether it is privileged, shared, or an automation/service identity.
  - Review `powershell.file.script_block_length`, `powershell.file.script_block_entropy_bits`, and `powershell.file.script_block_surprisal_stdev` to understand whether the alert is driven by a large embedded blob (often staging) or more mixed script content (often a wrapper/loader plus embedded data).

- Determine script provenance (file-backed vs. dynamic/interactive):
  - If `file.path` is present, review `file.directory` and `file.name` to understand where the script originated.
  - Assess whether `file.directory` is consistent with approved administrative tooling locations for this host and user, or whether it appears user-writable, temporary, or otherwise unusual.
  - If `file.path` is absent, treat the script block as potentially interactive or dynamically generated and prioritize reconstructing the full script content and identifying the launch source via process correlation.

- Reconstruct the full script content when fragmented:
  - Pivot on `powershell.file.script_block_id` to collect all fragments associated with the script block.
  - Order fragments using `powershell.sequence` and validate completeness using `powershell.total`.
  - Analyze the reconstructed content as a whole to avoid missing small loader logic that precedes a large encoded/encrypted payload.

- Perform structured content review of `powershell.file.script_block_text`:
  - Identify large contiguous strings, byte arrays, or character arrays that may represent encoded or packed data; use `powershell.file.script_block_unique_symbols` to help distinguish limited-alphabet encodings from broader character sets.
  - Look for transformation and staging patterns (for example, decode/decrypt/decompress routines) and whether transformed content is immediately executed (for example, dynamic invocation, in-memory loading, or secondary script evaluation).
  - Extract any embedded indicators (domains, URLs, IPs, file paths/names, registry paths, scheduled task/service names, or distinctive strings) and retain them for scoping and containment.

- Establish the execution chain and initiating source:
  - Use `process.pid` with `host.id` and `@timestamp` to pivot to process telemetry for the PowerShell host instance that generated the script block.
  - Identify the parent process and initiating mechanism (interactive shell, scheduled execution, remote management, document/script host, or other launcher). Treat unexpected launch sources or unusual timing for the host role as higher risk.
  - Check whether the same `process.pid` generated additional suspicious script blocks around the alert time, and whether `user.id` and `host.id` align with expected administrative behavior.

- Correlate for follow-on activity on the same host and account:
  - Correlate on `host.id` and `@timestamp` to identify adjacent events that indicate impact (outbound connections, file writes, module downloads, persistence changes, or unusual authentication activity).
  - When `file.path` is present, correlate on that path and timeframe for file creation/modification patterns that may indicate initial staging or subsequent cleanup.

- Scope the activity across the environment:
  - Search for other high-entropy script blocks on the same `host.id` and `user.id` before and after the alert to identify repeated execution or iterative staging.
  - Search across hosts for the same `file.name` and `file.path` (when present) and compare `powershell.file.script_block_text` structure to identify reuse.
  - Use distinctive substrings from `powershell.file.script_block_text` as pivots to find related script blocks even when paths or accounts differ.

### False positive analysis

- Benign scripts can trigger this alert when they legitimately embed packed data (for example, compressed resources, serialized configuration blobs, embedded certificates/keys, or packaged modules) that increase entropy and appear non-uniform.
- Indicators supporting a benign determination:
  - `file.path` and `file.name` consistently map to an approved internal tool or vendor-managed automation across multiple hosts.
  - `user.id` represents an expected administrative or automation identity with predictable host targeting and execution timing.
  - Reconstructed `powershell.file.script_block_text` shows a stable, repeatable structure over time, and any decoded content aligns with known operational functionality rather than staging and immediate secondary execution.
- Indicators supporting suspicion:
  - Unusual `file.directory` for the host role or account, or absence of `file.path` combined with evidence of dynamic staging behavior.
  - Reconstructed content includes clear execution of transformed data, in-memory loading patterns, or embedded external destinations not associated with known tooling.
- If determined benign, document the owning tool/team, expected `user.id` usage, and expected `file.path`/`file.name` (when present). Use those stable attributes for future baselining and noise reduction while preserving detection for new paths, new users, or materially different script structures.

### Response and remediation

- If suspicious or malicious activity is confirmed:
  - Contain the affected host to prevent further execution and lateral movement.
  - Preserve relevant evidence from the alert, including full reconstructed script content (via `powershell.file.script_block_id`, `powershell.sequence`, `powershell.total`), and associated context (`@timestamp`, `host.*`, `user.*`, `file.*`, `process.pid`, and entropy metrics).
  - Use extracted indicators from `powershell.file.script_block_text` to hunt across hosts and accounts, and to identify additional affected systems.
  - Investigate and remediate follow-on activity identified during correlation (downloaded payloads, dropped files, persistence mechanisms, or unauthorized network access) and remove malicious artifacts from affected endpoints.
  - If account compromise is suspected for `user.id` / `user.name`, initiate credential reset and review recent authentication activity and access paths associated with that identity.

- If benign activity is confirmed:
  - Record the justification and expected behavior (who runs it, where it runs, and expected `file.path` when present).
  - Monitor for deviations from the established baseline, including new `user.id`, new `host.id`, new `file.path`, or significant changes in `powershell.file.script_block_text` structure or entropy characteristics.
"""
setup = """## Setup

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

query = '''
event.category:process and host.os.type:windows and powershell.file.script_block_length > 1000 and
  powershell.file.script_block_entropy_bits >= 5.5 and powershell.file.script_block_surprisal_stdev > 0.7 and
  not file.directory: (
        "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts" or
        "C:\Program Files\Microsoft Azure AD Connect Health Agent\Products\AdFederationService\AdfsDiagnostics\AdfsToolbox\diagnosticsModule\Private"
  )
'''


[[rule.filters]]
[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\\\ProgramData\\\\Microsoft\\\\Windows Defender Advanced Threat Protection\\\\*"

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

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

[[rule.threat.technique.subtechnique]]
id = "T1027.010"
name = "Command Obfuscation"
reference = "https://attack.mitre.org/techniques/T1027/010/"

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

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

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

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

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

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

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "user.name",
    "user.id",
    "powershell.file.script_block_text",
    "powershell.file.script_block_id",
    "powershell.file.script_block_entropy_bits",
    "powershell.file.script_block_surprisal_stdev",
    "powershell.file.script_block_unique_symbols",
    "powershell.file.script_block_length",
    "file.path",
    "file.directory",
    "file.name",
    "process.pid"
]

Stages and Predicates

Stage 1: query

event.category:process and host.os.type:windows and powershell.file.script_block_length > 1000 and
  powershell.file.script_block_entropy_bits >= 5.5 and powershell.file.script_block_surprisal_stdev > 0.7 and
  not file.directory: (
        "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts" or
        "C:\Program Files\Microsoft Azure AD Connect Health Agent\Products\AdFederationService\AdfsDiagnostics\AdfsToolbox\diagnosticsModule\Private"
  )

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.directoryinC:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts, C:\Program Files\Microsoft Azure AD Connect Health Agent\Products\AdFederationService\AdfsDiagnostics\AdfsToolbox\diagnosticsModule\Privateexcludes:file.directory field:"file.directory" value:"C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts" field:"file.directory" value:"C:\Program Files\Microsoft Azure AD Connect Health Agent\Products\AdFederationService\AdfsDiagnostics\AdfsToolbox\diagnosticsModule\Private"

Potential Shellcode Injection via Node.js

#
Source
github.com/elastic/protections-artifacts

Identifies shellcode injection from a Node.js application. This may indicate an attempt to evade defenses.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = "Identifies shellcode injection from a Node.js application. This may indicate an attempt to evade defenses."
id = "c73a1b0d-bd00-4574-8e98-79c75e918eff"
license = "Elastic License v2"
name = "Potential Shellcode Injection via Node.js"
os_list = ["windows"]
version = "1.0.12"

query = '''
api where process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode", "unbacked_rwx") and
 process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx", "WriteProcessMemory", "VirtualAlloc", "VirtualAllocEx", "MapViewOfFile", "MapViewOfFile2") and
 process.executable != null and process.parent.executable != null and
 process.thread.Ext.call_stack_final_user_module.name like ("ffi_bindings.node",  "node.napi.*.node") and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in ("Reolink Innovation Inc.", "Sky International AG", "Ferox Games B.V.", "Tobii AB", "Unify Software and Solutions GmbH & Co. KG", "8x8, Inc.", "Aruba S.p.A.")) and
  not process.executable : ("C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe", "D:\\BioStar 2(x64)\\ta\\nodejs-win64\\node.exe") and
  not process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files\\*", "C:\\program files (x86)\\*") and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 != "ca19f3872ed38d98218cf696e477386d27ef1924547ba7aed61eacff32411092" and
  not (process.executable : "C:\\Windows\\Sys*\\cmd.exe" and
       process.parent.executable : ("C:\\ProgramData\\afesta\\GoSign-Desktop\\app-2.3.3\\GoSignDesktop.exe", "C:\\Program Files (x86)\\Bit4Id\\UKC\\UKC\\bin\\kchain.exe"))
'''

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

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

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


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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.behaviors in ("shellcode", "allocate_shellcode", "execute_shellcode", "unbacked_rwx") and
 process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx", "WriteProcessMemory", "VirtualAlloc", "VirtualAllocEx", "MapViewOfFile", "MapViewOfFile2") and
 process.executable != null and process.parent.executable != null and
 process.thread.Ext.call_stack_final_user_module.name like ("ffi_bindings.node",  "node.napi.*.node") and
 not (process.code_signature.trusted == true and
      process.code_signature.subject_name in ("Reolink Innovation Inc.", "Sky International AG", "Ferox Games B.V.", "Tobii AB", "Unify Software and Solutions GmbH & Co. KG", "8x8, Inc.", "Aruba S.p.A.")) and
  not process.executable : ("C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe", "D:\\BioStar 2(x64)\\ta\\nodejs-win64\\node.exe") and
  not process.thread.Ext.call_stack_final_user_module.path like ("c:\\program files\\*", "C:\\program files (x86)\\*") and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 != "ca19f3872ed38d98218cf696e477386d27ef1924547ba7aed61eacff32411092" and
  not (process.executable : "C:\\Windows\\Sys*\\cmd.exe" and
       process.parent.executable : ("C:\\ProgramData\\afesta\\GoSign-Desktop\\app-2.3.3\\GoSignDesktop.exe", "C:\\Program Files (x86)\\Bit4Id\\UKC\\UKC\\bin\\kchain.exe"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.behaviorsin
  • allocate_shellcode corpus 15 (elastic 15)
  • execute_shellcode corpus 10 (elastic 10)
  • shellcode corpus 15 (elastic 15)
  • unbacked_rwx corpus 2 (elastic 2)
field:"process.Ext.api.behaviors" kind:in
process.Ext.api.namein
  • MapViewOfFile corpus 24 (elastic 24)
  • MapViewOfFile2 corpus 24 (elastic 24)
  • VirtualAlloc corpus 27 (elastic 27)
  • VirtualAllocEx corpus 22 (elastic 22)
  • VirtualProtect corpus 35 (elastic 35)
  • VirtualProtectEx corpus 29 (elastic 29)
  • WriteProcessMemory corpus 23 (elastic 23)
field:"process.Ext.api.name" kind:in
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null
process.thread.Ext.call_stack_final_user_module.hash.sha256ne
  • ca19f3872ed38d98218cf696e477386d27ef1924547ba7aed61eacff32411092
field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:ne value:"ca19f3872ed38d98218cf696e477386d27ef1924547ba7aed61eacff32411092"
process.thread.Ext.call_stack_final_user_module.namewildcard
  • ffi_bindings.node
  • node.napi.*.node
field:"process.thread.Ext.call_stack_final_user_module.name" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_namein8x8, Inc., Aruba S.p.A., Ferox Games B.V., Reolink Innovation Inc., Sky International AG, Tobii AB, Unify Software and Solutions GmbH & Co. KGexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcardC:\Windows\Sys*\cmd.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\Sys*\cmd.exe"
process.parent.executableeqC:\ProgramData\afesta\GoSign-Desktop\app-2.3.3\GoSignDesktop.exe, C:\Program Files (x86)\Bit4Id\UKC\UKC\bin\kchain.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\ProgramData\afesta\GoSign-Desktop\app-2.3.3\GoSignDesktop.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\Bit4Id\UKC\UKC\bin\kchain.exe"
process.executablewildcardC:\Program Files\*.exe, C:\Program Files (x86)\*.exe, D:\BioStar 2(x64)\ta\nodejs-win64\node.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files\*.exe" field:"process.executable" value:"C:\Program Files (x86)\*.exe" field:"process.executable" value:"D:\BioStar 2(x64)\ta\nodejs-win64\node.exe"
process.thread.Ext.call_stack_final_user_module.pathstarts_withc:\program files\, C:\program files (x86)\excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\" field:"process.thread.Ext.call_stack_final_user_module.path" value:"C:\program files (x86)\"

Potential Successful SSH Brute Force Attack

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

Identifies multiple SSH login failures followed by a successful one from the same source address. Adversaries can attempt to login into multiple users with a common or known password to gain access to accounts.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2022/09/14"
integration = ["system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies multiple SSH login failures followed by a successful one from the same source address. Adversaries can
attempt to login into multiple users with a common or known password to gain access to accounts.
"""
from = "now-9m"
index = ["auditbeat-*", "filebeat-*", "logs-system.auth-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Successful SSH Brute Force Attack"
note = """## Triage and analysis

### Investigating Potential Successful SSH Brute Force Attack

The rule identifies consecutive SSH login failures followed by a successful login from the same source IP address to the same target host indicating a successful attempt of brute force password guessing.

#### Possible investigation steps

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

### False positive analysis

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

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Ensure active session(s) on the host(s) are terminated as the attacker could have gained initial access to the system(s).
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
risk_score = 73
rule_id = "8cb84371-d053-4f4f-bce0-c74990e28f28"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- Auditbeat
- Filebeat

### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.

#### The following steps should be executed in order to add the Auditbeat 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/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).

### 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 = "high"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Resources: Investigation Guide"
]
type = "eql"
query = '''
sequence by host.id, source.ip, user.name with maxspan=15s
  [authentication where host.os.type == "linux" and event.action  in ("ssh_login", "user_login") and
   event.outcome == "failure" and source.ip != null and source.ip != "0.0.0.0" and source.ip != "::" ] with runs=25
  [authentication where host.os.type == "linux" and event.action  in ("ssh_login", "user_login") and
   event.outcome == "success" and source.ip != null and source.ip != "0.0.0.0" and source.ip != "::" ]
'''

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

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

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

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

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

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

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

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

Stages and Predicates

Ordered sequence: each step below must occur in order within 15s, correlated by host.id, source.ip, user.name.

Stage 1: authentication ×25

[authentication where host.os.type == "linux" and event.action  in ("ssh_login", "user_login") and
   event.outcome == "failure" and source.ip != null and source.ip != "0.0.0.0" and source.ip != "::" ] with runs=25

Stage 2: authentication

[authentication where host.os.type == "linux" and event.action  in ("ssh_login", "user_login") and
   event.outcome == "success" and source.ip != null and source.ip != "0.0.0.0" and source.ip != "::" ]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • ssh_login
  • user_login
field:"EventType" kind:in
event.outcomeeq
  • failure
  • success
field:"event.outcome" kind:eq
source.ipis_not_null
  • (no value, null check)
field:"src_ip" kind:is_not_null
source.ipne
  • 0.0.0.0
  • ::
field:"src_ip" kind:ne

Privilege Escalation via Rogue Named Pipe Impersonation

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

Identifies a privilege escalation attempt via rogue named pipe impersonation. An adversary may abuse this technique by masquerading as a known named pipe and manipulating a privileged process to connect to it.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies a privilege escalation attempt via rogue named pipe impersonation. An adversary may abuse this technique by
masquerading as a known named pipe and manipulating a privileged process to connect to it.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Privilege Escalation via Rogue Named Pipe Impersonation"
references = [
    "https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/",
    "https://github.com/zcgonvh/EfsPotato",
    "https://twitter.com/SBousseaden/status/1429530155291193354",
]
risk_score = 73
rule_id = "76ddb638-abf7-42d5-be22-4a70b0bf7241"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and
  event.provider == "Microsoft-Windows-Sysmon" and
  
  /* Named Pipe Creation */
  event.code == "17" and
  
  /* Sysmon truncates the "Pipe" keyword in normal named pipe creation events */
  file.name : "\\*\\Pipe\\*"
'''

note = """## Triage and analysis

### Investigating Privilege Escalation via Rogue Named Pipe Impersonation

#### Possible investigation steps

- What rogue pipe path did the alert preserve?
  - Why: the rule references PrintSpoofer and EfsPotato-style abuse, where a controlled pipe can be hidden inside a path that makes a privileged service connect to what appears to be its normal RPC pipe.
  - Focus: alert-local `file.name`, `file.path`, or `winlog.event_data.PipeName`, with `event.provider` and `event.code`.
  - Implication: escalate when the path embeds `\\pipe\\` after another path segment or mimics a service/RPC pipe tail; benign starts only when exact namespace, creator path, command line, account, and client evidence fit one repeated local IPC workflow on this `host.id`.
- Which process and account created the suspicious pipe?
  - Focus: same-host creator `process.executable`, `process.command_line`, `user.name`, and `user.domain`.
  - Implication: escalate when a service, web worker, script host, or user-writable binary creates the pipe under a low-privileged service identity or account that should not host IPC servers; service-mimic pipe plus suspicious creator is enough while collecting client and impact evidence.
  - Hint: pivot by `process.entity_id`; if absent, pair `process.pid` with `host.id` in a tight window. $investigate_0
- Do surrounding events corroborate the creator or show a privileged client?
  - Focus: same-host Sysmon or Windows records for the same `file.name` or `winlog.event_data.PipeName`, reading `event.code`; pipe-connected events, when ingested, corroborate.
  - Hint: same pipe events on the host. $investigate_1
  - Implication: escalate when surrounding records show the same creator maintaining the pipe or, if pipe-connected events exist, a SYSTEM, administrator, service-host, or service/RPC client touching it. Missing pipe-connect telemetry is unresolved, not benign.
  - Range: alert window plus +/-5 minutes; expand only if the creator lived longer.
- Was the pipe followed by elevated execution or token/session abuse?
  - Focus: same-host process starts after pipe creation: `process.executable`, `process.command_line`, `user.name`, and `winlog.event_data.ElevatedToken` when Windows Security has token context.
  - Hint: process starts on the host around pipe creation. $investigate_2
  - Implication: elevated shell, script, service-control, SYSTEM, administrator, or elevated-token activity confirms impact; absence lowers impact only after the pipe path, creator, and client evidence fit one recognized workflow. Missing process-start or token telemetry is unresolved, not benign.
- Does the same rogue-pipe pattern show wider tooling or repeated attempts?
  - Focus: broaden only after suspicious or unresolved local evidence, using the suspicious `file.name` or `winlog.event_data.PipeName` pattern, creator `process.executable`, `host.id`, and `user.id`.
  - Hint: same pipe name or creator executable across recent events. $investigate_3
  - Implication: expand scope when the same embedded-pipe pattern, service/RPC-like tail, or creator executable appears across unrelated hosts or users; no recurrence limits scope but does not close the alert.
- Escalate when pipe shape plus creator, client, or follow-on evidence supports impersonation; close only when available evidence aligns to one recognized IPC product or authorized test with no contradictory privileged-client or elevated-execution evidence; preserve evidence and escalate when telemetry is missing, mixed, or incomplete.

### False positive analysis

- Recognized local IPC products, security tools, or in-house services can trigger when they use nested pipe namespaces with `\\pipe\\`. Confirm the exact namespace, creator path and command line, account, client process, and host cohort align to the same product, with no elevated follow-on outside that workflow.
- Authorized exploit validation can trigger this rule. Confirm test host, test account, time window, pipe namespace, and launched command match the test plan; privileged-client or elevated-execution evidence beyond the plan is suspicious.
- Build exceptions from the minimum confirmed workflow: exact pipe namespace or stable prefix, creator `process.executable` plus command-line pattern, expected `user.id`, and constrained `host.id` or host group. Avoid broad exceptions on `process.name`, service-like pipe tails, or generic `\\pipe\\`.

### Response and remediation

- If confirmed benign, reverse temporary containment and record the pipe namespace, creator process, account, client process, host scope, and absence of unexpected elevated follow-on activity.
- If suspicious but unconfirmed, preserve the alert record, relevant Timeline events, `file.name` or `winlog.event_data.PipeName`, creator `process.entity_id` or `process.pid`, process command lines, Windows Security records, and any spawned process identifiers before containment.
- Apply reversible containment before destructive action: isolate or restrict the affected host only when pipe, creator, client, or follow-on evidence indicates active abuse, and weigh critical host roles before isolation.
- If confirmed malicious, contain the host and involved account, then terminate or suspend malicious processes only after preserving identifiers and command lines. Reset credentials only when Windows Security or process evidence shows account misuse or exposed privileged sessions.
- Eradicate only the exploit tools, scripts, service changes, or payloads identified during the investigation, then address the entry vector that let the creator process run with impersonation-capable privileges.
- Post-incident, restrict the privileged service or service account that the investigation showed was coerced or exposed to unnecessary impersonation-capable privileges."""

setup = """## Setup

This rule requires Sysmon telemetry to be enabled and ingested.

Setup instructions: https://ela.st/sysmon-event-pipe-setup
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.provider",
    "event.code",
    "host.id",
    "user.id",
    "process.executable",
    "process.command_line",
    "process.pid",
    "process.entity_id",
    "file.name",
    "file.path",
    "winlog.event_data.PipeName",
]

[transform]

[[transform.investigate]]
label = "Events for the pipe creator process"
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 = "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 = "Events for the same pipe on this host"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "file.name", queryType = "phrase", value = "{{file.name}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "winlog.event_data.PipeName", queryType = "phrase", value = "{{winlog.event_data.PipeName}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Process starts on the host near the pipe creation"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Events for the same pipe or creator executable"
description = ""
providers = [
  [
    { excluded = false, field = "file.name", queryType = "phrase", value = "{{file.name}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "winlog.event_data.PipeName", queryType = "phrase", value = "{{winlog.event_data.PipeName}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "process.executable", queryType = "phrase", value = "{{process.executable}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

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

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

[[rule.threat.technique.subtechnique]]
id = "T1134.001"
name = "Token Impersonation/Theft"
reference = "https://attack.mitre.org/techniques/T1134/001/"

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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and
  event.provider == "Microsoft-Windows-Sysmon" and
  event.code == "17" and
  file.name : "\\*\\Pipe\\*"

Indicators

These rows show field, operator, and value matches.

Remote File Creation in World Writeable Directory

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

This rule detects the creation of a file in a world-writeable directory through a service that is commonly used for file transfer. This behavior is often associated with lateral movement and can be an indicator of an attacker attempting to move laterally within a network.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects the creation of a file in a world-writeable directory through a service that is
commonly used for file transfer. This behavior is often associated with lateral movement and can
be an indicator of an attacker attempting to move laterally within a network.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "auditbeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Remote File Creation in World Writeable Directory"
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 Remote File Creation in World Writeable Directory

In Linux environments, world-writeable directories like `/tmp` and `/var/tmp` are used for temporary file storage, accessible by all users. Adversaries exploit these directories to deposit malicious files via remote services such as SSH or FTP, facilitating lateral movement. The detection rule identifies file creation events in these directories by non-root users using common file transfer services, signaling potential unauthorized activity.

### Possible investigation steps

- Review the file creation event details, focusing on the file path to determine if it matches any known malicious patterns or if it is unusual for the environment.
- Identify the user associated with the file creation event by examining the user.id field, and verify if this user should have access to the affected directory.
- Investigate the process responsible for the file creation by analyzing the process.name field to determine if it aligns with expected usage patterns for the user and system.
- Check the source IP address and connection details related to the file transfer service used (e.g., SSH, FTP) to identify any suspicious or unauthorized access attempts.
- Correlate the event with other recent activities on the host to identify any patterns of lateral movement or other suspicious behavior.
- Review historical data for similar file creation events by the same user or process to assess if this is part of a recurring pattern or an isolated incident.

### False positive analysis

- Routine administrative tasks: System administrators often use file transfer services like scp or rsync to move files for legitimate purposes. To reduce false positives, create exceptions for known administrative accounts or specific file paths that are regularly used for maintenance.
- Automated scripts and cron jobs: Automated processes may create temporary files in world-writeable directories. Identify and whitelist these scripts or jobs by their process names or user accounts to prevent unnecessary alerts.
- Software updates and installations: Some software updates or installations may temporarily use world-writeable directories. Monitor and document these activities, and consider excluding specific update processes or package managers from the rule.
- Development and testing environments: Developers may use these directories for testing purposes. Establish a separate monitoring policy for development environments or exclude known developer accounts to minimize false positives.
- Backup operations: Backup tools might use temporary directories for staging files. Identify these tools and their typical behavior, and create exceptions based on their process names or user IDs.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further lateral movement by the adversary.
- Terminate any suspicious processes associated with file transfer services (e.g., scp, ssh, ftp) that are not part of legitimate user activity.
- Remove any unauthorized files created in world-writeable directories such as /tmp, /var/tmp, or /dev/shm to eliminate potential threats.
- Conduct a thorough review of user accounts and permissions, focusing on non-root users who have recently accessed the system, to identify any unauthorized access.
- Reset credentials for compromised or potentially compromised accounts to prevent further unauthorized access.
- Monitor network traffic for unusual patterns or connections to external IP addresses that may indicate ongoing or additional compromise attempts.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems have been affected, ensuring a coordinated response.
"""
risk_score = 47
rule_id = "3e528511-7316-4a6e-83da-61b5f1c07fd4"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat

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

### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.

#### The following steps should be executed in order to add the Auditbeat 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/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:file and host.os.type:linux and event.action:creation and
process.name:(ftp or rsync or scp or sftp or sftp-server or ssh or sshd or vsftpd) and
file.path:((/dev/shm/* or /tmp* or /var/tmp*) and not (/tmp/ansible-tmp-* or /var/tmp/ansible-tmp-*)) and
not user.id:0
'''

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

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

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

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

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

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

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

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.executable", "host.id"]

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

Stages and Predicates

Stage 1: new_terms

event.category:file and host.os.type:linux and event.action:creation and
process.name:(ftp or rsync or scp or sftp or sftp-server or ssh or sshd or vsftpd) and
file.path:((/dev/shm/* or /tmp* or /var/tmp*) and not (/tmp/ansible-tmp-* or /var/tmp/ansible-tmp-*)) and
not user.id:0

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathstarts_with/tmp/ansible-tmp-excludes:file.path field:"file.path" value:"/tmp/ansible-tmp-"
file.pathstarts_with/var/tmp/ansible-tmp-excludes:file.path field:"file.path" value:"/var/tmp/ansible-tmp-"
user.ideq0excludes:user.id field:"user.id" value:"0"

Suspicious Finder Cache File Modification

#
Source
github.com/elastic/protections-artifacts

This rule detects potential malicious activity on macOS endpoints by identifying modifications to Finder-related cache files by suspicious processes. It targets adversarial techniques, such as those used by the XCSSET malware, where an attacker maintains persistence by modifying system configurations—like the Dock plist (com.apple.dock.plist)—to execute malicious code each time the Dock or Launchpad is launched. The rule triggers when a file modification event occurs, involving processes such as osascript, bash, sh, zsh, curl, or nscurl, or when the modifying process lacks a valid code signature or is untrusted.

MITRE ATT&CK Coverage

TacticTechniques
StealthNo specific technique

Telemetry Coverage

Rule Body

[rule]
description = """
This rule detects potential malicious activity on macOS endpoints by identifying modifications to Finder-related cache
files by suspicious processes. It targets adversarial techniques, such as those used by the XCSSET malware, where an
attacker maintains persistence by modifying system configurations—like the Dock plist (com.apple.dock.plist)—to execute
malicious code each time the Dock or Launchpad is launched. The rule triggers when a file modification event occurs,
involving processes such as osascript, bash, sh, zsh, curl, or nscurl, or when the modifying process lacks a valid code
signature or is untrusted.
"""
id = "0398851e-0440-4e3d-b0ff-afe1dca8e805"
license = "Elastic License v2"
name = "Suspicious Finder Cache File Modification"
os_list = ["macos"]
reference = ["https://x.com/MsftSecIntel/status/1891410993265123662"]
version = "1.0.5"

query = '''
file where event.action == "modification" and file.path like "/Users/*/Library/Caches/com.apple.finder/*" and 
 (process.name in ("osascript", "bash", "sh", "zsh", "curl", "nscurl") or 
 (process.code_signature.exists == false or process.code_signature.trusted == false)) and
 not (process.executable like "/System/*" and file.name like ("Cache.db-shm", "Cache.db-wal"))
'''

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

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

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

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

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: file

file where event.action == "modification" and file.path like "/Users/*/Library/Caches/com.apple.finder/*" and 
 (process.name in ("osascript", "bash", "sh", "zsh", "curl", "nscurl") or 
 (process.code_signature.exists == false or process.code_signature.trusted == false)) and
 not (process.executable like "/System/*" and file.name like ("Cache.db-shm", "Cache.db-wal"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
file.pathwildcard
  • /Users/*/Library/Caches/com.apple.finder/*
field:"TargetFilename" kind:wildcard value:"/Users/*/Library/Caches/com.apple.finder/*"
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.namein
  • bash corpus 181 (elastic 181)
  • curl corpus 82 (elastic 82)
  • nscurl corpus 41 (elastic 41)
  • osascript corpus 12 (elastic 12)
  • sh corpus 180 (elastic 180)
  • zsh corpus 180 (elastic 180)
field:"process_basename" kind:in

Exclusions

The rule actively suppresses these predicates.

Suspicious NullSessionPipe Registry Modification

#
Source
github.com/elastic/protections-artifacts

Identifies NullSessionPipe registry modifications that specify pipe names that can be accessed anonymously. This could be indicative of adversary lateral movement preparation by making the added pipe accessible to remote systems.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies NullSessionPipe registry modifications that specify pipe names that can be accessed anonymously. This could
be indicative of adversary lateral movement preparation by making the added pipe accessible to remote systems.
"""
id = "11d374d8-2dad-4d9b-83a2-ee908eac8269"
license = "Elastic License v2"
name = "Suspicious NullSessionPipe Registry Modification"
os_list = ["windows"]
reference = [
    "https://www.welivesecurity.com/2019/05/29/turla-powershell-usage/",
    "https://decoded.avast.io/luigicamastra/operation-dragon-castling-apt-group-targeting-betting-companies/",
    "https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/network-access-restrict-anonymous-access-to-named-pipes-and-shares",
]
version = "1.0.28"

query = '''
registry where
 event.action == "modification" and 
 registry.path : "HKLM\\SYSTEM\\*ControlSet*\\services\\LanmanServer\\Parameters\\NullSessionPipes" and 
 not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and 
 registry.data.strings : "*?*" and process.executable : "?:\\*" and
 not process.executable : ("?:\\Program Files\\*.exe",
                           "?:\\Program Files (x86)\\*.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Windows\\System32\\drivers\\RivetNetworks\\Killer\\*.exe",
                           "?:\\Windows\\System32\\svchost.exe",
                           "?:\\Windows\\System32\\lsass.exe",
                           "?:\\Windows\\System32\\msiexec.exe",
                           "?:\\Windows\\System32\\services.exe",
                           "?:\\Windows\\System32\\PDR23PM_SV64.EXE", 
                           "?:\\Windows\\System32\\PLPOUSVR.exe")
'''

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

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


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



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: registry

registry where
 event.action == "modification" and 
 registry.path : "HKLM\\SYSTEM\\*ControlSet*\\services\\LanmanServer\\Parameters\\NullSessionPipes" and 
 not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and 
 registry.data.strings : "*?*" and process.executable : "?:\\*" and
 not process.executable : ("?:\\Program Files\\*.exe",
                           "?:\\Program Files (x86)\\*.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Windows\\System32\\drivers\\RivetNetworks\\Killer\\*.exe",
                           "?:\\Windows\\System32\\svchost.exe",
                           "?:\\Windows\\System32\\lsass.exe",
                           "?:\\Windows\\System32\\msiexec.exe",
                           "?:\\Windows\\System32\\services.exe",
                           "?:\\Windows\\System32\\PDR23PM_SV64.EXE", 
                           "?:\\Windows\\System32\\PLPOUSVR.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\regedit.exe, ?:\Windows\System32\drivers\RivetNetworks\Killer\*.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\System32\msiexec.exe, ?:\Windows\System32\services.exe, ?:\Windows\System32\PDR23PM_SV64.EXE, ?:\Windows\System32\PLPOUSVR.exeexcludes:process.executable
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"

Suspicious Process Execution via Renamed PsExec Executable

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

Identifies suspicious psexec activity which is executing from the psexec service that has been renamed, possibly to evade detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies suspicious psexec activity which is executing from the psexec service that has been renamed, possibly to
evade detection.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Process Execution via Renamed PsExec Executable"
note = """## Triage and analysis

### Investigating Suspicious Process Execution via Renamed PsExec Executable

PsExec is a remote administration tool that enables the execution of commands with both regular and SYSTEM privileges on Windows systems. It operates by executing a service component `Psexecsvc` on a remote system, which then runs a specified process and returns the results to the local system. Microsoft develops PsExec as part of the Sysinternals Suite. Although commonly used by administrators, PsExec is frequently used by attackers to enable lateral movement and execute commands as SYSTEM to disable defenses and bypass security protections.

This rule identifies instances where the PsExec service component is executed using a custom name. This behavior can indicate an attempt to bypass security controls or detections that look for the default PsExec service component name.

#### Possible investigation steps

- Check if the usage of this tool complies with the organization's administration policy.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Identify the target computer and its role in the IT environment.
- Investigate what commands were run, and assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.

### False positive analysis

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

### Response and remediation

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

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""

risk_score = 47
rule_id = "e2f9fdf5-8076-45ad-9427-41e0e03dc9c2"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.pe.original_file_name : "psexesvc.exe" and not process.name : "PSEXESVC.exe"
'''


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

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

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.003"
name = "Rename Legitimate Utilities"
reference = "https://attack.mitre.org/techniques/T1036/003/"

[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 = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.pe.original_file_name : "psexesvc.exe" and not process.name : "PSEXESVC.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.pe.original_file_namewildcard
  • psexesvc.exe corpus 4 (sigma 3, elastic 1)
field:"OriginalFileName" kind:wildcard value:"psexesvc.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameeqPSEXESVC.exeexcludes:process.name field:"process.name" value:"PSEXESVC.exe"

Thrift RPC Method from an External Client

#
Status
production
Severity
medium
Time window
9m
Group by
client.ip, server.ip
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the first decoded Apache Thrift RPC relationship from a public client address to a server. Thrift commonly connects trusted internal microservices and data platforms, and an externally originated method invocation can indicate an exposed service, unauthorized access, or exploitation of a public-facing Thrift endpoint.

Known False Positives

  • Publicly accessible Thrift APIs, partner integrations, remote offices, and routed environments that preserve public client addresses can generate legitimate alerts. Validate the client, service, method, server role, and expected network path before escalating.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[metadata]
creation_date = "2026/07/30"
integration = ["network_traffic"]
maturity = "production"
updated_date = "2026/07/30"

[rule]
author = ["Elastic"]
description = """
Identifies the first decoded Apache Thrift RPC relationship from a public client address to a server. Thrift commonly
connects trusted internal microservices and data platforms, and an externally originated method invocation can indicate
an exposed service, unauthorized access, or exploitation of a public-facing Thrift endpoint.
"""
false_positives = [
    """
    Publicly accessible Thrift APIs, partner integrations, remote offices, and routed environments that preserve public
    client addresses can generate legitimate alerts. Validate the client, service, method, server role, and expected
    network path before escalating.
    """,
]
from = "now-9m"
index = ["logs-network_traffic.thrift-*"]
language = "kuery"
license = "Elastic License v2"
name = "Thrift RPC Method from an External Client"
note = """## Triage and analysis

### Investigating Thrift RPC Method from an External Client

Thrift is frequently used by internal microservices and Hadoop ecosystem services such as HBase, Hive, Spark, and Impala. Many deployments rely on network trust or application-specific authentication. This rule uses a five-day new-terms history window to surface the first observed public client and Thrift server pair that completes a decoded method invocation.

The alert proves that a Thrift transaction was decoded, but it does not prove authentication bypass or successful exploitation.

### Possible investigation steps

- Review `client.ip`, `server.ip`, `server.port`, `network_traffic.thrift.service`, `network_traffic.thrift.method`, `network_traffic.thrift.path`, `network_traffic.thrift.exceptions`, and `network.community_id`.
- Identify the server application and determine whether the service is intended to accept Internet originated Thrift calls.
- Validate the client against partner, VPN, administrator, and approved service inventories.
- Review the service IDL and determine whether the invoked method reads sensitive data, changes configuration, deletes resources, or executes jobs.
- Correlate with service authentication and audit logs because the passive transaction does not expose authoritative authentication state.

### False positive analysis

- Authorized partner APIs and intentionally public Thrift services may alert on a new client/server relationship.
- NAT, proxies, or sensor placement can cause an expected caller to appear under a public address.
- Add narrow exceptions for approved client and server pairs rather than excluding a service or method globally.

### Response and remediation

- Restrict exposed Thrift listeners to approved networks and require authenticated, encrypted transport.
- Block unauthorized clients and isolate the server if sensitive or administrative methods were invoked.
- Review downstream data access and endpoint activity for evidence of collection, lateral movement, or execution.
"""
references = [
    "https://nvd.nist.gov/vuln/detail/CVE-2018-1320",
    "https://attack.mitre.org/techniques/T1190/",
    "https://thrift.apache.org/docs/",
]
risk_score = 47
rule_id = "3b15d24d-03e8-422c-b260-e0834e5fec83"
setup = """## Setup

This rule requires the Elastic Network Packet Capture integration with the Thrift protocol analyzer enabled. Packetbeat
supports TBinary over TSocket or TFramed transport. Compact, JSON, HTTP-wrapped, SASL-wrapped, custom, and encrypted
Thrift transports may not decode. Configure the relevant service IDL files so service, method, parameter, and exception
names are available where supported.
"""
severity = "medium"
tags = [
    "Domain: Network",
    "Use Case: Network Security Monitoring",
    "Use Case: Threat Detection",
    "Tactic: Initial Access",
    "Data Source: Network Packet Capture",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset:network_traffic.thrift and
client.ip:(
  * and
  not (
    10.0.0.0/8 or
    100.64.0.0/10 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.0.0.0/24 or
    192.0.2.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.88.99.0/24 or
    192.168.0.0/16 or
    192.175.48.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    224.0.0.0/4 or
    240.0.0.0/4 or
    "::1" or
    "fc00::/7" or
    "fe80::/10" or
    "ff00::/8"
  )
) and
server.ip:* and
network_traffic.thrift.method:*
'''


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


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

[rule.new_terms]
field = "new_terms_fields"
value = ["client.ip", "server.ip"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset:network_traffic.thrift and
client.ip:(
  * and
  not (
    10.0.0.0/8 or
    100.64.0.0/10 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.0.0.0/24 or
    192.0.2.0/24 or
    192.31.196.0/24 or
    192.52.193.0/24 or
    192.88.99.0/24 or
    192.168.0.0/16 or
    192.175.48.0/24 or
    198.18.0.0/15 or
    198.51.100.0/24 or
    203.0.113.0/24 or
    224.0.0.0/4 or
    240.0.0.0/4 or
    "::1" or
    "fc00::/7" or
    "fe80::/10" or
    "ff00::/8"
  )
) and
server.ip:* and
network_traffic.thrift.method:*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
client.ipin10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.168.0.0/16, 192.175.48.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, ::1, fc00::/7, fe80::/10, ff00::/8excludes:client.ip

Unauthorized Access to an Okta Application

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

Identifies unauthorized access attempts to Okta applications.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2021/05/14"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic", "Austin Songer"]
description = "Identifies unauthorized access attempts to Okta applications."
index = ["filebeat-*", "logs-okta*"]
language = "kuery"
license = "Elastic License v2"
name = "Unauthorized Access to an Okta Application"
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 Unauthorized Access to an Okta Application

Okta is a widely used identity management service that facilitates secure user authentication and access to applications. Adversaries may exploit valid credentials to gain unauthorized access, bypassing security controls. The detection rule monitors specific Okta system events for unauthorized access attempts, leveraging event datasets and actions to identify potential breaches, thus aiding in early threat detection and response.

### Possible investigation steps

- Review the event logs for entries with event.dataset:okta.system and event.action:app.generic.unauth_app_access_attempt to identify the specific unauthorized access attempts.
- Identify the user accounts involved in the unauthorized access attempts and check for any unusual activity or patterns associated with these accounts.
- Investigate the source IP addresses associated with the unauthorized access attempts to determine if they are known or suspicious, and check for any geolocation anomalies.
- Examine the timestamps of the unauthorized access attempts to see if they coincide with any other suspicious activities or known incidents.
- Check for any recent changes in user permissions or configurations in the Okta system that might have facilitated the unauthorized access attempts.
- Contact the affected users to verify if they were aware of the access attempts and to ensure their credentials have not been compromised.

### False positive analysis

- Employees accessing applications from new devices or locations may trigger alerts. Regularly update the list of known devices and locations to minimize these false positives.
- Automated scripts or tools used for application testing might mimic unauthorized access attempts. Identify and whitelist these scripts to prevent unnecessary alerts.
- Users with multiple accounts accessing the same application can be mistaken for unauthorized access. Maintain an updated list of legitimate multi-account users to reduce false positives.
- Changes in user roles or permissions might lead to temporary access issues. Coordinate with HR or IT departments to ensure role changes are reflected promptly in the system.
- Scheduled maintenance or updates to applications can generate access attempts that appear unauthorized. Exclude these events by aligning detection rules with maintenance schedules.

### Response and remediation

- Immediately isolate the affected user account by disabling it to prevent further unauthorized access.
- Review and reset the credentials for the compromised account, ensuring the new password adheres to strong security policies.
- Conduct a thorough audit of recent activities associated with the compromised account to identify any unauthorized changes or data access.
- Notify the affected user and relevant stakeholders about the incident, providing guidance on recognizing phishing attempts and securing their accounts.
- Escalate the incident to the security operations team for further investigation and to determine if additional accounts or systems have been compromised.
- Implement multi-factor authentication (MFA) for the affected account and any other accounts that do not currently have it enabled to enhance security.
- Update and refine monitoring rules to detect similar unauthorized access attempts in the future, ensuring quick identification and response.

## Setup

The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
    "https://developer.okta.com/docs/reference/api/system-log/",
    "https://developer.okta.com/docs/reference/api/event-types/",
    "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",
]
risk_score = 21
rule_id = "4edd3e1a-3aa0-499b-8147-4d2ea43b1613"
severity = "low"
tags = [
    "Tactic: Initial Access",
    "Use Case: Identity and Access Audit",
    "Data Source: Okta",
    "Resources: Investigation Guide",

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

query = '''
data_stream.dataset:okta.system and event.action:app.generic.unauth_app_access_attempt
'''


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

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:okta.system and event.action:app.generic.unauth_app_access_attempt

Indicators

These rows show field, operator, and value matches.

Unsigned or Untrusted Process Execution and Immediate Self-Deletion

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

Detects when a process executes and then immediately deletes itself (the file on disk). Removal of these files can occur during an intrusion, or as part of a post-intrusion process to minimize the adversary's footprint.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when a process executes and then immediately deletes itself (the file on disk). Removal of these files can occur
during an intrusion, or as part of a post-intrusion process to minimize the adversary's footprint.
"""
id = "43d525a1-fe8a-4b24-b973-8e708fabaf4c"
license = "Elastic License v2"
name = "Unsigned or Untrusted Process Execution and Immediate Self-Deletion"
os_list = ["macos"]
reference = ["https://attack.mitre.org/techniques/T1070/004/"]
version = "1.0.22"

query = '''
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and 
  process.executable like ("/Applications/*", "/Volumes/*", "/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Users/*/Public/*") and
  (process.code_signature.trusted == false or process.code_signature.exists == false)]
[file where event.action == "deletion" and startswith~(file.path,process.executable)]
'''

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

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

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



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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and 
  process.executable like ("/Applications/*", "/Volumes/*", "/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Users/*/Public/*") and
  (process.code_signature.trusted == false or process.code_signature.exists == false)]

Stage 2: file

[file where event.action == "deletion" and startswith~(file.path,process.executable)]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • deletion corpus 13 (elastic 13)
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
file.pathstarts_with
  • process.executable (field reference)
field:"TargetFilename" kind:starts_with value:"process.executable"
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.executablewildcard
  • /Applications/*
  • /Users/*/Public/*
  • /Users/Shared/*
  • /Volumes/* corpus 2 (elastic 2)
  • /private/tmp/*
  • /tmp/* corpus 17 (elastic 17)
field:"Image" kind:wildcard

Back to all Elastic rules