Detection rules › Elastic
Elastic rules: 1n
Access to a Sensitive LDAP Attribute
#Identify access to sensitive Active Directory object attributes that contains credentials and decryption keys such as unixUserPassword, ms-PKI-AccountCredentials and msPKI-CredentialRoamingTokens.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Credential Access | |
| Collection |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4662: An operation was performed on an object. |
Rule Body
[metadata]
creation_date = "2022/11/09"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identify access to sensitive Active Directory object attributes that contains credentials and decryption keys such as
unixUserPassword, ms-PKI-AccountCredentials and msPKI-CredentialRoamingTokens.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Access to a Sensitive LDAP Attribute"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Access to a Sensitive LDAP Attribute
LDAP (Lightweight Directory Access Protocol) is crucial for accessing and managing directory information in Active Directory environments. Adversaries may exploit LDAP to access sensitive attributes like passwords and decryption keys, facilitating credential theft or privilege escalation. The detection rule identifies unauthorized access attempts by monitoring specific event codes and attribute identifiers, excluding benign activities to reduce noise, thus highlighting potential security threats.
### Possible investigation steps
- Review the event logs for event code 4662 to identify the specific user or process attempting to access the sensitive LDAP attributes.
- Check the winlog.event_data.SubjectUserSid to determine the identity of the user or service account involved in the access attempt, excluding the well-known SID S-1-5-18 (Local System).
- Analyze the winlog.event_data.Properties field to confirm which sensitive attribute was accessed, such as unixUserPassword, ms-PKI-AccountCredentials, or msPKI-CredentialRoamingTokens.
- Investigate the context of the access attempt by correlating the event with other logs or alerts around the same timestamp to identify any suspicious patterns or activities.
- Verify the legitimacy of the access by checking if the user or process has a valid reason or permission to access the sensitive attributes, considering the organization's access control policies.
- Assess the potential impact of the access attempt on the organization's security posture, focusing on credential theft or privilege escalation risks.
- Document findings and, if necessary, escalate the incident to the appropriate security team for further action or remediation.
### False positive analysis
- Access by legitimate administrative accounts: Regular access by system administrators to sensitive LDAP attributes can trigger alerts. To manage this, create exceptions for known administrative accounts by excluding their SIDs from the detection rule.
- Scheduled system processes: Automated tasks or system processes that require access to certain LDAP attributes may cause false positives. Identify these processes and exclude their specific event codes or AccessMasks if they are consistently benign.
- Service accounts: Service accounts that perform routine directory operations might access sensitive attributes as part of their normal function. Exclude these accounts by adding their SIDs to the exception list to prevent unnecessary alerts.
- Monitoring tools: Security or monitoring tools that scan directory attributes for compliance or auditing purposes can generate false positives. Whitelist these tools by excluding their event sources or specific actions from the detection criteria.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Conduct a thorough review of the access logs to identify any unauthorized users or systems that accessed the sensitive LDAP attributes.
- Reset passwords and revoke any potentially compromised credentials associated with the affected accounts, focusing on those with access to sensitive attributes.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach.
- Implement additional monitoring on the affected systems and accounts to detect any further suspicious activities or attempts to access sensitive LDAP attributes.
- Review and update access controls and permissions for sensitive LDAP attributes to ensure they are restricted to only necessary personnel.
- Conduct a post-incident analysis to identify any gaps in security controls and update policies or procedures to prevent similar incidents in the future."""
references = [
"https://www.mandiant.com/resources/blog/apt29-windows-credential-roaming",
"https://social.technet.microsoft.com/wiki/contents/articles/11483.windows-credential-roaming.aspx",
"https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662",
]
risk_score = 47
rule_id = "764c9fcd-4c4c-41e6-a0c7-d6c46c2eff66"
setup = """## Setup
Audit Directory Service Access must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-directory-service-access
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Tactic: Privilege Escalation",
"Use Case: Active Directory Monitoring",
"Data Source: Active Directory",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
any where host.os.type == "windows" and event.code == "4662" and
not winlog.event_data.SubjectUserSid : "S-1-5-18" and
winlog.event_data.Properties : (
/* unixUserPassword */
"*612cb747-c0e8-4f92-9221-fdd5f15b550d*",
/* ms-PKI-AccountCredentials */
"*b8dfa744-31dc-4ef1-ac7c-84baf7ef9da7*",
/* ms-PKI-DPAPIMasterKeys */
"*b3f93023-9239-4f7c-b99c-6745d87adbc2*",
/* msPKI-CredentialRoamingTokens */
"*b7ff5a38-0818-42b0-8110-d3d154c97f24*"
) and
/*
Excluding noisy AccessMasks
0x0 undefined and 0x100 Control Access
https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662
*/
not winlog.event_data.AccessMask in ("0x0", "0x100")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.004"
name = "Private Keys"
reference = "https://attack.mitre.org/techniques/T1552/004/"
[[rule.threat.technique]]
id = "T1649"
name = "Steal or Forge Authentication Certificates"
reference = "https://attack.mitre.org/techniques/T1649/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.002"
name = "Domain Accounts"
reference = "https://attack.mitre.org/techniques/T1078/002/"
[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 = "T1213"
name = "Data from Information Repositories"
reference = "https://attack.mitre.org/techniques/T1213/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: any
any where host.os.type == "windows" and event.code == "4662" and
not winlog.event_data.SubjectUserSid : "S-1-5-18" and
winlog.event_data.Properties : (
"*612cb747-c0e8-4f92-9221-fdd5f15b550d*",
"*b8dfa744-31dc-4ef1-ac7c-84baf7ef9da7*",
"*b3f93023-9239-4f7c-b99c-6745d87adbc2*",
"*b7ff5a38-0818-42b0-8110-d3d154c97f24*"
) and
/*
Excluding noisy AccessMasks
0x0 undefined and 0x100 Control Access
https:
*/
not winlog.event_data.AccessMask in ("0x0", "0x100")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.code | eq |
| field:"EventID" kind:eq value:"4662" |
winlog.event_data.Properties | wildcard |
| field:"Properties" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
winlog.event_data.AccessMask | in | 0x0, 0x100 | excludes:winlog.event_data.AccessMask field:"winlog.event_data.AccessMask" value:"0x0" field:"winlog.event_data.AccessMask" value:"0x100" |
winlog.event_data.SubjectUserSid | eq | S-1-5-18 | excludes:winlog.event_data.SubjectUserSid field:"winlog.event_data.SubjectUserSid" value:"S-1-5-18" |
Attempt to Delete an Okta Network Zone
#Detects attempts to delete an Okta network zone. Okta network zones can be configured to limit or restrict access to a network based on IP addresses or geolocations. An adversary may attempt to modify, delete, or deactivate an Okta network zone in order to remove or weaken an organization's security controls.
Known False Positives
- Consider adding exceptions to this rule to filter false positives if Oyour organization's Okta network zones are regularly deleted.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Okta | System Log event type zone.delete: Network zone deleted |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2020/11/06"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Detects attempts to delete an Okta network zone. Okta network zones can be configured to limit or restrict access to a
network based on IP addresses or geolocations. An adversary may attempt to modify, delete, or deactivate an Okta network
zone in order to remove or weaken an organization's security controls.
"""
false_positives = [
"""
Consider adding exceptions to this rule to filter false positives if Oyour organization's Okta network zones are
regularly deleted.
""",
]
index = ["filebeat-*", "logs-okta*"]
language = "kuery"
license = "Elastic License v2"
name = "Attempt to Delete an Okta Network Zone"
note = """## Triage and analysis
### Investigating Attempt to Delete an Okta Network Zone
Okta network zones can be configured to limit or restrict access to a network based on IP addresses or geolocations. Deleting a network zone in Okta might remove or weaken the security controls of an organization, which might be an indicator of an adversary's attempt to evade defenses.
#### Possible investigation steps:
- Identify the actor associated with the alert by examining the `okta.actor.id`, `okta.actor.type`, `okta.actor.alternate_id`, or `okta.actor.display_name` fields.
- Examine the `event.action` field to confirm the deletion of a network zone.
- Investigate the `okta.target.id`, `okta.target.type`, `okta.target.alternate_id`, or `okta.target.display_name` fields to identify the network zone that was deleted.
- Review the `event.time` field to understand when the event happened.
- Check the actor's activities before and after the event to understand the context of this event.
### False positive analysis:
- Verify the `okta.client.user_agent.raw_user_agent` field to understand the device and software used by the actor. If these match the actor's typical behavior, it might be a false positive.
- Check if the actor is a known administrator or a member of the IT team who might have a legitimate reason to delete a network zone.
- Cross-verify the actor's actions with any known planned changes or maintenance activities.
### Response and remediation:
- If unauthorized access or actions are confirmed, immediately lock the affected actor's account and require a password change.
- If a network zone was deleted without authorization, create a new network zone with similar settings as the deleted one.
- Review and update the privileges of the actor who initiated the deletion.
- Identify any gaps in the security policies and procedures and update them as necessary.
- Implement additional monitoring and logging of Okta events to improve visibility of user actions.
- Communicate and train the employees about the importance of following proper procedures for modifying network zone settings.
## Setup
The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
"https://help.okta.com/en/prod/Content/Topics/Security/network/network-zones.htm",
"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 = 47
rule_id = "c749e367-a069-4a73-b1f2-43a3798153ad"
severity = "medium"
tags = [
"Use Case: Identity and Access Audit",
"Data Source: Okta",
"Use Case: Network Security Monitoring",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:okta.system and event.action:zone.delete
'''
[[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.007"
name = "Disable or Modify Cloud Firewall"
reference = "https://attack.mitre.org/techniques/T1562/007/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: query
data_stream.dataset:okta.system and event.action:zone.delete
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"okta.system" |
event.action | eq |
| field:"EventType" kind:eq value:"zone.delete" |
AWS IAM Create User via Assumed Role on EC2 Instance
#Detects the creation of an AWS Identity and Access Management (IAM) user initiated by an assumed role on an EC2 instance. Assumed roles allow users or services to temporarily adopt different AWS permissions, but the creation of IAM users through these roles, particularly from within EC2 instances, may indicate a compromised instance. Adversaries might exploit such permissions to establish persistence by creating new IAM users under unauthorized conditions.
Known False Positives
- Assumed roles may be used by legitimate automated systems to create IAM users for specific workflows. Verify if this event aligns with known automation activities. If the action is routine for specific roles or user agents (e.g., `aws-cli`, `boto3`), consider adding those roles or user agents to a monitored exception list for streamlined review.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| AWS | CloudTrail event CreateUser: Creates a new IAM user in the AWS account with a specified user name. |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2024/11/04"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Detects the creation of an AWS Identity and Access Management (IAM) user initiated by an assumed role on an EC2
instance. Assumed roles allow users or services to temporarily adopt different AWS permissions, but the creation of IAM
users through these roles, particularly from within EC2 instances, may indicate a compromised instance. Adversaries might
exploit such permissions to establish persistence by creating new IAM users under unauthorized conditions.
"""
false_positives = [
"""
Assumed roles may be used by legitimate automated systems to create IAM users for specific workflows. Verify if this
event aligns with known automation activities. If the action is routine for specific roles or user agents (e.g.,
`aws-cli`, `boto3`), consider adding those roles or user agents to a monitored exception list for streamlined
review.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Create User via Assumed Role on EC2 Instance"
note = """## Triage and analysis
### Investigating AWS IAM Create User via Assumed Role on EC2 Instance
This rule detects when an AWS Identity and Access Management (IAM) user is created through an assumed role on an EC2 instance. This action may indicate a potentially compromised instance where an adversary could be using the instance’s permissions to create a new IAM user, enabling persistent unauthorized access.
#### Possible Investigation Steps
- **Identify the Assumed Role and Initiating Instance**:
- **Role and Instance**: Examine the `aws.cloudtrail.user_identity.arn` field to determine the specific EC2 instance and role used for this action (e.g., `arn:aws:sts::[account-id]:assumed-role/[role-name]/[instance-id]`). Verify if this behavior aligns with expected usage or represents an anomaly.
- **Analyze the Target IAM User**:
- **New User Details**: Inspect `aws.cloudtrail.request_parameters` to see the username that was created. Validate if the user is expected or authorized.
- **Review Creation Time and Context**: Compare the creation time (`@timestamp`) of the user with other activities from the same instance and role to assess if this creation was part of a larger chain of actions.
- **Check User Agent and Tooling**:
- **User Agent Analysis**: Review `user_agent.original` to see if AWS CLI, SDK, or other tooling was used for this request. Identifiers such as `aws-cli`, `boto3`, or similar SDK names can indicate the method used, which may differentiate automation from interactive actions.
- **Source IP and Location**: Use the `source.ip` and `source.geo` fields to identify the IP address and geographic location of the event. Verify if this aligns with expected access patterns for your environment.
- **Evaluate for Persistence Indicators**:
- **Role Permissions**: Check the permissions associated with the assumed role (`arn:aws:iam::[account-id]:role/[role-name]`) to determine if creating IAM users is a legitimate activity for this role.
- **Automated Role Patterns**: If the assumed role or instance typically creates IAM users for automation purposes, validate this action against historical records to confirm if the event is consistent with normal patterns.
- **Review Related CloudTrail Events**:
- **Additional IAM Actions**: Investigate for other recent IAM or CloudTrail events tied to this role or instance, especially `CreateAccessKey` or `AttachUserPolicy` actions. These could signal further attempts to empower or utilize the newly created user.
- **Correlate with Other Suspicious Activities**: Determine if other roles or instances recently initiated similar unusual actions, such as privilege escalations or data access.
### False Positive Analysis
- **Expected Automation**: Assumed roles may be used by legitimate automated systems that create users for specific workflows. Confirm if this event aligns with known automation activities.
- **Role Exceptions**: If this action is routine for specific roles, consider adding those roles to a monitored exception list for streamlined review.
### Response and Remediation
- **Immediate Access Review**: If user creation was unauthorized, restrict the assumed role’s permissions to prevent further user creation.
- **Delete Unauthorized Users**: Confirm and remove any unauthorized IAM users, adjusting IAM policies to reduce similar risks.
- **Enhance Monitoring and Alerts**: Enable enhanced logging or real-time alerts for this role or instance to detect further unauthorized access attempts.
- **Policy Update**: Consider updating IAM policies associated with roles on EC2 instances to limit sensitive actions like IAM user creation.
### Additional Information
For further guidance on managing IAM roles and permissions within AWS environments, refer to the [AWS IAM documentation](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateUser.html) and AWS best practices for security.
"""
references = [
"https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateUser.html",
"https://www.dionach.com/en-us/breaking-into-the-cloud-red-team-tactics-for-aws-compromise/",
]
risk_score = 73
rule_id = "f7a1c536-9ac0-11ef-9911-f661ea17fbcd"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS IAM",
"Use Case: Identity and Access Audit",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: "CreateUser"
and event.outcome: "success"
and aws.cloudtrail.user_identity.type: "AssumedRole"
and user.id: *\:i-*
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements"
]
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1136"
name = "Create Account"
reference = "https://attack.mitre.org/techniques/T1136/"
[[rule.threat.technique.subtechnique]]
id = "T1136.003"
name = "Cloud Account"
reference = "https://attack.mitre.org/techniques/T1136/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.new_terms]
field = "new_terms_fields"
value = ["aws.cloudtrail.user_identity.arn"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: "CreateUser"
and event.outcome: "success"
and aws.cloudtrail.user_identity.type: "AssumedRole"
and user.id: *\:i-*
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
aws.cloudtrail.user_identity.type | eq |
| field:"aws::userIdentity.type" kind:eq value:"AssumedRole" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"CreateUser" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"iam.amazonaws.com" |
user.id | wildcard |
| field:"user.id" kind:wildcard value:"*:i-*" |
Azure AKS API Server Proxying Request to Kubelet
#Detects a non-system identity using the AKS (Azure Kubernetes Service) API server nodes/proxy subresource to reach a node's Kubelet. Proxying through the API server reaches the Kubelet API to enumerate pods or run commands on nodes, a lateral-movement and privilege-escalation vector (kubeletctl, Peirates). Node, control-plane, and kube-system service account identities that routinely proxy for monitoring are excluded, so remaining matches, including compromised workload service accounts, are surfaced for review.
Known False Positives
- Monitoring and log-collection agents that run outside kube-system (for example a metrics agent in its own namespace) proxy to the Kubelet on every scrape and will match repeatedly. Add targeted exclusions for verified monitoring service accounts and namespaces after review.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Lateral Movement |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2026/07/09"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/09"
[rule]
author = ["Elastic"]
description = """
Detects a non-system identity using the AKS (Azure Kubernetes Service) API server nodes/proxy subresource to reach a
node's Kubelet. Proxying through the API server reaches the Kubelet API to enumerate pods or run commands on nodes, a
lateral-movement and privilege-escalation vector (kubeletctl, Peirates). Node, control-plane, and kube-system service
account identities that routinely proxy for monitoring are excluded, so remaining matches, including compromised
workload service accounts, are surfaced for review.
"""
false_positives = [
"""
Monitoring and log-collection agents that run outside kube-system (for example a metrics agent in its own namespace)
proxy to the Kubelet on every scrape and will match repeatedly. Add targeted exclusions for verified monitoring
service accounts and namespaces after review.
""",
]
from = "now-9m"
index = ["logs-azure.platformlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure AKS API Server Proxying Request to Kubelet"
note = """## Triage and analysis
### Investigating Azure AKS API Server Proxying Request to Kubelet
AKS kube-audit events are carried under the flattened `azure.platformlogs.properties.log.*` subtree and share the ARM
operation `event.action: Microsoft.ContainerService/managedClusters/diagnosticLogs/Read`. The `nodes/proxy` subresource
tunnels a request through the API server to a node's Kubelet. An identity with this permission can enumerate pods
(`/proxy/pods`, `/proxy/runningpods`) or run commands (`/proxy/run`, `/proxy/exec`) on nodes without direct network
access to the Kubelet port. This rule excludes the node, control-plane, and kube-system service-account identities that
routinely proxy for monitoring, so remaining matches are workload identities or users that should rarely, if ever, reach
the Kubelet.
### Possible investigation steps
- Identify the acting identity in `azure.platformlogs.properties.log.user.username` and whether a workload service
account or user should reach the Kubelet at all. Compromised pod service accounts (`system:serviceaccount:<ns>:<name>`)
are the primary vehicle for this technique.
- Inspect the proxied Kubelet endpoint in `azure.platformlogs.properties.log.requestURI`. `/metrics` and `/stats` are
monitoring; `/pods` and `/runningpods` are reconnaissance; `/run`, `/exec`, `/attach`, and `/portforward` are command
execution and warrant immediate escalation.
- Evaluate `azure.platformlogs.properties.log.sourceIPs`. This is an array; for an externally operated attack the first
element is the operator's real client IP, while the trailing entry is the internal API-server/konnectivity hop
(`172.31.x`). A first entry that is not the cluster's own egress is a strong signal. In-cluster pivots show only
internal addresses, so absence of an external IP does not clear the event.
- Review the target node in `azure.platformlogs.properties.log.objectRef.name` and correlate with subsequent activity on
that node's workloads (secret reads, RBAC changes, new pods).
### False positive analysis
- Monitoring and log-collection agents outside kube-system proxy to the Kubelet on every scrape and will match
repeatedly; add targeted exclusions for verified monitoring service accounts and namespaces.
### Response and remediation
- If unauthorized, revoke the acting identity's tokens and review the RBAC that granted `nodes/proxy`.
- Inspect the target node for command execution, dropped tooling, or credential theft, and rotate credentials reachable
from affected pods.
- Note that direct Kubelet access on port 10250 bypasses the API server and does not appear in kube-audit; treat a
confirmed proxy abuse as possible evidence of broader Kubelet access.
- Collect kube-audit and identity artifacts per incident response procedures.
"""
references = [
"https://kubernetes.io/docs/reference/access-authn-authz/kubelet-authn-authz/",
"https://stratus-red-team.cloud/attack-techniques/kubernetes/k8s.privilege-escalation.nodes-proxy/",
"https://horizon3.ai/attack-research/when-read-only-isnt-k8s-nodes-proxy-get-to-rce/",
"https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
"https://github.com/inguardians/peirates",
]
risk_score = 47
rule_id = "dd43c618-6a5b-465b-8ae4-ce69e34ddac0"
setup = "The Azure Fleet integration collecting AKS diagnostic logs with the `kube-audit` category forwarded through Event Hub into the `azure.platformlogs` data stream is required for this rule."
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Kubernetes",
"Data Source: Azure",
"Data Source: Azure Platform Logs",
"Data Source: Kubernetes",
"Use Case: Threat Detection",
"Tactic: Lateral Movement",
"Tactic: Execution",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:azure.platformlogs and
event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
azure.platformlogs.category:"kube-audit" and
azure.platformlogs.properties.log.objectRef.resource:"nodes" and
azure.platformlogs.properties.log.objectRef.subresource:"proxy" and
not azure.platformlogs.properties.log.user.username:(
system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
system\:serviceaccount\:kube-system\:*
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"
[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 = "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/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"event.action",
"azure.platformlogs.category",
"azure.platformlogs.properties.log.verb",
"azure.platformlogs.properties.log.user.username",
"azure.platformlogs.properties.log.sourceIPs",
"azure.platformlogs.properties.log.requestURI",
"azure.platformlogs.properties.log.objectRef.resource",
"azure.platformlogs.properties.log.objectRef.subresource",
"azure.platformlogs.properties.log.objectRef.name",
]
Stages and Predicates
Stage 1: query
data_stream.dataset:azure.platformlogs and
event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
azure.platformlogs.category:"kube-audit" and
azure.platformlogs.properties.log.objectRef.resource:"nodes" and
azure.platformlogs.properties.log.objectRef.subresource:"proxy" and
not azure.platformlogs.properties.log.user.username:(
system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or
system\:serviceaccount\:kube-system\:*
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
Azure AKS Secret get or list with Suspicious User Agent
#Detects successful AKS (Azure Kubernetes Service) secret get or list operations where the user agent matches scripting runtimes (python, ruby, perl), command-line HTTP clients (curl, wget, HTTPie), or generic HTTP libraries (Go-http-client, okhttp, Apache-HttpClient, Guzzle, axios, undici) rather than typical kubectl or named controller traffic. Reading Kubernetes secrets with a generic client is a common credential-access step after a token or kubeconfig is stolen, and offensive tooling (for example peirates and kdigger) frequently reaches the API with a default Go HTTP client.
Known False Positives
- Approved scripts, CI jobs, or penetration tests may use generic HTTP clients. Validate change tickets and identity scope before treating as compromise. Internal automation using generic libraries can be excluded by stable service account after review.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Kubernetes | get-secrets: get secrets |
| Kubernetes | list-secrets: list secrets |
Rules Detecting the Same Action
These rules filter on the same operation.
- Direct Interactive Kubernetes API Request by Unusual Utilities (Elastic)
- GKE Rapid Secret GET Activity Against Multiple Objects (Elastic)
- GKE Secret Access from Node or Denied Service Account (Elastic)
- GKE Secret Access via Unusual User Agent (Elastic)
- GKE Secret get or list with Suspicious User Agent (Elastic)
- GKE Secrets List from Unusual Source AS Organization (Elastic)
- GKE Unusual Service Account Secret Access via New User Agent (Elastic)
- Kubernetes Abuse of Secret by Unusual Location (Splunk)
Rule Body
[metadata]
creation_date = "2026/07/09"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/09"
[rule]
author = ["Elastic"]
description = """
Detects successful AKS (Azure Kubernetes Service) secret get or list operations where the user agent matches scripting
runtimes (python, ruby, perl), command-line HTTP clients (curl, wget, HTTPie), or generic HTTP libraries (Go-http-client,
okhttp, Apache-HttpClient, Guzzle, axios, undici) rather than typical kubectl or named controller traffic. Reading
Kubernetes secrets with a generic client is a common credential-access step after a token or kubeconfig is stolen, and
offensive tooling (for example peirates and kdigger) frequently reaches the API with a default Go HTTP client.
"""
false_positives = [
"""
Approved scripts, CI jobs, or penetration tests may use generic HTTP clients. Validate change tickets and identity
scope before treating as compromise. Internal automation using generic libraries can be excluded by stable service
account after review.
""",
]
from = "now-9m"
index = ["logs-azure.platformlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure AKS Secret get or list with Suspicious User Agent"
note = """## Triage and analysis
### Investigating Azure AKS Secret get or list with Suspicious User Agent
AKS kube-audit events are carried under the flattened `azure.platformlogs.properties.log.*` subtree and share the ARM
operation `event.action: Microsoft.ContainerService/managedClusters/diagnosticLogs/Read`. This rule fires when a
successful `get` or `list` against Kubernetes `secrets` is issued with a user agent that matches scripting runtimes
(python, ruby, perl), command-line HTTP clients (curl, wget, HTTPie), or generic HTTP libraries (Go-http-client, okhttp,
Apache-HttpClient, Guzzle, axios, undici) rather than typical `kubectl` or named controller traffic. The user agent is
trivially spoofable (the telemetry shows offensive tooling masquerading as `kubectl`), so this is a corroborating
indicator, not proof.
### Possible investigation steps
- Identify the acting identity in `azure.platformlogs.properties.log.user.username` and its group memberships in
`azure.platformlogs.properties.log.user.groups`. Control-plane and node identities (`system:apiserver`, `aksService`,
`system:node:*`, `system:serviceaccount:kube-system:*`) are expected; a human or service-principal identity reading
secrets with a scripted client is not.
- Confirm the request was authorized by checking
`azure.platformlogs.properties.log.annotations.authorization.k8s.io/decision` (`allow` vs `forbid`) and the
`azure.platformlogs.properties.log.responseStatus.code`.
- Review the targeted secret via `azure.platformlogs.properties.log.objectRef.namespace` and
`azure.platformlogs.properties.log.objectRef.name`, and the exact API path in
`azure.platformlogs.properties.log.requestURI`.
- Evaluate the source in `azure.platformlogs.properties.log.sourceIPs`. In-cluster control-plane traffic uses loopback
(`::1`) or node subnet addresses; a public or pod-network source for a secret read is more suspicious. Pivot on the
source for other API bursts, exec sessions, or RBAC changes.
- Correlate with recent Entra ID sign-ins or role assignments for the identity to determine whether the token was
recently issued or scoped unusually.
### False positive analysis
- Approved scripts, CI jobs, or penetration tests may use generic HTTP clients. Validate identity scope before treating
as compromise.
- Internal automation using generic libraries can be excluded by stable service account after review.
- The kubelet and controllers built on client-go can default to a `Go-http-client/2.0` user agent when no custom agent
is set (see kubernetes/kubernetes#108726), so an operator or platform component reading secrets may match `Go-http*`.
Exclude the specific benign identity (for example `system:serviceaccount:kube-system:*` or a validated operator
service account) rather than removing the `Go-http*` pattern, which also catches default-user-agent offensive tooling.
### Response and remediation
- If unauthorized, revoke the identity's tokens and kubeconfig, rotate the exposed secrets, and review RBAC that permits
secret reads.
- Hunt for downstream use of the retrieved secrets, such as new sign-ins, workload deployments, or outbound connections.
- Collect kube-audit and identity artifacts per incident response procedures.
"""
references = [
"https://kubernetes.io/docs/concepts/configuration/secret/",
"https://microsoft.github.io/Threat-Matrix-for-Kubernetes/",
"https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/",
"https://unit42.paloaltonetworks.com/modern-kubernetes-threats/",
"https://www.sysdig.com/blog/teamtnt-kubelet-credentials",
"https://github.com/kubernetes/kubernetes/issues/108726",
]
risk_score = 73
rule_id = "4eaf5dd4-c511-4d0e-b66d-e218e6e3da76"
setup = """
The Azure Fleet integration collecting AKS diagnostic logs forwarded through Event Hub into the `azure.platformlogs`
data stream is required for this rule. The `kube-audit` log category is required specifically: secret get/list are
read operations, which the `kube-audit-admin` category excludes, so a cluster shipping only `kube-audit-admin` is blind
to this rule.
"""
severity = "high"
tags = [
"Domain: Cloud",
"Domain: Kubernetes",
"Data Source: Azure",
"Data Source: Azure Platform Logs",
"Data Source: Kubernetes",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:azure.platformlogs and
event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
azure.platformlogs.category:"kube-audit" and
azure.platformlogs.properties.log.responseStatus.code:("200" or "201") and
azure.platformlogs.properties.log.verb:("get" or "list") and
azure.platformlogs.properties.log.objectRef.resource:"secrets" and
azure.platformlogs.properties.log.userAgent:(
curl* or python* or Python* or wget* or Wget* or Go-http* or perl* or libwww-perl* or
java* or Java* or node* or php* or Guzzle* or Bun* or axios* or undici* or okhttp* or
Apache-HttpClient* or HTTPie* or Ruby* or PostmanRuntime* or RestSharp* or *distrib#kali* or *kali-amd64* or *kali-arm64*
)
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"event.action",
"azure.platformlogs.category",
"azure.platformlogs.properties.log.verb",
"azure.platformlogs.properties.log.user.username",
"azure.platformlogs.properties.log.userAgent",
"azure.platformlogs.properties.log.sourceIPs",
"azure.platformlogs.properties.log.objectRef.resource",
"azure.platformlogs.properties.log.objectRef.namespace",
"azure.platformlogs.properties.log.objectRef.name",
"azure.platformlogs.properties.log.responseStatus.code",
]
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[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/"
Stages and Predicates
Stage 1: query
data_stream.dataset:azure.platformlogs and
event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and
azure.platformlogs.category:"kube-audit" and
azure.platformlogs.properties.log.responseStatus.code:("200" or "201") and
azure.platformlogs.properties.log.verb:("get" or "list") and
azure.platformlogs.properties.log.objectRef.resource:"secrets" and
azure.platformlogs.properties.log.userAgent:(
curl* or python* or Python* or wget* or Wget* or Go-http* or perl* or libwww-perl* or
java* or Java* or node* or php* or Guzzle* or Bun* or axios* or undici* or okhttp* or
Apache-HttpClient* or HTTPie* or Ruby* or PostmanRuntime* or RestSharp* or *distrib#kali* or *kali-amd64* or *kali-arm64*
)
Indicators
These rows show field, operator, and value matches.
Binary Proxy Execution via Rundll32
#Identifies the execution of a malicious application via rundll32.exe. Adversaries may abuse rundll32.exe to proxy execution of malicious code and bypass application whitelisting configuration.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies the execution of a malicious application via rundll32.exe. Adversaries may abuse rundll32.exe to proxy
execution of malicious code and bypass application whitelisting configuration.
"""
id = "f60455df-5054-49ff-9ff7-1dc4e37b6ea7"
license = "Elastic License v2"
name = "Binary Proxy Execution via Rundll32"
os_list = ["windows"]
reference = [
"https://lolbas-project.github.io/lolbas/Libraries/Shell32/",
"https://lolbas-project.github.io/lolbas/Libraries/Zipfldr/",
"https://lolbas-project.github.io/lolbas/Libraries/Pcwutl/",
"https://lolbas-project.github.io/lolbas/Libraries/Advpack/",
"https://lolbas-project.github.io/lolbas/Libraries/Ieadvpack/",
"https://lolbas-project.github.io/lolbas/Libraries/Url/",
"https://lolbas-project.github.io/lolbas/Libraries/Desk/",
]
version = "1.0.35"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and
process.pe.original_file_name == "RUNDLL32.EXE" and
process.command_line :
("*advpack*RegisterOCX*",
"*advpack*#12*",
"*zipfldr*RouteTheCall*",
"*pcwutl*LaunchApplication*",
"*pcwutl*#1*",
"*url.dll*FileProtocolHandler*file://*",
"*url.dll*FileProtocolHandler*.exe*",
"*shell32.dll*ShellExec_RunDLL*",
"*advpack*LaunchINFSection*",
"*desk*InstallScreenSaver*",
"*shell32*WaitForExplorerRestart*") and
/* Issue #265 */
not (process.command_line : "*url.dll*FileProtocolHandler*" and
process.command_line : ("*http://*", "*zoommtg://*", "*://*&*&*")) and
/* Legit LaunchApplication instances via msdt */
not (process.command_line : "*pcwutl.dll,LaunchApplication*" and
process.parent.name : "msdt.exe" and
process.working_directory : "?:\\Windows\\system32\\") and
not (process.command_line : "*shell32*WaitForExplorerRestart*" and process.args : "?:\\Windows\\*explorer.exe") and
not (process.parent.executable : "C:\\Program Files\\Microsoft OneDrive\\OneDrive.exe" and process.args : "ShellExec_RunDLL")
] by process.entity_id
[process where event.action == "start" and
not process.executable :
("?:\\Program Files\\*",
"?:\\Program Files (x86)\\*",
"C:\\Windows\\System32\\shutdown.exe",
"C:\\Windows\\System32\\WerFault.exe") and
not (process.executable : "?:\\Windows\\*.scr" and process.parent.args : "desk.cpl,InstallScreenSaver") and
not (process.name : "wscript.exe" and process.args : "Cathexis Archive Viewer.vbs") and
not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
not process.Ext.token.integrity_level_name == "system" and
not process.executable : "?:\\Windows\\System32\\grpconv.exe" and
not (process.code_signature.subject_name : "Adobe Inc." and process.code_signature.trusted == true) and
not process.hash.sha256 :
("f6bef3f879e082d115c2ad199a986da1660514699f5e752c7b628d9438d7cb49",
"c2831f5b010f099cd1733a0183adfa16cb834a9169fc55c6f7e6dc3267488c3f",
"70ebedc5aba37140682a0535eac9f1cfb77cc9916955e36f19ba1da893068a83",
"e6caed88fa115a412c744d0ec91f34cd3b5f329d7acdc1cb14e35364d492d095",
"af31ac74a9072e4bbc24ff17ee70681539e660d4fa885fcb45e752b5ec21d2ef") and
not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.parent.args : "?:\\WINDOWS\\system32\\pcwutl.dll,LaunchApplication") and
not (process.executable : "?:\\Windows\\System32\\verclsid.exe" and process.args : "{71DCE5D6-4B57-496B-AC21-CD5B54EB93FD}" and process.parent.command_line : "*ShellExec_RunDLL*") and
not (process.executable : ("?:\\Windows\\System32\\notepad.exe", "?:\\Windows\\System32\\mspaint.exe") and process.parent.command_line : "*ShellExec_RunDLL*")
] by process.parent.entity_id
'''
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 = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[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, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and
process.pe.original_file_name == "RUNDLL32.EXE" and
process.command_line :
("*advpack*RegisterOCX*",
"*advpack*#12*",
"*zipfldr*RouteTheCall*",
"*pcwutl*LaunchApplication*",
"*pcwutl*#1*",
"*url.dll*FileProtocolHandler*file://*",
"*url.dll*FileProtocolHandler*.exe*",
"*shell32.dll*ShellExec_RunDLL*",
"*advpack*LaunchINFSection*",
"*desk*InstallScreenSaver*",
"*shell32*WaitForExplorerRestart*") and
not (process.command_line : "*url.dll*FileProtocolHandler*" and
process.command_line : ("*http://*", "*zoommtg://*", "*://*&*&*")) and
not (process.command_line : "*pcwutl.dll,LaunchApplication*" and
process.parent.name : "msdt.exe" and
process.working_directory : "?:\\Windows\\system32\\") and
not (process.command_line : "*shell32*WaitForExplorerRestart*" and process.args : "?:\\Windows\\*explorer.exe") and
not (process.parent.executable : "C:\\Program Files\\Microsoft OneDrive\\OneDrive.exe" and process.args : "ShellExec_RunDLL")
] by process.entity_id
Stage 2: process
[process where event.action == "start" and
not process.executable :
("?:\\Program Files\\*",
"?:\\Program Files (x86)\\*",
"C:\\Windows\\System32\\shutdown.exe",
"C:\\Windows\\System32\\WerFault.exe") and
not (process.executable : "?:\\Windows\\*.scr" and process.parent.args : "desk.cpl,InstallScreenSaver") and
not (process.name : "wscript.exe" and process.args : "Cathexis Archive Viewer.vbs") and
not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
not process.Ext.token.integrity_level_name == "system" and
not process.executable : "?:\\Windows\\System32\\grpconv.exe" and
not (process.code_signature.subject_name : "Adobe Inc." and process.code_signature.trusted == true) and
not process.hash.sha256 :
("f6bef3f879e082d115c2ad199a986da1660514699f5e752c7b628d9438d7cb49",
"c2831f5b010f099cd1733a0183adfa16cb834a9169fc55c6f7e6dc3267488c3f",
"70ebedc5aba37140682a0535eac9f1cfb77cc9916955e36f19ba1da893068a83",
"e6caed88fa115a412c744d0ec91f34cd3b5f329d7acdc1cb14e35364d492d095",
"af31ac74a9072e4bbc24ff17ee70681539e660d4fa885fcb45e752b5ec21d2ef") and
not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.parent.args : "?:\\WINDOWS\\system32\\pcwutl.dll,LaunchApplication") and
not (process.executable : "?:\\Windows\\System32\\verclsid.exe" and process.args : "{71DCE5D6-4B57-496B-AC21-CD5B54EB93FD}" and process.parent.command_line : "*ShellExec_RunDLL*") and
not (process.executable : ("?:\\Windows\\System32\\notepad.exe", "?:\\Windows\\System32\\mspaint.exe") and process.parent.command_line : "*ShellExec_RunDLL*")
] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"RUNDLL32.EXE" |
Exclusions
The rule actively suppresses these predicates.
Download Activity via a Headless Browser
#Identifies the use of a browser to download a file from a remote URL and from a suspicious parent process. Adversaries may use browsers to avoid ingress tool transfer restrictions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[rule]
description = """
Identifies the use of a browser to download a file from a remote URL and from a suspicious parent process. Adversaries
may use browsers to avoid ingress tool transfer restrictions.
"""
id = "e35465eb-2a6b-4b6a-abbf-0bc3d9a068d0"
license = "Elastic License v2"
name = "Download Activity via a Headless Browser"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Msedge/"]
version = "1.0.5"
query = '''
process where event.action in ("start", "already_running") and
process.name : ("chrome.exe", "msedge.exe", "brave.exe", "browser.exe", "dragon.exe", "vivaldi.exe") and
(
(process.args : "--headless*" and process.args : ("http*", "data:text/html;base64,*")) or
process.command_line : ("*mh0dHBzOi8vd2ViaG9vay5zaXRl*", "*93ZWJob29rLnNpdGU*") or
(process.args_count == 2 and process.args : "data:text/html;base64,*")
) and
process.parent.name :
("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "conhost.exe", "msiexec.exe",
"explorer.exe", "rundll32.exe", "winword.exe", "excel.exe", "onenote.exe", "hh.exe", "powerpnt.exe", "forfiles.exe",
"pcalua.exe", "wmiprvse.exe") and
not process.args : ("http://localhost/Allure#graph", "--print-to-pdf=*")
'''
min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.16.0"
Stages and Predicates
Stage 1: process
process where event.action in ("start", "already_running") and
process.name : ("chrome.exe", "msedge.exe", "brave.exe", "browser.exe", "dragon.exe", "vivaldi.exe") and
(
(process.args : "--headless*" and process.args : ("http*", "data:text/html;base64,*")) or
process.command_line : ("*mh0dHBzOi8vd2ViaG9vay5zaXRl*", "*93ZWJob29rLnNpdGU*") or
(process.args_count == 2 and process.args : "data:text/html;base64,*")
) and
process.parent.name :
("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "conhost.exe", "msiexec.exe",
"explorer.exe", "rundll32.exe", "winword.exe", "excel.exe", "onenote.exe", "hh.exe", "powerpnt.exe", "forfiles.exe",
"pcalua.exe", "wmiprvse.exe") and
not process.args : ("http://localhost/Allure#graph", "--print-to-pdf=*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"2" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | http://localhost/Allure#graph, --print-to-pdf=* | excludes:process.args field:"process.args" value:"http://localhost/Allure#graph" field:"process.args" value:"--print-to-pdf=*" |
Dumping Account Hashes via Built-In Commands
#Identifies the execution of macOS built-in commands used to dump user account hashes. Adversaries may attempt to dump credentials to obtain account login information in the form of a hash. These hashes can be cracked or leveraged for lateral movement.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[metadata]
creation_date = "2021/01/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/08/25"
[rule]
author = ["Elastic", "Massimo Bertocchi"]
description = """
Identifies the execution of macOS built-in commands used to dump user account hashes. Adversaries may attempt to dump
credentials to obtain account login information in the form of a hash. These hashes can be cracked or leveraged for
lateral movement.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Dumping Account Hashes via Built-In Commands"
references = [
"https://apple.stackexchange.com/questions/186893/os-x-10-9-where-are-password-hashes-stored",
"https://www.unix.com/man-page/osx/8/mkpassdb/",
]
risk_score = 73
rule_id = "02ea4563-ec10-4974-b7de-12e65aa4f9b3"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "macos" and event.type in ("start","process_started") and (
(process.name == "defaults" and process.args like~ "ShadowHashData") or
(process.name == "mkpassdb" and process.args == "-dump") or
(process.name == "dscl" and process.args like~ "ShadowHashData") or
(
process.name in ("plutil","cat","strings","xxd","head") and
process.args like "/var/db/dslocal/nodes/Default/users/*.plist"
)
)
'''
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 Dumping Account Hashes via Built-In Commands
In macOS environments, built-in commands like `defaults` and `mkpassdb` can be exploited by adversaries to extract user account hashes, which are crucial for credential access. These hashes, once obtained, can be cracked to reveal passwords or used for lateral movement within a network. The detection rule identifies suspicious process executions involving these commands and specific arguments, signaling potential credential dumping activities.
### Possible investigation steps
- Review the process execution details to confirm the presence of the `defaults` or `mkpassdb` commands with arguments like `ShadowHashData` or `-dump`, as these are indicative of credential dumping attempts.
- Identify the user account associated with the process execution to determine if the activity aligns with expected behavior for that user or if it appears suspicious.
- Check the historical activity of the involved user account and the host to identify any patterns or anomalies that could suggest unauthorized access or lateral movement.
- Investigate any network connections or subsequent processes initiated by the suspicious process to assess potential data exfiltration or further malicious actions.
- Correlate the event with other security alerts or logs from the same host or user account to build a comprehensive timeline of the activity and assess the scope of the potential compromise.
### False positive analysis
- System administrators or security tools may legitimately use the `defaults` or `mkpassdb` commands for system maintenance or auditing purposes. To manage these, create exceptions for known administrative accounts or tools that regularly execute these commands.
- Automated scripts or management software might invoke these commands as part of routine operations. Identify and whitelist these scripts or software to prevent unnecessary alerts.
- Developers or IT personnel might use these commands during testing or development phases. Establish a process to temporarily exclude these activities by setting up time-bound exceptions for specific user accounts or devices.
- Security assessments or penetration tests could trigger this rule. Coordinate with security teams to schedule and document these activities, allowing for temporary rule adjustments during the testing period.
### Response and remediation
- Immediately isolate the affected macOS system from the network to prevent further lateral movement or data exfiltration.
- Terminate any suspicious processes identified as using the `defaults` or `mkpassdb` commands with the specified arguments to halt ongoing credential dumping activities.
- Conduct a thorough review of user accounts on the affected system to identify any unauthorized access or changes, focusing on accounts with elevated privileges.
- Reset passwords for all potentially compromised accounts, especially those with administrative access, and enforce strong password policies.
- Analyze system logs and network traffic to identify any additional systems that may have been accessed using the compromised credentials, and apply similar containment measures.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the full scope of the breach.
- Implement enhanced monitoring and alerting for similar suspicious activities across the network to detect and respond to future attempts promptly."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.008"
name = "/etc/passwd and /etc/shadow"
reference = "https://attack.mitre.org/techniques/T1003/008/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: process
process where host.os.type == "macos" and event.type in ("start","process_started") and (
(process.name == "defaults" and process.args like~ "ShadowHashData") or
(process.name == "mkpassdb" and process.args == "-dump") or
(process.name == "dscl" and process.args like~ "ShadowHashData") or
(
process.name in ("plutil","cat","strings","xxd","head") and
process.args like "/var/db/dslocal/nodes/Default/users/*.plist"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | in |
| field:"event.type" kind:in |
process.args | eq |
| field:"process.args" kind:eq value:"-dump" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq |
process.name | in |
| field:"process_basename" kind:in |
Executable File Creation with Multiple Extensions
#Masquerading can allow an adversary to evade defenses and better blend in with the environment. One way it occurs is when the name or location of a file is manipulated as a means of tricking a user into executing what they think is a benign file type but is actually executable code.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 11: FileCreate |
Rule Body
[metadata]
creation_date = "2021/01/19"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Masquerading can allow an adversary to evade defenses and better blend in with the environment. One way it occurs is
when the name or location of a file is manipulated as a means of tricking a user into executing what they think is a
benign file type but is actually executable code.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.file-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Executable File Creation with Multiple Extensions"
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 Executable File Creation with Multiple Extensions
In Windows environments, adversaries may exploit file extensions to disguise malicious executables as benign files, such as documents or images, by appending multiple extensions. This tactic, known as masquerading, aims to deceive users and evade security measures. The detection rule identifies suspicious file creations by monitoring for executables with misleading extensions, excluding known legitimate processes, thus highlighting potential threats.
### Possible investigation steps
- Review the file creation event details to identify the full file path and name, focusing on the extensions used to determine if they match the suspicious pattern outlined in the query.
- Investigate the process that created the file by examining the process.executable field to determine if it is a known legitimate process or potentially malicious.
- Check the file's origin by analyzing the user account and network activity associated with the file creation event to identify any unusual or unauthorized access patterns.
- Utilize threat intelligence sources to assess if the file hash or any related indicators of compromise (IOCs) are known to be associated with malicious activity.
- Examine the file's metadata and properties to verify its authenticity and check for any signs of tampering or unusual characteristics.
- Conduct a behavioral analysis of the file in a controlled environment to observe any malicious actions or network communications it may attempt.
### False positive analysis
- Legitimate software installations may create executables with multiple extensions during setup processes. Users can exclude these by adding exceptions for known installer paths, such as "C:\\Users\\*\\QGIS_SCCM\\Files\\QGIS-OSGeo4W-*-Setup-x86_64.exe".
- System updates or patches might temporarily create files with multiple extensions. Monitor and verify these activities, and if confirmed as legitimate, add exceptions for the specific update processes.
- Development environments or script-based applications may generate files with multiple extensions for testing purposes. Identify these environments and exclude their specific file paths or processes to prevent false positives.
- Security tools or administrative scripts might use multiple extensions for legitimate purposes. Review and whitelist these tools by their executable paths or process names to avoid unnecessary alerts.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate any suspicious processes associated with the masquerading executable files to halt any ongoing malicious actions.
- Quarantine the identified files with multiple extensions to prevent execution and further analysis.
- Conduct a thorough scan of the affected system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional threats.
- Review and restore any altered system configurations or files to their original state to ensure system integrity.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for similar file creation activities to improve detection and response capabilities for future incidents."""
risk_score = 47
rule_id = "8b2b3a62-a598-4293-bc14-3d5fa22bb98f"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type == "creation" and file.extension : "exe" and
file.name regex~ """.*\.(vbs|vbe|bat|js|cmd|wsh|ps1|pdf|docx?|xlsx?|pptx?|txt|rtf|gif|jpg|png|bmp|hta|txt|img|iso)\.exe""" and
not (
process.executable : (
"?:\\Windows\\System32\\msiexec.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe",
"*\\Users\\*\\QGIS_SCCM\\Files\\QGIS-OSGeo4W-*-Setup-x86_64.exe"
) and
file.path : ("?:\\Program Files\\QGIS *\\apps\\grass\\*.exe", "\\Device\\HarddiskVolume*\\Program Files\\QGIS *\\apps\\grass\\*.exe")
) and
not process.executable :
("C:\\Program Files\\dotnet\\dotnet.exe",
"C:\\Program Files\\Microsoft Visual Studio\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files\\dotnet\\dotnet.exe",
"\\Device\\HarddiskVolume*\\Program Files\\Microsoft Visual Studio\\*.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 Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""
[[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.007"
name = "Double File Extension"
reference = "https://attack.mitre.org/techniques/T1036/007/"
[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 = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type == "creation" and file.extension : "exe" and
file.name regex~ """.*\.(vbs|vbe|bat|js|cmd|wsh|ps1|pdf|docx?|xlsx?|pptx?|txt|rtf|gif|jpg|png|bmp|hta|txt|img|iso)\.exe""" and
not (
process.executable : (
"?:\\Windows\\System32\\msiexec.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe",
"*\\Users\\*\\QGIS_SCCM\\Files\\QGIS-OSGeo4W-*-Setup-x86_64.exe"
) and
file.path : ("?:\\Program Files\\QGIS *\\apps\\grass\\*.exe", "\\Device\\HarddiskVolume*\\Program Files\\QGIS *\\apps\\grass\\*.exe")
) and
not process.executable :
("C:\\Program Files\\dotnet\\dotnet.exe",
"C:\\Program Files\\Microsoft Visual Studio\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files\\dotnet\\dotnet.exe",
"\\Device\\HarddiskVolume*\\Program Files\\Microsoft Visual Studio\\*.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"creation" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard value:"exe" |
file.name | regex_match |
| field:"file.name" kind:regex_match value:".*.(vbs|vbe|bat|js|cmd|wsh|ps1|pdf|docx?|xlsx?|pptx?|txt|rtf|gif|jpg|png|bmp|hta|txt|img|iso).exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.path | wildcard | ?:\Program Files\QGIS *\apps\grass\*.exe, \Device\HarddiskVolume*\Program Files\QGIS *\apps\grass\*.exe | excludes:file.path field:"file.path" value:"?:\Program Files\QGIS *\apps\grass\*.exe" field:"file.path" value:"\Device\HarddiskVolume*\Program Files\QGIS *\apps\grass\*.exe" |
process.executable | wildcard | ?:\Windows\System32\msiexec.exe, \Device\HarddiskVolume*\Windows\System32\msiexec.exe, *\Users\*\QGIS_SCCM\Files\QGIS-OSGeo4W-*-Setup-x86_64.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\msiexec.exe" field:"process.executable" value:"\Device\HarddiskVolume*\Windows\System32\msiexec.exe" field:"process.executable" value:"*\Users\*\QGIS_SCCM\Files\QGIS-OSGeo4W-*-Setup-x86_64.exe" |
process.executable | wildcard | C:\Program Files\dotnet\dotnet.exe, C:\Program Files\Microsoft Visual Studio\*.exe, \Device\HarddiskVolume*\Program Files\dotnet\dotnet.exe, \Device\HarddiskVolume*\Program Files\Microsoft Visual Studio\*.exe | excludes:process.executable |
GCP Pub/Sub Topic Creation
#Identifies the creation of a topic in Google Cloud Platform (GCP). In GCP, the publisher-subscriber relationship (Pub/Sub) is an asynchronous messaging service that decouples event-producing and event-processing services. A topic is used to forward messages from publishers to subscribers.
Known False Positives
- Topic creations may be done by a system or network administrator. Verify whether the user email, resource name, and/or hostname should be making changes in your environment. Topic creations by unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Collection |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| GCP | google.pubsub.Publisher.CreateTopic: Create topic |
Rule Body
[metadata]
creation_date = "2020/09/23"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies the creation of a topic in Google Cloud Platform (GCP). In GCP, the publisher-subscriber relationship
(Pub/Sub) is an asynchronous messaging service that decouples event-producing and event-processing services. A topic is
used to forward messages from publishers to subscribers.
"""
false_positives = [
"""
Topic creations may be done by a system or network administrator. Verify whether the user email, resource name,
and/or hostname should be making changes in your environment. Topic creations by unfamiliar users or hosts should be
investigated. If known behavior is causing false positives, it can be exempted from the rule.
""",
]
index = ["filebeat-*", "logs-gcp*"]
language = "kuery"
license = "Elastic License v2"
name = "GCP Pub/Sub Topic 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 GCP Pub/Sub Topic Creation
Google Cloud Pub/Sub is a messaging service that enables asynchronous communication between independent applications. It uses topics to route messages from publishers to subscribers. Adversaries might exploit this by creating unauthorized topics to exfiltrate data or disrupt services. The detection rule monitors successful topic creation events, helping identify potential misuse by flagging unexpected or suspicious activity.
### Possible investigation steps
- Review the event details to confirm the presence of the event.action field with the value google.pubsub.v*.Publisher.CreateTopic and ensure the event.outcome is success.
- Identify the user or service account associated with the topic creation by examining the actor information in the event logs.
- Check the project and resource details to determine the context and environment where the topic was created, including the project ID and resource name.
- Investigate the purpose and necessity of the newly created topic by consulting with relevant stakeholders or reviewing documentation related to the project.
- Analyze historical logs to identify any unusual patterns or anomalies in topic creation activities by the same user or within the same project.
- Assess the permissions and roles assigned to the user or service account to ensure they align with the principle of least privilege.
- If suspicious activity is confirmed, consider implementing additional monitoring or access controls to prevent unauthorized topic creation in the future.
### False positive analysis
- Routine topic creation by automated processes or scripts can trigger false positives. Identify and document these processes to create exceptions in the monitoring system.
- Development and testing environments often involve frequent topic creation. Exclude these environments from alerts by using environment-specific tags or labels.
- Scheduled maintenance or updates by cloud administrators may result in legitimate topic creation. Coordinate with the operations team to whitelist these activities during known maintenance windows.
- Third-party integrations or services that rely on Pub/Sub for communication might create topics as part of their normal operation. Review and approve these integrations to prevent unnecessary alerts.
- Internal applications with dynamic topic creation as part of their workflow should be assessed and, if deemed non-threatening, added to an exception list to reduce noise.
### Response and remediation
- Immediately review the audit logs to confirm the unauthorized creation of the Pub/Sub topic and identify the user or service account responsible for the action.
- Revoke or limit permissions for the identified user or service account to prevent further unauthorized actions, ensuring that only necessary permissions are granted.
- Delete the unauthorized Pub/Sub topic to prevent any potential data exfiltration or disruption of services.
- Conduct a thorough review of other Pub/Sub topics and related resources to ensure no additional unauthorized topics have been created.
- Notify the security team and relevant stakeholders about the incident for further investigation and to assess potential impacts on the organization.
- Implement additional monitoring and alerting for Pub/Sub topic creation events to detect and respond to similar threats more quickly in the future.
- Consider enabling organization-wide policies that restrict who can create Pub/Sub topics to reduce the risk of unauthorized actions.
## Setup
The GCP Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = ["https://cloud.google.com/pubsub/docs/admin"]
risk_score = 21
rule_id = "a10d3d9d-0f65-48f1-8b25-af175e2594f5"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: GCP",
"Data Source: Google Cloud Platform",
"Use Case: Log Auditing",
"Tactic: Collection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:gcp.audit and event.action:google.pubsub.v*.Publisher.CreateTopic and event.outcome:success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1651"
name = "Cloud Administration Command"
reference = "https://attack.mitre.org/techniques/T1651/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: query
data_stream.dataset:gcp.audit and event.action:google.pubsub.v*.Publisher.CreateTopic and event.outcome:success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"gcp.audit" |
event.action | wildcard |
| field:"EventType" kind:wildcard value:"google.pubsub.v*.Publisher.CreateTopic" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
Inhibit System Recovery via Windows Command Shell
#Identifies the execution of Windows utilities to tamper with system recovery settings. Adversaries may delete or remove built-in operating system data and turn off services designed to aid in the recovery of a corrupted system and prevent recovery.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = """
Identifies the execution of Windows utilities to tamper with system recovery settings. Adversaries may delete or remove
built-in operating system data and turn off services designed to aid in the recovery of a corrupted system and prevent
recovery.
"""
id = "d3588fad-43ae-4f2d-badd-15a27df72133"
license = "Elastic License v2"
name = "Inhibit System Recovery via Windows Command Shell"
os_list = ["windows"]
version = "1.0.34"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and process.name : "cmd.exe" and
not process.parent.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
not (process.args : "\\\\*\\SysVol\\*\\Policies\\{*}\\*" and process.parent.executable : "?:\\Windows\\System32\\gpscript.exe") and
not process.command_line : ("*\\\\*\\*.cmd*", "*\\\\*\\*.bat*") and
not descendant of [process where event.action == "start" and process.executable : "?:\\Windows\\System32\\gpscript.exe"] and
not (process.parent.executable : "?:\\Windows\\System32\\wbem\\WmiPrvSE.exe" and
user.id == "S-1-5-18" and process.args : "BOOTSTATUSPOLICY") and
not (user.id == "S-1-5-18" and process.parent.executable : ("C:\\$VcmsTemp$\\VcmsPush.exe", "C:\\windows\\ctsrsvc.exe"))
] by process.entity_id
[process where event.action == "start" and
(
(process.pe.original_file_name : "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
(process.pe.original_file_name : "vssadmin.exe" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*401*")) or
(process.pe.original_file_name : "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
(process.pe.original_file_name : "wbadmin.exe" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*")
) and
/* noisy FP patterns */
not (process.name : "bcdedit.exe" and process.args : "DisplayAllFailures") and
not (process.name : "wbadmin.exe" and process.args : "-keepVersions*") and
not (process.name : "bcdedit.exe" and process.command_line: "*recoveryenabled*yes*") and
/* granular deletion of a shadowcopy by unique ID often seen in legit deletion */
not (process.name : "vssadmin.exe" and process.command_line : "*/shadow=*")
] by process.parent.entity_id
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[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 = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1490"
name = "Inhibit System Recovery"
reference = "https://attack.mitre.org/techniques/T1490/"
[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and process.name : "cmd.exe" and
not process.parent.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
not (process.args : "\\\\*\\SysVol\\*\\Policies\\{*}\\*" and process.parent.executable : "?:\\Windows\\System32\\gpscript.exe") and
not process.command_line : ("*\\\\*\\*.cmd*", "*\\\\*\\*.bat*") and
not descendant of [process where event.action == "start" and process.executable : "?:\\Windows\\System32\\gpscript.exe"] and
not (process.parent.executable : "?:\\Windows\\System32\\wbem\\WmiPrvSE.exe" and
user.id == "S-1-5-18" and process.args : "BOOTSTATUSPOLICY") and
not (user.id == "S-1-5-18" and process.parent.executable : ("C:\\$VcmsTemp$\\VcmsPush.exe", "C:\\windows\\ctsrsvc.exe"))
] by process.entity_id
Stage 2: process
[process where event.action == "start" and
(
(process.pe.original_file_name : "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
(process.pe.original_file_name : "vssadmin.exe" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*401*")) or
(process.pe.original_file_name : "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
(process.pe.original_file_name : "wbadmin.exe" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*")
) and
not (process.name : "bcdedit.exe" and process.args : "DisplayAllFailures") and
not (process.name : "wbadmin.exe" and process.args : "-keepVersions*") and
not (process.name : "bcdedit.exe" and process.command_line: "*recoveryenabled*yes*") and
not (process.name : "vssadmin.exe" and process.command_line : "*/shadow=*")
] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"cmd.exe" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
LSASS Process Access via Windows API
#Identifies access attempts to the LSASS handle, which may indicate an attempt to dump credentials from LSASS memory.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Credential Access |
Rule Body
[metadata]
creation_date = "2023/03/02"
integration = ["endpoint", "m365_defender"]
maturity = "production"
updated_date = "2026/05/12"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"
[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""
[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""
[rule]
author = ["Elastic"]
description = "Identifies access attempts to the LSASS handle, which may indicate an attempt to dump credentials from LSASS memory."
from = "now-30m"
interval = "15m"
language = "esql"
license = "Elastic License v2"
name = "LSASS Process Access via Windows API"
note = """## Triage and analysis
### Investigating LSASS Process Access via Windows API
The Local Security Authority Subsystem Service (LSASS) is a critical Windows component responsible for managing user authentication and security policies. Adversaries may attempt to access the LSASS handle to dump credentials from its memory, which can be used for lateral movement and privilege escalation.
This rule identifies attempts to access LSASS by monitoring for specific API calls (OpenProcess, OpenThread) targeting the "lsass.exe" process.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
### Possible investigation steps
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate the process execution chain (parent process tree) of the process that accessed the LSASS handle.
- Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Determine the first time the process executable was seen in the environment and if this behavior happened in the past.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Investigate any abnormal behavior by the subject process, such as network connections, DLLs loaded, registry or file modifications, and any spawned child processes.
- Assess the access rights (`process.Ext.api.parameters.desired_access`field) requested by the process. This [Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights) may be useful to help the interpretation.
- If there are traces of LSASS memory being successfully dumped, investigate potentially compromised accounts. Analysts can do this by searching for login events (e.g., 4624) to the target host.
- Examine the host for derived artifacts that indicate suspicious activities:
- Analyze the executables of the processes using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process's `process.entity_id`.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
### False positive analysis
- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of `process.executable`, `process.code_signature.subject_name` and `process.Ext.api.parameters.desired_access_numeric` conditions.
### Related Rules
- Suspicious Lsass Process Access - 128468bf-cab1-4637-99ea-fdf3780a4609
- Potential Credential Access via DuplicateHandle in LSASS - 02a4576a-7480-4284-9327-548a806b5e48
- LSASS Memory Dump Handle Access - 208dbe77-01ed-4954-8d44-1e5751cb20de
### 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.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- 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.
- Reimage the host operating system or restore the compromised files to clean versions.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
"""
references = ["https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1003.001/T1003.001.md"]
risk_score = 47
rule_id = "ff4599cb-409f-4910-a239-52e4e6f532ff"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Data Source: Microsoft Defender XDR",
"Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-endpoint.events.api-*, logs-m365_defender.event-* metadata _id, _version, _index
| where event.category == "api" and host.os.family == "windows" and
process.Ext.api.name in ("OpenProcess", "OpenThread", "ReadProcessMemory") and
Target.process.name == "lsass.exe" and process.executable is not null and
// Noisy patterns
not to_lower(process.executable) like """c:\\program files\\*.exe""" and
not to_lower(process.executable) like """c:\\program files (x86)\\*.exe""" and
not to_lower(process.executable) like """c:\\programdata\\microsoft\\windows defender\\platform\\msmpeng.exe""" and
not to_lower(process.executable) like """c:\\programdata\\microsoft\\windows defender\\platform\\*\\msmpeng.exe"""
/* normalize process paths to reduce known random patterns in process.executable */
| eval Esql.process_path = replace(process.executable, """([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|ns[a-z][A-Z0-9]{3,4}\.tmp|DX[A-Z0-9]{3,4}\.tmp|7z[A-Z0-9]{3,5}\.tmp|[0-9\.\-\_]{3,})""", "")
// Group by process path
| stats Esql.access_count = count(*),
Esql.count_distinct_hosts = count_distinct(host.id),
Esql.host_id_values = VALUES(host.id),
Esql.host_name_values = VALUES(host.name),
Esql.user_name_values = VALUES(user.name),
Esql.process_pid_values = VALUES(process.entity_id),
Esql.process_executable_values = VALUES(process.executable),
Esql.data_stream_namespace.values = VALUES(data_stream.namespace),
Esql.user_name_values = VALUES(user.name) by Esql.process_path
// Limit to rare instances limited to 1 unique host
| where Esql.count_distinct_hosts == 1 and Esql.access_count <= 3
// Extract the single host ID and process into their corresponding ECS fields for alerts exclusion
| eval host.id = mv_min(Esql.host_id_values),
host.name = mv_min(Esql.host_name_values),
process.executable = mv_min(Esql.process_executable_values),
user.name = mv_min(Esql.user_name_values)
// Add the new field to the keep statement
| keep Esql.*, host.id, host.name, user.name, process.executable
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: from
from logs-endpoint.events.api-*, logs-m365_defender.event-* metadata _id, _version, _index
Stage 2: where
| where event.category == "api" and host.os.family == "windows" and
process.Ext.api.name in ("OpenProcess", "OpenThread", "ReadProcessMemory") and
Target.process.name == "lsass.exe" and process.executable is not null and
not to_lower(process.executable) like """c:\\program files\\*.exe""" and
not to_lower(process.executable) like """c:\\program files (x86)\\*.exe""" and
not to_lower(process.executable) like """c:\\programdata\\microsoft\\windows defender\\platform\\msmpeng.exe""" and
not to_lower(process.executable) like """c:\\programdata\\microsoft\\windows defender\\platform\\*\\msmpeng.exe"""
Stage 3: eval
| eval Esql.process_path = replace(process.executable, """([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|ns[a-z][A-Z0-9]{3,4}\.tmp|DX[A-Z0-9]{3,4}\.tmp|7z[A-Z0-9]{3,5}\.tmp|[0-9\.\-\_]{3,})""", "")
Stage 4: stats
| stats Esql.access_count = count(*),
Esql.count_distinct_hosts = count_distinct(host.id),
Esql.host_id_values = VALUES(host.id),
Esql.host_name_values = VALUES(host.name),
Esql.user_name_values = VALUES(user.name),
Esql.process_pid_values = VALUES(process.entity_id),
Esql.process_executable_values = VALUES(process.executable),
Esql.data_stream_namespace.values = VALUES(data_stream.namespace),
Esql.user_name_values = VALUES(user.name) by Esql.process_path
Stage 5: where
| where Esql.count_distinct_hosts == 1 and Esql.access_count <= 3
Stage 6: eval
| eval host.id = mv_min(Esql.host_id_values),
host.name = mv_min(Esql.host_name_values),
process.executable = mv_min(Esql.process_executable_values),
user.name = mv_min(Esql.user_name_values)
Stage 7: keep
| keep Esql.*, host.id, host.name, user.name, process.executable
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.* | KEEP Esql.* |
host.id | KEEP host.id |
host.name | KEEP host.name |
user.name | KEEP user.name |
process.executable | KEEP process.executable |
M365 OneDrive/SharePoint Excessive File Downloads
#Identifies when an excessive number of files are downloaded from OneDrive or SharePoint by an authorized user or application in a short period of time. This may indicate a potential data exfiltration event, especially if the downloads are performed using OAuth authentication which could suggest an OAuth phishing attack such as Device Code Authentication phishing.
Known False Positives
- Legitimate users may download files from OneDrive using OAuth authentication. Ensure that the downloads are authorized and the user is known before taking action.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection | |
| Exfiltration |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | FileDownloaded |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2025/02/19"
integration = ["o365"]
maturity = "production"
updated_date = "2026/09/09"
[rule]
author = ["Elastic"]
description = """
Identifies when an excessive number of files are downloaded from OneDrive or SharePoint by an authorized user or application in a short period of time. This may indicate a potential data exfiltration event, especially if the downloads are performed using OAuth authentication which could suggest an OAuth phishing attack such as Device Code Authentication phishing.
"""
false_positives = [
"""
Legitimate users may download files from OneDrive using OAuth authentication. Ensure that the downloads are
authorized and the user is known before taking action.
""",
]
from = "now-9m"
interval = "8m"
language = "esql"
license = "Elastic License v2"
name = "M365 OneDrive/SharePoint Excessive File Downloads"
note = """## Triage and Analysis
### Investigating M365 OneDrive/SharePoint Excessive File Downloads
This rule detects an excessive number of files downloaded from OneDrive using OAuth authentication. Threat actors may use OAuth phishing attacks, such as **Device Code Authentication phishing**, to obtain valid access tokens and perform unauthorized data exfiltration. This method allows adversaries to bypass traditional authentication mechanisms, making it a stealthy and effective technique.
This rule leverages ESQL aggregations which limit the field values available in the alert document. To investigate further, it is recommended to identify the original documents ingested.
#### Possible Investigation Steps
- Review the user ID field to identify the user who performed the downloads. Check if this user typically downloads large amounts of data from OneDrive.
- Correlate user ID with Entra Sign-In logs to verify the authentication method used and determine if it was expected for this user.
- Review the authentication method used. If OAuth authentication was used, investigate whether it was expected for this user.
- Identify the client application used for authentication. Determine if it is a legitimate enterprise-approved app or an unauthorized third-party application.
- Check the number of unique files downloaded. If a user downloads a high volume of unique files in a short period, it may indicate data exfiltration.
- Analyze the file types and directories accessed to determine if sensitive or confidential data was involved.
- Investigate the source IP address and geolocation of the download activity. If it originates from an unusual or anonymized location, further scrutiny is needed.
- Review other recent activities from the same user, such as file access, sharing, or permission changes, that may indicate further compromise.
- Check for signs of session persistence using OAuth. If Azure sign-in logs are correlated where `authentication_protocol` or `originalTransferMethod` field shows `deviceCode`, the session was established through device code authentication.
- Look for multiple authentication attempts from different devices or locations within a short timeframe, which could indicate unauthorized access.
- Investigate if other OAuth-related anomalies exist, such as consent grants for unfamiliar applications or unexpected refresh token activity.
- Review the `file.directory` value from the original documents to identify the specific folders or paths where the files were downloaded.
- Examine if the downloaded files are from Sharepoint or OneDrive by checking the `event.code` field.
- Review the incoming token type to determine how authentication occurred. If the `token.id` field is populated, it indicates that OAuth authentication was used, which may suggest an OAuth phishing attack.
### False Positive Analysis
- Verify if the user regularly downloads large batches of files as part of their job function.
- Determine if the downloads were triggered by an authorized automated process, such as a data backup or synchronization tool.
- Confirm if the detected OAuth application is approved for enterprise use and aligns with expected usage patterns.
### Response and Remediation
- If unauthorized activity is confirmed, revoke the OAuth token used and terminate active OneDrive sessions.
- Reset the affected user's password and require reauthentication to prevent continued unauthorized access.
- Restrict OAuth app permissions and enforce conditional access policies to limit authentication to trusted devices and applications.
- Monitor for additional signs of compromise, such as unusual email forwarding rules, external sharing of OneDrive files, or privilege escalation attempts.
- Educate users on OAuth phishing risks and encourage the use of **Microsoft Defender for Office 365 Safe Links** to mitigate credential-based attacks.
- Enable continuous monitoring for OAuth authentication anomalies using **Microsoft Entra ID sign-in logs** and security tools.
"""
references = [
"https://www.volexity.com/blog/2025/02/13/multiple-russian-threat-actors-targeting-microsoft-device-code-authentication/",
"https://cloud.google.com/blog/topics/threat-intelligence/expansion-shinyhunters-saas-data-theft",
]
risk_score = 47
rule_id = "0e524fa6-eed3-11ef-82b4-f661ea17fbce"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: SaaS",
"Domain: Storage",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Data Source: SharePoint",
"Data Source: OneDrive",
"Use Case: Threat Detection",
"Tactic: Collection",
"Tactic: Exfiltration",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-o365.audit-* metadata _id, _version, _index
| where
data_stream.dataset == "o365.audit" and
event.provider == "OneDrive" and
event.action == "FileDownloaded" and
event.outcome == "success"
and (user.id is not null and o365.audit.ApplicationId is not null)
and o365.audit.ApplicationId not in (
"08e18876-6177-487e-b8b5-cf950c1e598c", // SharePoint Online Web Client Extensibility
"fb8d773d-7ef8-4ec0-a117-179f88add510", // Enterprise Copilot Platform
"d3590ed6-52b3-4102-aeff-aad2292ab01c", // Microsoft Office
"7ab7862c-4c57-491e-8a45-d52a7e023983" // App Service
)
| eval session.id = coalesce(o365.audit.AppAccessContext.AADSessionId, session.id, null)
| where session.id is not null
| eval Esql.time_window_date_trunc = date_trunc(3 minutes, @timestamp)
// file.size is dynamically mapped in o365.audit and can be keyword or long across backing indices
| eval Esql.file_size_bytes = to_long(file.size)
| stats
Esql.file_directory_values = values(file.directory),
Esql.file_extension_values = values(file.extension),
Esql.application_name_values = values(application.name),
Esql.file_name_count_distinct = count_distinct(file.name),
Esql.total_file_size_mb = round((mv_sum(values(Esql.file_size_bytes))) / 1048576.0, 2),
Esql.o365_audit_Site_values = values(o365.audit.Site),
Esql.o365_audit_SiteUrl_values = values(o365.audit.SiteUrl),
Esql.user_domain_values = values(user.domain),
Esql.token_id_values = values(token.id),
Esql.event_code_values = values(event.code),
Esql.event_provider_values = values(event.provider),
Esql.auth_type_values = values(o365.audit.AuthenticationType),
Esql.is_managed_device_values = values(o365.audit.IsManagedDevice),
Esql.platform_values = values(o365.audit.Platform),
Esql.user_agent_values = values(user_agent.name),
Esql.source_asn_org_values = values(source.as.organization.name),
Esql.geo_country_values = values(source.geo.country_name),
Esql.event_count = count(*)
by
Esql.time_window_date_trunc,
user.id,
session.id,
source.ip,
o365.audit.ApplicationId
| where Esql.file_name_count_distinct >= 25
| keep
Esql.*,
user.id,
source.ip,
o365.audit.ApplicationId,
session.id
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1020"
name = "Automated Exfiltration"
reference = "https://attack.mitre.org/techniques/T1020/"
[[rule.threat.technique]]
id = "T1567"
name = "Exfiltration Over Web Service"
reference = "https://attack.mitre.org/techniques/T1567/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
Stages and Predicates
Stage 1: from
from logs-o365.audit-* metadata _id, _version, _index
Stage 2: where
| where
data_stream.dataset == "o365.audit" and
event.provider == "OneDrive" and
event.action == "FileDownloaded" and
event.outcome == "success"
and (user.id is not null and o365.audit.ApplicationId is not null)
and o365.audit.ApplicationId not in (
"08e18876-6177-487e-b8b5-cf950c1e598c",
"fb8d773d-7ef8-4ec0-a117-179f88add510",
"d3590ed6-52b3-4102-aeff-aad2292ab01c",
"7ab7862c-4c57-491e-8a45-d52a7e023983"
)
Stage 3: eval
| eval session.id = coalesce(o365.audit.AppAccessContext.AADSessionId, session.id, null)
Stage 4: where
| where session.id is not null
Stage 5: eval
| eval Esql.time_window_date_trunc = date_trunc(3 minutes, @timestamp)
Stage 6: eval
| eval Esql.file_size_bytes = to_long(file.size)
Stage 7: stats
| stats
Esql.file_directory_values = values(file.directory),
Esql.file_extension_values = values(file.extension),
Esql.application_name_values = values(application.name),
Esql.file_name_count_distinct = count_distinct(file.name),
Esql.total_file_size_mb = round((mv_sum(values(Esql.file_size_bytes))) / 1048576.0, 2),
Esql.o365_audit_Site_values = values(o365.audit.Site),
Esql.o365_audit_SiteUrl_values = values(o365.audit.SiteUrl),
Esql.user_domain_values = values(user.domain),
Esql.token_id_values = values(token.id),
Esql.event_code_values = values(event.code),
Esql.event_provider_values = values(event.provider),
Esql.auth_type_values = values(o365.audit.AuthenticationType),
Esql.is_managed_device_values = values(o365.audit.IsManagedDevice),
Esql.platform_values = values(o365.audit.Platform),
Esql.user_agent_values = values(user_agent.name),
Esql.source_asn_org_values = values(source.as.organization.name),
Esql.geo_country_values = values(source.geo.country_name),
Esql.event_count = count(*)
by
Esql.time_window_date_trunc,
user.id,
session.id,
source.ip,
o365.audit.ApplicationId
Stage 8: where
| where Esql.file_name_count_distinct >= 25
Stage 9: keep
| keep
Esql.*,
user.id,
source.ip,
o365.audit.ApplicationId,
session.id
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
o365.audit.ApplicationId | in | 08e18876-6177-487e-b8b5-cf950c1e598c, 7ab7862c-4c57-491e-8a45-d52a7e023983, d3590ed6-52b3-4102-aeff-aad2292ab01c, fb8d773d-7ef8-4ec0-a117-179f88add510 | excludes:o365.audit.ApplicationId |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.* | KEEP Esql.* |
user.id | KEEP user.id |
source.ip | KEEP source.ip |
o365.audit.ApplicationId | KEEP o365.audit.ApplicationId |
session.id | KEEP session.id |
Masquerading Space After Filename
#This rules identifies a process created from an executable with a space appended to the end of the filename. This may indicate an attempt to masquerade a malicious file as benign to gain user execution. When a space is added to the end of certain files, the OS will execute the file according to it's true filetype instead of it's extension. Adversaries can hide a program's true filetype by changing the extension of the file. They can then add a space to the end of the name so that the OS automatically executes the file when it's double-clicked.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[metadata]
creation_date = "2022/10/18"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rules identifies a process created from an executable with a space appended to the end of the filename. This may
indicate an attempt to masquerade a malicious file as benign to gain user execution. When a space is added to the end of
certain files, the OS will execute the file according to it's true filetype instead of it's extension. Adversaries can
hide a program's true filetype by changing the extension of the file. They can then add a space to the end of the name
so that the OS automatically executes the file when it's double-clicked.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Masquerading Space After Filename"
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 Masquerading Space After Filename
In Linux and macOS environments, file execution is determined by the file's true type rather than its extension. Adversaries exploit this by appending a space to filenames, misleading users into executing malicious files disguised as benign. The detection rule identifies such anomalies by monitoring process creation events with filenames ending in a space, excluding known safe processes and paths, thus highlighting potential masquerading attempts.
### Possible investigation steps
- Review the process creation event details to identify the full path and name of the executable with a space appended. This can help determine if the file is located in a suspicious or unusual directory.
- Check the process.parent.args field to understand the parent process that initiated the execution. This can provide context on whether the execution was part of a legitimate process chain or potentially malicious activity.
- Investigate the user account associated with the process creation event to determine if the account has a history of executing similar files or if it has been compromised.
- Examine the file's true type and hash to verify its legitimacy and check against known malicious file databases or threat intelligence sources.
- Look for any additional process events or network activity associated with the suspicious executable to identify potential lateral movement or data exfiltration attempts.
- Cross-reference the event with any recent alerts or incidents involving the same host or user to identify patterns or ongoing threats.
### False positive analysis
- Processes like "ls", "find", "grep", and "xkbcomp" are known to be safe and can be excluded from triggering the rule by adding them to the exception list.
- Executables located in directories such as "/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", and "/tmp/ansible-admin/*" are typically non-threatening and should be excluded to prevent false positives.
- Parent processes with arguments like "./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", and "/etc/rubrik/start_stop_agent.sh" are generally safe and can be added to the exclusion list to avoid unnecessary alerts.
- Regularly review and update the exception list to ensure that only verified safe processes and paths are excluded, maintaining the effectiveness of the detection rule.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further execution or spread of the potentially malicious file.
- Terminate any suspicious processes identified by the detection rule to halt any ongoing malicious activity.
- Conduct a forensic analysis of the file with the appended space to determine its true file type and origin, using tools like file command or hex editors.
- Remove the malicious file from the system and any other locations it may have been copied to, ensuring complete eradication.
- Review and update endpoint protection settings to block execution of files with suspicious naming conventions, such as those ending with a space.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess potential impacts on other systems.
- Implement additional monitoring for similar masquerading attempts by enhancing logging and alerting mechanisms to detect files with unusual naming patterns."""
references = [
"https://www.picussecurity.com/resource/blog/picus-10-critical-mitre-attck-techniques-t1036-masquerading",
]
risk_score = 47
rule_id = "f5fb4598-4f10-11ed-bdc3-0242ac120002"
setup = """## Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
`event.ingested` to @timestamp.
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type:("linux","macos") and event.type == "start" and
process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""" and not (
process.name in ("ls", "find", "grep", "xkbcomp") or
process.executable like ("/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", "/tmp/ansible-admin/*") or
process.parent.args in (
"./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", "/etc/rubrik/start_stop_agent.sh"
) or
process.args == "runc"
)
'''
[[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.006"
name = "Space after Filename"
reference = "https://attack.mitre.org/techniques/T1036/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 = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type:("linux","macos") and event.type == "start" and
process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""" and not (
process.name in ("ls", "find", "grep", "xkbcomp") or
process.executable like ("/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", "/tmp/ansible-admin/*") or
process.parent.args in (
"./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", "/etc/rubrik/start_stop_agent.sh"
) or
process.args == "runc"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.executable | regex_match |
| field:"Image" kind:regex_match value:"/[a-z0-9\s_\-\./]+\s" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | runc | excludes:process.args field:"process.args" value:"runc" |
process.executable | starts_with | /opt/nessus_agent/, /opt/gitlab/sv/gitlab-exporter/, /tmp/ansible-admin/ | excludes:process.executable field:"process.executable" value:"/opt/nessus_agent/" field:"process.executable" value:"/opt/gitlab/sv/gitlab-exporter/" field:"process.executable" value:"/tmp/ansible-admin/" |
process.name | in | find, grep, ls, xkbcomp | excludes:process.name |
process.parent.args | in | ./check_rubrik, /etc/rubrik/start_stop_agent.sh, /etc/rubrik/start_stop_bootstrap.sh, /usr/bin/check_mk_agent | excludes:process.parent.args |
Modification of Environment Variable via Unsigned or Untrusted Parent
#Identifies modifications to an environment variable using the built-in launchctl command. Adversaries may execute their own malicious payloads by hijacking certain environment variables to load arbitrary libraries or bypass certain restrictions.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2021/01/14"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Identifies modifications to an environment variable using the built-in launchctl command. Adversaries may execute their
own malicious payloads by hijacking certain environment variables to load arbitrary libraries or bypass certain
restrictions.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "eql"
license = "Elastic License v2"
name = "Modification of Environment Variable via Unsigned or Untrusted Parent"
references = [
"https://github.com/rapid7/metasploit-framework/blob/master//modules/post/osx/escalate/tccbypass.rb",
]
risk_score = 47
rule_id = "7453e19e-3dbf-4e4e-9ae0-33d6c6ed15e1"
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 = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "macos" and event.type in ("start", "process_started") and
process.name == "launchctl" and
(process.parent.code_signature.exists == false or process.parent.code_signature.trusted == false) and
process.args == "setenv"
'''
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 Environment Variable via Unsigned or Untrusted Parent
Environment variables in macOS are crucial for configuring system and application behavior. Adversaries may exploit these by using the `launchctl` command to alter variables, enabling malicious payload execution or bypassing restrictions. The detection rule identifies suspicious modifications initiated by untrusted or unsigned parent processes, focusing on atypical environment variables and excluding known safe executables, thus highlighting potential threats.
### Possible investigation steps
- Review the process tree to identify the parent process of the `launchctl` command, focusing on whether the parent process is unsigned or untrusted, as indicated by the absence or lack of trust in the `process.parent.code_signature`.
- Examine the command-line arguments used with `launchctl`, specifically looking for the `setenv` command and any unusual or suspicious environment variables that are not part of the known safe list (e.g., ANT_HOME, DBUS_LAUNCHD_SESSION_BUS_SOCKET).
- Check the execution path of the parent process to determine if it matches any known safe executables, such as those listed in the exclusion criteria (e.g., /Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home/lib/jspawnhelper).
- Investigate the user account under which the `launchctl` command was executed to determine if it aligns with expected behavior or if it might indicate a compromised account.
- Correlate this event with other security alerts or logs from the same host to identify any patterns or additional indicators of compromise that might suggest a broader attack or intrusion attempt.
### False positive analysis
- Development tools like IntelliJ IDEA may trigger false positives when using the jspawnhelper executable. To mitigate this, add the executable path to the exclusion list if it is a known and trusted application in your environment.
- NoMachine software can cause false positives due to its use of nxserver.bin. If this software is regularly used and trusted, consider excluding its executable path from the detection rule.
- The kr tool located at /usr/local/bin/kr might be flagged as a false positive. If this tool is part of your standard operations, ensure its path is excluded to prevent unnecessary alerts.
- Review any other unsigned or untrusted parent processes that are part of legitimate software installations or operations. If they are verified as safe, add them to the exclusion list to reduce false positives.
- Regularly update the list of known safe executables and environment variables to reflect changes in your software inventory, ensuring that legitimate processes are not mistakenly flagged.
### Response and remediation
- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or further exploitation.
- Terminate any suspicious processes associated with the untrusted or unsigned parent process that initiated the `launchctl` command to halt any ongoing malicious activity.
- Conduct a thorough review of the environment variables modified by the `launchctl` command to identify any unauthorized changes and revert them to their original state.
- Analyze the parent process that triggered the alert to determine its origin and purpose, and remove any malicious or unauthorized software identified during this analysis.
- Restore the system from a known good backup if any critical system components or configurations have been compromised.
- Implement additional monitoring and logging for `launchctl` usage and environment variable modifications to detect similar threats in the future.
- Escalate the incident to the security operations team for further investigation and to assess the need for broader organizational response measures."""
[[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.technique.subtechnique]]
id = "T1574.007"
name = "Path Interception by PATH Environment Variable"
reference = "https://attack.mitre.org/techniques/T1574/007/"
[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 == "macos" and event.type in ("start", "process_started") and
process.name == "launchctl" and
(process.parent.code_signature.exists == false or process.parent.code_signature.trusted == false) and
process.args == "setenv"
Indicators
These rows show field, operator, and value matches.
Network Connection to OAST Domain via Script Interpreter
#Detects when a package service such as npm, gems, or a script interpreter makes an outbound network connection to an OAST (Out-of-band Application Security Testing) domain. Threat actors have been using OAST domains to exfiltrate sensitive data from compromised systems via malicious packages.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Command & Control | |
| Exfiltration |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/01/30"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Detects when a package service such as npm, gems, or a script interpreter makes an outbound network connection
to an OAST (Out-of-band Application Security Testing) domain. Threat actors have been using OAST domains to
exfiltrate sensitive data from compromised systems via malicious packages.
"""
from = "now-9m"
index = ["logs-endpoint.events.network-*", "logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Network Connection to OAST Domain via Script Interpreter"
references = [
"https://socket.dev/blog/weaponizing-oast-how-malicious-packages-exploit-npm-pypi-and-rubygems"
]
risk_score = 73
rule_id = "54214c47-be7c-4f6b-8ef2-78832f9f8f42"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide"
]
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 Network Connection to OAST Domain via Script Interpreter
Out-of-Band Application Security Testing (OAST) services such as interact.sh, burpcollaborator.net, and similar platforms are designed for security testing to detect vulnerabilities through out-of-band data channels. However, threat actors abuse these same services for data exfiltration, command and control, and DNS-based exploitation. This detection rule identifies script interpreters or suspicious processes connecting to known OAST domains, which may indicate exploitation activity or unauthorized security testing.
### Possible investigation steps
- Verify with your security team whether authorized penetration testing or red team exercises are currently underway that would involve OAST services.
- Review the process.name and process.executable fields to identify which application initiated the OAST connection and determine if it is a known vulnerable application.
- Examine the dns.question.name field to capture the full OAST subdomain, as the subdomain often contains encoded data or unique identifiers used by attackers.
- Analyze the process.parent.executable and process.command_line to understand how the connecting process was spawned and identify the potential vulnerability being exploited.
- Check for any HTTP request or response data associated with the OAST connection to identify what data may have been exfiltrated.
- Investigate the user.name and host.name to determine the scope of affected systems and user accounts.
- Review web application logs and proxy data for injection attempts or exploitation activity that may have triggered the OAST callback.
### False positive analysis
- Authorized security researchers and penetration testers may use OAST services during sanctioned vulnerability assessments. Confirm testing windows with the security team before escalating.
- Bug bounty hunters testing your organization's applications may trigger OAST connections. Verify if bug bounty programs are active and expected.
- Security training or capture-the-flag exercises may involve OAST services for educational purposes. Confirm with training coordinators if such exercises are scheduled.
- Some commercial security scanning tools may use OAST-like services for vulnerability detection. Verify if automated security scanning is running.
### Response and remediation
- If unauthorized, immediately block the OAST domain at the network perimeter, DNS resolver, and proxy to prevent further communication.
- Isolate the affected system to prevent lateral movement or additional data exfiltration.
- Identify the vulnerable application or injection point that led to the OAST callback and apply emergency patches or mitigations.
- Review the OAST subdomain and any captured data to assess the scope of information exposure.
- Conduct a thorough code review of affected applications to identify and remediate the underlying vulnerability.
- Implement web application firewall rules to detect and block common injection patterns that lead to OAST exploitation.
- Escalate to the incident response team for further investigation if the activity indicates active exploitation or compromise.
"""
query = '''
sequence by process.entity_id with maxspan=1m
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
(process.name == "node" or process.name like ("python*", "ruby*", "perl*"))]
[network where host.os.type == "macos" and event.type == "start" and destination.domain like "*.oast*"]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1567"
name = "Exfiltration Over Web Service"
reference = "https://attack.mitre.org/techniques/T1567/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[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.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1195"
name = "Supply Chain Compromise"
reference = "https://attack.mitre.org/techniques/T1195/"
[[rule.threat.technique.subtechnique]]
id = "T1195.001"
name = "Compromise Software Dependencies and Development Tools"
reference = "https://attack.mitre.org/techniques/T1195/001/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
(process.name == "node" or process.name like ("python*", "ruby*", "perl*"))]
Stage 2: network
[network where host.os.type == "macos" and event.type == "start" and destination.domain like "*.oast*"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.domain | wildcard |
| field:"DestinationHostname" kind:wildcard value:"*.oast*" |
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | eq |
| field:"process_basename" kind:eq value:"node" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Potential Loadable Kernel Module Load via Memory File Descriptor
#This rule detects when a process creates a memory file descriptor using the memfd_create syscall followed by loading a loadable kernel module (LKM). This activity is often associated with advanced threat actors attempting to evade detection by avoiding writing files to disk. Such techniques are commonly used in fileless malware attacks and can indicate a potential compromise or malicious activity. Memory file descriptors are a powerful tool for attackers to execute code in memory and can be used to bypass traditional detection mechanisms.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Stealth |
Rule Body
[rule]
description = """
This rule detects when a process creates a memory file descriptor using the memfd_create syscall followed by loading a
loadable kernel module (LKM). This activity is often associated with advanced threat actors attempting to evade
detection by avoiding writing files to disk. Such techniques are commonly used in fileless malware attacks and can
indicate a potential compromise or malicious activity. Memory file descriptors are a powerful tool for attackers to
execute code in memory and can be used to bypass traditional detection mechanisms.
"""
id = "9e39e74f-2c65-41e9-9b80-8ca874b3d4d1"
license = "Elastic License v2"
name = "Potential Loadable Kernel Module Load via Memory File Descriptor"
os_list = ["linux"]
version = "1.0.4"
query = '''
sequence by process.entity_id with maxspan=5s
[process where event.type == "start" and event.action == "memfd_create" and
not (
process.executable == "/opt/eset/efs/lib/oaeventd" and
process.command_line == "/opt/eset/efs/lib/oaeventd" and
process.parent.executable == "/opt/eset/efs/sbin/startd"
)]
[process where event.type == "start" and event.action == "load_module"]
'''
min_endpoint_version = "9.1.4"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1106"
name = "Native API"
reference = "https://attack.mitre.org/techniques/T1106/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1014"
name = "Rootkit"
reference = "https://attack.mitre.org/techniques/T1014/"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique.subtechnique]]
id = "T1055.009"
name = "Proc Memory"
reference = "https://attack.mitre.org/techniques/T1055/009/"
[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "9.1.4"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "memfd_create" and
not (
process.executable == "/opt/eset/efs/lib/oaeventd" and
process.command_line == "/opt/eset/efs/lib/oaeventd" and
process.parent.executable == "/opt/eset/efs/sbin/startd"
)]
Stage 2: process
[process where event.type == "start" and event.action == "load_module"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | eq | /opt/eset/efs/lib/oaeventd | excludes:process.command_line field:"process.command_line" value:"/opt/eset/efs/lib/oaeventd" |
process.executable | eq | /opt/eset/efs/lib/oaeventd | excludes:process.executable field:"process.executable" value:"/opt/eset/efs/lib/oaeventd" |
process.parent.executable | eq | /opt/eset/efs/sbin/startd | excludes:process.parent.executable field:"process.parent.executable" value:"/opt/eset/efs/sbin/startd" |
Potential Masquerading as System Binary
#Detects the execution, by root, of a non-Apple binary passing the path to a System binary as command-line arguments. This activity has only been observed being used by malware in order to masquerade as the system process for the purpose of remaining hidden on the victim machine.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects the execution, by root, of a non-Apple binary passing the path to a System binary as command-line arguments.
This activity has only been observed being used by malware in order to masquerade as the system process for the purpose
of remaining hidden on the victim machine.
"""
id = "bb1de0c7-3504-4b31-8d3e-928aa3acf64f"
license = "Elastic License v2"
name = "Potential Masquerading as System Binary"
os_list = ["macos"]
reference = ["https://www.jamf.com/blog/cryptojacking-macos-malware-discovered-by-jamf-threat-labs"]
version = "1.0.19"
query = '''
process where event.type == "start" and event.action == "exec" and
process.args like "/System/*" and
process.parent.name in ("bash", "sh", "zsh") and
process.args_count == 1 and not
process.executable like ("/System/*", "/usr/libexec/*", "/usr/bin/*", "/usr/sbin/*", "/bin/*", "/sbin/*")
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.004"
name = "Masquerade Task or Service"
reference = "https://attack.mitre.org/techniques/T1036/004/"
[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: process
process where event.type == "start" and event.action == "exec" and
process.args like "/System/*" and
process.parent.name in ("bash", "sh", "zsh") and
process.args_count == 1 and not
process.executable like ("/System/*", "/usr/libexec/*", "/usr/bin/*", "/usr/sbin/*", "/bin/*", "/sbin/*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"/System/*" |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | starts_with | /System/, /usr/libexec/, /usr/bin/, /usr/sbin/, /bin/, /sbin/ | excludes:process.executable |
Potential Network Traffic Tunneling via Proxychains
#This rule identifies the use of proxychains to potentially tunnel network traffic. Attackers can leverage proxychains to establish hidden communication channels and gain unauthorized access to internal resources, facilitating data exfiltration or lateral movement via proxychains while evading direct connection blocking.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[rule]
description = """
This rule identifies the use of proxychains to potentially tunnel network traffic. Attackers can leverage proxychains to
establish hidden communication channels and gain unauthorized access to internal resources, facilitating data
exfiltration or lateral movement via proxychains while evading direct connection blocking.
"""
id = "4484d4b4-499f-4c8e-aa32-be7c0d66eb6c"
license = "Elastic License v2"
name = "Potential Network Traffic Tunneling via Proxychains"
os_list = ["linux"]
reference = [
"https://book.hacktricks.xyz/generic-methodologies-and-resources/tunneling-and-port-forwarding",
"https://github.com/haad/proxychains",
]
version = "1.0.1"
query = '''
process where event.type == "start" and event.action == "exec" and process.name in ("proxychains", "proxychains4", "proxyresolv")
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"
[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.name in ("proxychains", "proxychains4", "proxyresolv")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | in |
| field:"process_basename" kind:in |
Potential Persistence via Time Provider Modification
#Identifies modification of the Time Provider. Adversaries may establish persistence by registering and enabling a malicious DLL as a time provider. Windows uses the time provider architecture to obtain accurate time stamps from other network devices or clients in the network. Time providers are implemented in the form of a DLL file which resides in the System32 folder. The service W32Time initiates during the startup of Windows and loads w32time.dll.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2021/01/19"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"
[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""
[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""
[rule]
author = ["Elastic"]
description = """
Identifies modification of the Time Provider. Adversaries may establish persistence by registering and enabling a
malicious DLL as a time provider. Windows uses the time provider architecture to obtain accurate time stamps from other
network devices or clients in the network. Time providers are implemented in the form of a DLL file which resides in the
System32 folder. The service W32Time initiates during the startup of Windows and loads w32time.dll.
"""
from = "now-9m"
index = [
"logs-endpoint.events.registry-*",
"endgame-*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Persistence via Time Provider Modification"
note = """## Triage and analysis
### Investigating Potential Persistence via Time Provider Modification
The Time Provider architecture in Windows is responsible for obtaining accurate timestamps from network devices or clients. It is implemented as a DLL file in the System32 folder and is initiated by the W32Time service during Windows startup. Adversaries may exploit this by registering and enabling a malicious DLL as a time provider to establish persistence.
This rule identifies changes in the registry paths associated with Time Providers, specifically targeting the addition of new DLL files.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
### Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Examine whether the DLL is signed.
- Retrieve the DLL and determine if it is malicious:
- Analyze the file using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
### False positive analysis
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
### Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Restore Time Provider settings to the desired state.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
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)
"""
references = ["https://pentestlab.blog/2019/10/22/persistence-time-providers/"]
risk_score = 47
rule_id = "14ed1aa9-ebfd-4cf9-a463-0ac59ec55204"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Privilege Escalation",
"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.path: "*\\SYSTEM\\*ControlSet*\\Services\\W32Time\\TimeProviders\\*" and
registry.data.strings:"*.dll" and
not
(
process.executable : ("?:\\Windows\\System32\\msiexec.exe", "\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe") and
registry.data.strings : "?:\\Program Files\\VMware\\VMware Tools\\vmwTimeProvider\\vmwTimeProvider.dll"
) and
not registry.data.strings : "C:\\Windows\\SYSTEM32\\w32time.DLL"
'''
[[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.003"
name = "Time Providers"
reference = "https://attack.mitre.org/techniques/T1547/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[rule.threat.technique.subtechnique]]
id = "T1547.003"
name = "Time Providers"
reference = "https://attack.mitre.org/techniques/T1547/003/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: registry
registry where host.os.type == "windows" and event.type == "change" and
registry.path: "*\\SYSTEM\\*ControlSet*\\Services\\W32Time\\TimeProviders\\*" and
registry.data.strings:"*.dll" and
not
(
process.executable : ("?:\\Windows\\System32\\msiexec.exe", "\\Device\\HarddiskVolume*\\Windows\\System32\\msiexec.exe") and
registry.data.strings : "?:\\Program Files\\VMware\\VMware Tools\\vmwTimeProvider\\vmwTimeProvider.dll"
) and
not registry.data.strings : "C:\\Windows\\SYSTEM32\\w32time.DLL"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard value:"*.dll" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"*\SYSTEM\*ControlSet*\Services\W32Time\TimeProviders\*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Windows\System32\msiexec.exe, \Device\HarddiskVolume*\Windows\System32\msiexec.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\msiexec.exe" field:"process.executable" value:"\Device\HarddiskVolume*\Windows\System32\msiexec.exe" |
registry.data.strings | eq | ?:\Program Files\VMware\VMware Tools\vmwTimeProvider\vmwTimeProvider.dll | excludes:registry.data.strings field:"registry.data.strings" value:"?:\Program Files\VMware\VMware Tools\vmwTimeProvider\vmwTimeProvider.dll" |
registry.data.strings | eq | C:\Windows\SYSTEM32\w32time.DLL | excludes:registry.data.strings field:"registry.data.strings" value:"C:\Windows\SYSTEM32\w32time.DLL" |
Python Site or User Customize File Creation
#This rule detects the creation and modification of sitecustomize.py and usercustomize.py, which Python automatically executes on startup. Attackers can exploit these files for persistence by injecting malicious code. The rule monitors system-wide, user-specific, and virtual environment locations to catch unauthorized changes that could indicate persistence or backdooring attempts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Privilege Escalation | |
| Stealth |
Rule Body
[metadata]
creation_date = "2025/02/26"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/30"
[rule]
author = ["Elastic"]
description = """
This rule detects the creation and modification of sitecustomize.py and usercustomize.py, which
Python automatically executes on startup. Attackers can exploit these files for persistence by
injecting malicious code. The rule monitors system-wide, user-specific, and virtual environment
locations to catch unauthorized changes that could indicate persistence or backdooring attempts.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Python Site or User Customize File 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 Python Site or User Customize File Creation
Python's `sitecustomize.py` and `usercustomize.py` are scripts that execute automatically when Python starts, allowing for environment-specific customizations. Adversaries can exploit these files to maintain persistence by injecting malicious code. The detection rule monitors file creation and modification in key directories, excluding benign processes, to identify unauthorized changes indicative of potential backdooring or persistence attempts.
### Possible investigation steps
- Review the file path where the creation or modification was detected to determine if it is a system-wide, user-specific, or virtual environment location, as specified in the query.
- Identify the process executable responsible for the file creation or modification and verify if it is listed in the exclusion list of benign processes. If not, investigate the process for potential malicious activity.
- Check the timestamp of the file creation or modification event to correlate with any other suspicious activities or alerts on the system around the same time.
- Examine the contents of the sitecustomize.py or usercustomize.py file for any unauthorized or suspicious code that could indicate persistence mechanisms or backdooring attempts.
- Investigate the user account associated with the file creation or modification event to determine if the activity aligns with expected behavior or if it suggests potential compromise.
- Review system logs and other security alerts for additional context or indicators of compromise related to the detected event.
### False positive analysis
- Package managers like pip and poetry can trigger false positives when they create or modify sitecustomize.py or usercustomize.py during package installations or updates. To handle this, ensure these processes are included in the exclusion list within the detection rule.
- System updates or software installations that involve Python libraries might also lead to false positives. Regularly review and update the exclusion list to include known benign processes such as pacman or restic that are part of routine system maintenance.
- Custom scripts or automation tools that use Python to manage environments could inadvertently modify these files. Identify and exclude these specific scripts or tools if they are verified as non-malicious.
- Virtual environments often involve the creation of sitecustomize.py for environment-specific configurations. Consider excluding the virtual environment's Python executables if they are part of a controlled and secure development process.
### Response and remediation
- Isolate the affected system from the network to prevent further unauthorized access or spread of malicious code.
- Review the contents of the `sitecustomize.py` and `usercustomize.py` files for any unauthorized or suspicious code. Remove any malicious code identified.
- Restore the affected files from a known good backup if available, ensuring that the restored files are free from unauthorized modifications.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malware or persistence mechanisms.
- Monitor the system and network for any signs of continued unauthorized access or attempts to modify the `sitecustomize.py` and `usercustomize.py` files.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement additional monitoring and alerting for changes to critical Python directories and files to enhance detection of similar threats in the future.
"""
risk_score = 21
rule_id = "d788313c-9e0b-4c5a-8c4b-c3f05a47d5a8"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Execution",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"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.path like (
"/usr/lib/python*/sitecustomize.py",
"/usr/local/lib/python*/sitecustomize.py",
"/usr/lib/python*/dist-packages/sitecustomize.py",
"/usr/local/lib/python*/dist-packages/sitecustomize.py",
"/opt/*/lib/python*/sitecustomize.py",
"/home/*/.local/lib/python*/site-packages/usercustomize.py",
"/home/*/.config/python/usercustomize.py"
) and not (
process.executable in (
"/usr/bin/restic", "/usr/bin/pacman", "/usr/bin/dockerd", "/usr/bin/podman", "/usr/bin/pamac-daemon",
"./usr/bin/podman", "/opt/miniforge3/bin/mamba", "/usr/sbin/dockerd", "/opt/conda/_conda", "/kaniko/executor",
"/usr/bin/crio", "/usr/lib/systemd/systemd-executor"
) or
process.executable like~ ("/nix/store/*libexec/docker/dockerd", "/snap/docker/*dockerd")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[rule.threat.technique.subtechnique]]
id = "T1546.018"
name = "Python Startup Hooks"
reference = "https://attack.mitre.org/techniques/T1546/018/"
[[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.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[rule.threat.technique.subtechnique]]
id = "T1546.018"
name = "Python Startup Hooks"
reference = "https://attack.mitre.org/techniques/T1546/018/"
[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 == "linux" and event.type == "creation" and process.executable != null and
file.path like (
"/usr/lib/python*/sitecustomize.py",
"/usr/local/lib/python*/sitecustomize.py",
"/usr/lib/python*/dist-packages/sitecustomize.py",
"/usr/local/lib/python*/dist-packages/sitecustomize.py",
"/opt/*/lib/python*/sitecustomize.py",
"/home/*/.local/lib/python*/site-packages/usercustomize.py",
"/home/*/.config/python/usercustomize.py"
) and not (
process.executable in (
"/usr/bin/restic", "/usr/bin/pacman", "/usr/bin/dockerd", "/usr/bin/podman", "/usr/bin/pamac-daemon",
"./usr/bin/podman", "/opt/miniforge3/bin/mamba", "/usr/sbin/dockerd", "/opt/conda/_conda", "/kaniko/executor",
"/usr/bin/crio", "/usr/lib/systemd/systemd-executor"
) or
process.executable like~ ("/nix/store/*libexec/docker/dockerd", "/snap/docker/*dockerd")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"creation" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.executable | is_not_null | field:"Image" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | in | ./usr/bin/podman, /kaniko/executor, /opt/conda/_conda, /opt/miniforge3/bin/mamba, /usr/bin/crio, /usr/bin/dockerd, /usr/bin/pacman, /usr/bin/pamac-daemon, /usr/bin/podman, /usr/bin/restic, /usr/lib/systemd/systemd-executor, /usr/sbin/dockerd | excludes:process.executable |
process.executable | wildcard | /nix/store/*libexec/docker/dockerd, /snap/docker/*dockerd | excludes:process.executable field:"process.executable" value:"/nix/store/*libexec/docker/dockerd" field:"process.executable" value:"/snap/docker/*dockerd" |
Statistical Model Detected C2 Beaconing Activity with High Confidence
#A statistical model has identified command-and-control (C2) beaconing activity with high confidence. Beaconing can help attackers maintain stealthy communication with their C2 servers, receive instructions and payloads, exfiltrate data and maintain persistence in a network.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[metadata]
creation_date = "2023/09/22"
integration = ["beaconing", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
[rule]
author = ["Elastic"]
description = """
A statistical model has identified command-and-control (C2) beaconing activity with high confidence. Beaconing can help
attackers maintain stealthy communication with their C2 servers, receive instructions and payloads, exfiltrate data and
maintain persistence in a network.
"""
from = "now-1h"
index = ["ml_beaconing.all"]
language = "kuery"
license = "Elastic License v2"
name = "Statistical Model Detected C2 Beaconing Activity with High Confidence"
references = [
"https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
"https://docs.elastic.co/en/integrations/beaconing",
"https://www.elastic.co/security-labs/identifying-beaconing-malware-using-elastic",
]
risk_score = 21
rule_id = "0ab319ef-92b8-4c7f-989b-5de93c852e93"
setup = """## Setup
The rule requires the Network Beaconing Identification integration assets to be installed, as well as network logs collected by the Elastic Defend integration.
### Network Beaconing Identification Setup
The Network Beaconing Identification integration consists of a statistical framework to identify C2 beaconing activity in network logs.
#### Prerequisite Requirements:
- Fleet is required for Network Beaconing Identification.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Network events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
#### The following steps should be executed to install assets associated with the Network Beaconing Identification integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Network Beaconing Identification and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
"""
severity = "low"
tags = [
"Domain: Network",
"Data Source: Elastic Defend",
"Use Case: C2 Beaconing Detection",
"Tactic: Command and Control",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
beacon_stats.beaconing_score: 3
'''
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 Statistical Model Detected C2 Beaconing Activity with High Confidence
Statistical models analyze network traffic patterns to identify anomalies indicative of C2 beaconing, a tactic where attackers maintain covert communication with compromised systems. Adversaries exploit this to issue commands, exfiltrate data, and sustain network presence. The detection rule leverages a high beaconing score to flag potential threats, aiding analysts in pinpointing suspicious activities linked to C2 operations.
### Possible investigation steps
- Review the network traffic logs to identify the source and destination IP addresses associated with the beaconing activity flagged by the beacon_stats.beaconing_score of 3.
- Correlate the identified IP addresses with known malicious IP databases or threat intelligence feeds to determine if they are associated with known C2 servers.
- Analyze the frequency and pattern of the beaconing activity to assess whether it aligns with typical C2 communication patterns, such as regular intervals or specific time frames.
- Investigate the domain names involved in the communication to check for any associations with malicious activities or suspicious registrations.
- Examine the payloads or data transferred during the flagged communication sessions to identify any potential exfiltration of sensitive information or receipt of malicious instructions.
- Cross-reference the involved systems with internal asset inventories to determine if they are critical assets or have been previously flagged for suspicious activities.
- Consult with the incident response team to decide on containment or remediation actions if the investigation confirms malicious C2 activity.
### False positive analysis
- Regularly scheduled software updates or patch management systems may generate network traffic patterns similar to C2 beaconing. Users can create exceptions for known update servers to reduce false positives.
- Automated backup systems that frequently communicate with cloud storage services might be flagged. Identifying and excluding these backup services from the analysis can help mitigate this issue.
- Network monitoring tools that periodically check connectivity or system health can mimic beaconing activity. Whitelisting these monitoring tools can prevent them from being incorrectly flagged.
- Internal applications that use polling mechanisms to check for updates or status changes may trigger alerts. Documenting and excluding these applications from the rule can minimize false positives.
- Frequent communication with trusted third-party services, such as content delivery networks, may appear as beaconing. Establishing a list of trusted domains and excluding them from the analysis can help manage this.
### Response and remediation
- Isolate the affected systems from the network to prevent further communication with the C2 server and contain the threat.
- Conduct a thorough analysis of the network traffic logs to identify any additional compromised systems or lateral movement within the network.
- Remove any malicious software or scripts identified on the compromised systems, ensuring all traces of the C2 communication channels are eradicated.
- Apply security patches and updates to all affected systems to close any vulnerabilities exploited by the attackers.
- Change all credentials and authentication tokens associated with the compromised systems to prevent unauthorized access.
- Monitor the network for any signs of re-infection or continued C2 activity, using enhanced detection rules and updated threat intelligence.
- Escalate the incident to the appropriate internal security team or external cybersecurity experts for further investigation and to assess the potential impact on the organization."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"
[[rule.threat.technique.subtechnique]]
id = "T1102.002"
name = "Bidirectional Communication"
reference = "https://attack.mitre.org/techniques/T1102/002/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Stage 1: query
beacon_stats.beaconing_score: 3
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
beacon_stats.beaconing_score | eq |
| field:"beacon_stats.beaconing_score" kind:eq value:"3" |
Suspicious Enumeration via LDAP Search
#Identifies a list of IOCs obtained from popular reconnaissance tools using LDAP search events. Adversaries attempt to enumerate information on the Active Directory structure by using various LDAP-based discovery queries to identify targets for attack.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = """
Identifies a list of IOCs obtained from popular reconnaissance tools using LDAP search events. Adversaries attempt to
enumerate information on the Active Directory structure by using various LDAP-based discovery queries to identify
targets for attack.
"""
id = "9e8fec58-4f0d-4a30-8e9e-54c717202064"
license = "Elastic License v2"
name = "Suspicious Enumeration via LDAP Search"
os_list = ["windows"]
reference = [
"https://attack.mitre.org/techniques/T1087/002/",
"https://github.com/tobor88/PowerShell-Red-Team/blob/master/RedTeamEnum/RedTeamEnum.psm1",
]
version = "1.0.3"
query = '''
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
not process.executable :
("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
"?:\\Windows\\System32\\lsass.exe",
"?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
"?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe") and
process.Ext.api.parameters.search_filter : (
"(|(samAccountType=805306368)(samAccountType=805306369)(objectclass=organizationalUnit))",
"(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=524288))",
"(&(samAccountType=805306368)(|(homedirectory=?)(scriptpath=?)(profilepath=?)))",
"(|(objectClass=user)(objectClass=group))(objectSid=S-1-5-21-1960408961-838170752-1801674531-512))",
"(|(samaccounttype=268435456)(samaccounttype=268435457)(samaccounttype=536870912)(samaccounttype=536870913))",
"(|(samAccountType=805306368)(samAccountType=805306369)(samAccountType=268435456)(samAccountType=268435457)(samAccountType=536870912)(samAccountType=536870913))",
"(&(samaccounttype=805306369)(!(objectclass=msDS-GroupManagedServiceAccount))(!(objectclass=msDS-ManagedServiceAccount)))",
"(|(samAccountType=805306368)(samAccountType=805306369)(samAccountType=268435456)(samAccountType=268435457)(samAccountType=536870912)(samAccountType=536870913)(object*",
"(|(msDS-AllowedToActOnBehalfOfOtherIdentity=?)(msDS-AllowedToDelegateTo=?)(UserAccountControl:1.2.840.113556.1.4.804:=17301504))",
"(|(userAccountControl:1.2.840.113556.1.4.803:=524288)(msDS-AllowedToDelegateTo=?)(msDS-AllowedToActOnBehalfOfOtherIdentity=?))",
"(|(objectcategory=computer)(objectcategory=person)(objectcategory=msDS-GroupManagedServiceAccount)(objectcategory=msDS-ManagedServiceAccount))"
)
'''
min_endpoint_version = "9.1.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"
[[threat.technique.subtechnique]]
id = "T1069.002"
name = "Domain Groups"
reference = "https://attack.mitre.org/techniques/T1069/002/"
[[threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[threat.technique.subtechnique]]
id = "T1087.002"
name = "Domain Account"
reference = "https://attack.mitre.org/techniques/T1087/002/"
[[threat.technique]]
id = "T1482"
name = "Domain Trust Discovery"
reference = "https://attack.mitre.org/techniques/T1482/"
[threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[internal]
min_endpoint_version = "9.1.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
not process.executable :
("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
"?:\\Windows\\System32\\lsass.exe",
"?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
"?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe") and
process.Ext.api.parameters.search_filter : (
"(|(samAccountType=805306368)(samAccountType=805306369)(objectclass=organizationalUnit))",
"(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=524288))",
"(&(samAccountType=805306368)(|(homedirectory=?)(scriptpath=?)(profilepath=?)))",
"(|(objectClass=user)(objectClass=group))(objectSid=S-1-5-21-1960408961-838170752-1801674531-512))",
"(|(samaccounttype=268435456)(samaccounttype=268435457)(samaccounttype=536870912)(samaccounttype=536870913))",
"(|(samAccountType=805306368)(samAccountType=805306369)(samAccountType=268435456)(samAccountType=268435457)(samAccountType=536870912)(samAccountType=536870913))",
"(&(samaccounttype=805306369)(!(objectclass=msDS-GroupManagedServiceAccount))(!(objectclass=msDS-ManagedServiceAccount)))",
"(|(samAccountType=805306368)(samAccountType=805306369)(samAccountType=268435456)(samAccountType=268435457)(samAccountType=536870912)(samAccountType=536870913)(object*",
"(|(msDS-AllowedToActOnBehalfOfOtherIdentity=?)(msDS-AllowedToDelegateTo=?)(UserAccountControl:1.2.840.113556.1.4.804:=17301504))",
"(|(userAccountControl:1.2.840.113556.1.4.803:=524288)(msDS-AllowedToDelegateTo=?)(msDS-AllowedToActOnBehalfOfOtherIdentity=?))",
"(|(objectcategory=computer)(objectcategory=person)(objectcategory=msDS-GroupManagedServiceAccount)(objectcategory=msDS-ManagedServiceAccount))"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"ldap_search" |
process.Ext.api.parameters.search_filter | wildcard |
| field:"process.Ext.api.parameters.search_filter" kind:wildcard |
user.id | ne |
| field:"user.id" kind:ne value:"S-1-5-18" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\Azure Advanced Threat Protection Sensor\*\Microsoft.Tri.Sensor.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\ADFS\Microsoft.IdentityServer.ServiceHost.exe, ?:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe | excludes:process.executable |
Suspicious Execution from a Mounted Device
#Identifies when a script interpreter or signed binary is launched via a non-standard working directory. An attacker may use this technique to evade defenses.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2021/05/28"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies when a script interpreter or signed binary is launched via a non-standard working directory. An attacker may
use this technique to evade defenses.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Execution from a Mounted Device"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious Execution from a Mounted Device
In Windows environments, script interpreters and signed binaries are essential for executing legitimate tasks. However, adversaries can exploit these by launching them from non-standard directories, such as mounted devices, to bypass security measures. The detection rule identifies such anomalies by monitoring processes initiated from unexpected directories, especially when triggered by common parent processes like explorer.exe, thus flagging potential defense evasion attempts.
### Possible investigation steps
- Review the process details to confirm the executable path and working directory, ensuring they match the criteria of being launched from a non-standard directory (e.g., not from "C:\\\\").
- Investigate the parent process, explorer.exe, to determine if there are any unusual activities or user actions that might have triggered the suspicious execution.
- Check the user account associated with the process to verify if the activity aligns with their typical behavior or if the account might be compromised.
- Analyze the command line arguments used by the suspicious process to identify any potentially malicious scripts or commands being executed.
- Correlate the event with other security alerts or logs from the same host to identify any patterns or additional indicators of compromise.
- Examine the mounted device from which the process was executed to determine its origin, legitimacy, and any associated files that might be malicious.
### False positive analysis
- Legitimate software installations or updates may trigger the rule if they are executed from a mounted device. Users can create exceptions for known software update processes that are verified as safe.
- Portable applications running from USB drives or external storage can be flagged. To mitigate this, users should whitelist specific applications that are frequently used and deemed non-threatening.
- IT administrative scripts executed from network shares or mounted drives for maintenance tasks might be detected. Users can exclude these scripts by specifying trusted network paths or script names.
- Development environments where scripts are tested from non-standard directories can cause alerts. Developers should ensure their working directories are recognized as safe or use designated development machines with adjusted monitoring rules.
- Backup or recovery operations that utilize mounted devices for script execution may be misidentified. Users should identify and exclude these operations by defining exceptions for known backup tools and processes.
### Response and remediation
- Isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate any suspicious processes identified by the detection rule, such as those initiated by script interpreters or signed binaries from non-standard directories.
- Conduct a forensic analysis of the mounted device and the affected system to identify any malicious payloads or scripts and remove them.
- Review and restore any altered system configurations or registry settings to their original state to ensure system integrity.
- Update and patch the system to close any vulnerabilities that may have been exploited by the attacker.
- Monitor for any recurrence of similar activities by enhancing logging and alerting mechanisms, focusing on process execution from non-standard directories.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = [
"https://www.microsoft.com/security/blog/2021/05/27/new-sophisticated-email-based-attack-from-nobelium/",
"https://www.volexity.com/blog/2021/05/27/suspected-apt29-operation-launches-election-fraud-themed-phishing-campaigns/",
]
risk_score = 47
rule_id = "8a1d4831-3ce6-4859-9891-28931fa6101d"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and process.executable : "C:\\*" and
(
process.working_directory : ("D:\\*", "E:\\*", "F:\\*") or
?process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk")
) and
process.parent.name : "explorer.exe" and
process.name : (
"rundll32.exe", "mshta.exe", "powershell.exe", "pwsh.exe", "cmd.exe", "regsvr32.exe", "cscript.exe",
"wscript.exe", "certutil.exe", "bitsadmin.exe", "msiexec.exe", "wmic.exe", "schtasks.exe", "msbuild.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:
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1127"
name = "Trusted Developer Utilities Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1127/"
[[rule.threat.technique.subtechnique]]
id = "T1127.001"
name = "MSBuild"
reference = "https://attack.mitre.org/techniques/T1127/001/"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"
[[rule.threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[[rule.threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"
[[rule.threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[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 = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and process.executable : "C:\\*" and
(
process.working_directory : ("D:\\*", "E:\\*", "F:\\*") or
?process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk")
) and
process.parent.name : "explorer.exe" and
process.name : (
"rundll32.exe", "mshta.exe", "powershell.exe", "pwsh.exe", "cmd.exe", "regsvr32.exe", "cscript.exe",
"wscript.exe", "certutil.exe", "bitsadmin.exe", "msiexec.exe", "wmic.exe", "schtasks.exe", "msbuild.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.Ext.device.product_id | wildcard |
| field:"process.Ext.device.product_id" kind:wildcard |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"C:\*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"explorer.exe" |
process.working_directory | wildcard |
| field:"CurrentDirectory" kind:wildcard |
Suspicious Explorer Child Process
#Identifies a suspicious Windows explorer child process. Explorer.exe can be abused to launch malicious scripts or executables from a trusted parent process.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/10/29"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies a suspicious Windows explorer child process. Explorer.exe can be abused to launch malicious scripts or
executables from a trusted parent process.
"""
from = "now-9m"
index = [
"logs-endpoint.events.process-*",
"winlogbeat-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Explorer Child 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 Suspicious Explorer Child Process
Windows Explorer, a core component of the Windows OS, manages file and folder navigation. Adversaries exploit its trusted status to launch malicious scripts or executables, often using DCOM to start processes like PowerShell or cmd.exe. The detection rule identifies such anomalies by monitoring child processes of Explorer with specific characteristics, excluding known benign activities, to flag potential threats.
### Possible investigation steps
- Review the process details to confirm the suspicious child process was indeed started by explorer.exe with the specific parent arguments indicating DCOM usage, such as "-Embedding".
- Check the process command line arguments and execution context to identify any potentially malicious scripts or commands being executed by the child process.
- Investigate the parent process explorer.exe to determine if it was started by a legitimate user action or if there are signs of compromise, such as unusual user activity or recent phishing attempts.
- Correlate the event with other security logs or alerts from data sources like Microsoft Defender XDR or Sysmon to identify any related suspicious activities or patterns.
- Examine the network activity associated with the suspicious process to detect any unauthorized data exfiltration or communication with known malicious IP addresses.
- Assess the system for any additional indicators of compromise, such as unexpected changes in system files or registry keys, which might suggest a broader attack.
### False positive analysis
- Legitimate software installations or updates may trigger the rule when they use scripts or executables like PowerShell or cmd.exe. Users can create exceptions for known software update processes by identifying their specific command-line arguments or parent process details.
- System administrators often use scripts for maintenance tasks that might be flagged by this rule. To prevent false positives, administrators should document and exclude these routine scripts by specifying their unique process arguments or execution times.
- Some enterprise applications may use DCOM to launch processes for legitimate purposes. Users should identify these applications and exclude their specific process signatures or parent-child process relationships from the rule.
- Automated testing environments might execute scripts or commands that resemble suspicious activity. Users can mitigate false positives by excluding processes that are part of known testing frameworks or environments.
- Certain security tools or monitoring software may use similar techniques to gather system information. Users should verify and exclude these tools by confirming their process names and execution patterns.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate the suspicious child process identified in the alert, such as cscript.exe, wscript.exe, powershell.exe, rundll32.exe, cmd.exe, mshta.exe, or regsvr32.exe, to stop any ongoing malicious actions.
- 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 files or processes.
- Review and analyze the parent process explorer.exe and its command-line arguments to understand how the malicious process was initiated and to identify any potential persistence mechanisms.
- 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.
- Implement additional monitoring and alerting for similar suspicious activities involving explorer.exe to enhance detection capabilities and prevent recurrence.
- Review and update endpoint security policies to restrict the execution of potentially malicious scripts or executables from explorer.exe, especially when initiated via DCOM."""
risk_score = 47
rule_id = "9a5b4e31-6cde-4295-9ff7-6be1b8567e1b"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Tactic: Defense Evasion",
"Tactic: Execution",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(
process.name : ("cscript.exe", "wscript.exe", "powershell.exe", "rundll32.exe", "cmd.exe", "mshta.exe", "regsvr32.exe") or
?process.pe.original_file_name in ("cscript.exe", "wscript.exe", "PowerShell.EXE", "RUNDLL32.EXE", "Cmd.Exe", "MSHTA.EXE", "REGSVR32.EXE")
) and
/* Explorer started via DCOM */
process.parent.name : "explorer.exe" and process.parent.args : "-Embedding" and
not process.parent.args:
(
/* Noisy CLSID_SeparateSingleProcessExplorerHost Explorer COM Class IDs */
"/factory,{5BD95610-9434-43C2-886C-57852CC8A120}",
"/factory,{ceff45ee-c862-41de-aee2-a022c81eda92}"
)
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[[rule.threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[[rule.threat.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[rule.threat.technique.subtechnique]]
id = "T1559.001"
name = "Component Object Model"
reference = "https://attack.mitre.org/techniques/T1559/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"
[[rule.threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"
[[rule.threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(
process.name : ("cscript.exe", "wscript.exe", "powershell.exe", "rundll32.exe", "cmd.exe", "mshta.exe", "regsvr32.exe") or
?process.pe.original_file_name in ("cscript.exe", "wscript.exe", "PowerShell.EXE", "RUNDLL32.EXE", "Cmd.Exe", "MSHTA.EXE", "REGSVR32.EXE")
) and
process.parent.name : "explorer.exe" and process.parent.args : "-Embedding" and
not process.parent.args:
(
"/factory,{5BD95610-9434-43C2-886C-57852CC8A120}",
"/factory,{ceff45ee-c862-41de-aee2-a022c81eda92}"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard value:"-Embedding" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"explorer.exe" |
process.pe.original_file_name | in |
| field:"OriginalFileName" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | eq | /factory,{5BD95610-9434-43C2-886C-57852CC8A120}, /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} | excludes:process.parent.args field:"process.parent.args" value:"/factory,{5BD95610-9434-43C2-886C-57852CC8A120}" field:"process.parent.args" value:"/factory,{ceff45ee-c862-41de-aee2-a022c81eda92}" |
Suspicious Network Tool Launched Inside A Container
#This rule detects commonly abused network utilities running inside a container. Network utilities like nc, nmap, dig, tcpdump, ngrep, telnet, mitmproxy, zmap can be used for malicious purposes such as network reconnaissance, monitoring, or exploitation, and should be monitored closely within a container.
Known False Positives
- There is a potential for false positives if the container is used for legitimate tasks that require the use of network utilities, such as network troubleshooting, testing or system monitoring. It is important to investigate any alerts generated by this rule to determine if they are indicative of malicious activity or part of legitimate container activity.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Reconnaissance | |
| Credential Access | |
| Discovery | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2025/03/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects commonly abused network utilities running inside a container. Network utilities like nc, nmap, dig,
tcpdump, ngrep, telnet, mitmproxy, zmap can be used for malicious purposes such as network reconnaissance, monitoring,
or exploitation, and should be monitored closely within a container.
"""
false_positives = [
"""
There is a potential for false positives if the container is used for legitimate tasks that require the use of
network utilities, such as network troubleshooting, testing or system monitoring. It is important to investigate any
alerts generated by this rule to determine if they are indicative of malicious activity or part of legitimate
container activity.
""",
]
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Network Tool Launched Inside A Container"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious Network Tool Launched Inside A Container
Containers are lightweight, portable units that encapsulate applications and their dependencies, often used to ensure consistent environments across development and production. Adversaries exploit network tools within containers for reconnaissance or lateral movement, leveraging utilities like `nc` or `nmap` to map networks or intercept traffic. The detection rule identifies these tools' execution by monitoring process starts and arguments, flagging potential misuse for further investigation.
### Possible investigation steps
- Examine the process arguments to understand the specific command or options used, which may provide insight into the intent of the tool's execution.
- Check the container's creation and modification timestamps to determine if the container was recently deployed or altered, which could indicate suspicious activity.
- Investigate the user or service account associated with the process start event to assess if it aligns with expected behavior or if it might be compromised.
- Analyze network logs and traffic patterns from the container to identify any unusual outbound connections or data exfiltration attempts.
- Correlate the alert with other security events or logs from the same container or host to identify potential lateral movement or further malicious activity.
### False positive analysis
- Development and testing environments often use network tools for legitimate purposes such as debugging or network configuration. To manage this, create exceptions for containers identified as part of these environments by tagging them appropriately and excluding them from the rule.
- Automated scripts or orchestration tools may trigger network utilities for routine checks or maintenance tasks. Identify these scripts and whitelist their associated container IDs or process names to prevent false alerts.
- Some monitoring solutions deploy containers with built-in network tools for performance analysis. Verify the legitimacy of these containers and exclude them from the rule by using specific labels or container IDs.
- Containers used for educational or training purposes might intentionally run network tools. Ensure these containers are marked and excluded from detection by setting up rules based on their unique identifiers or labels.
### Response and remediation
- Immediately isolate the affected container to prevent further network reconnaissance or lateral movement. This can be done by restricting its network access or stopping the container entirely.
- Conduct a thorough review of the container's logs and process history to identify any unauthorized access or data exfiltration attempts. Focus on the execution of the flagged network utilities.
- Remove any unauthorized or suspicious network tools from the container to prevent further misuse. Ensure that only necessary and approved utilities are present.
- Patch and update the container image to address any vulnerabilities that may have been exploited. Rebuild and redeploy the container using the updated image.
- Implement network segmentation to limit the container's access to sensitive resources and reduce the potential impact of similar threats in the future.
- Enhance monitoring and alerting for the execution of network utilities within containers, ensuring that any future occurrences are detected promptly.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems or containers have been compromised."""
references = ["https://sysdig.com/blog/cve-2021-25741-kubelet-falco/"]
risk_score = 21
rule_id = "7290be75-2e10-49ec-b387-d4ed55b920ff"
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: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Tactic: Command and Control",
"Tactic: Reconnaissance",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.entry_leader.entry_meta.type == "container" and process.name in (
"nc.traditional", "nc", "ncat", "netcat", "nmap", "tcpdump", "tshark", "ngrep", "telnet",
"mitmproxy", "socat", "zmap", "masscan", "zgrab"
) and
not (process.name in ("nc.traditional", "nc", "ncat", "netcat") and process.args like ("-*z*", "localhost", "127.0.0.1"))
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1046"
name = "Network Service Discovery"
reference = "https://attack.mitre.org/techniques/T1046/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[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.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1595"
name = "Active Scanning"
reference = "https://attack.mitre.org/techniques/T1595/"
[rule.threat.tactic]
id = "TA0043"
name = "Reconnaissance"
reference = "https://attack.mitre.org/tactics/TA0043/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1040"
name = "Network Sniffing"
reference = "https://attack.mitre.org/techniques/T1040/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.entry_leader.entry_meta.type == "container" and process.name in (
"nc.traditional", "nc", "ncat", "netcat", "nmap", "tcpdump", "tshark", "ngrep", "telnet",
"mitmproxy", "socat", "zmap", "masscan", "zgrab"
) and
not (process.name in ("nc.traditional", "nc", "ncat", "netcat") and process.args like ("-*z*", "localhost", "127.0.0.1"))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.entry_leader.entry_meta.type | eq |
| field:"process.entry_leader.entry_meta.type" kind:eq value:"container" |
process.name | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | -*z*, localhost, 127.0.0.1 | excludes:process.args field:"process.args" value:"-*z*" field:"process.args" value:"localhost" field:"process.args" value:"127.0.0.1" |
process.name | in | nc, nc.traditional, ncat, netcat | excludes:process.name |
Suspicious Python Script Interpreter
#Identifies the execution of a recently dropped executable that loads python libraries to interact with Windows APIs.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule Body
[rule]
description = "Identifies the execution of a recently dropped executable that loads python libraries to interact with Windows APIs."
id = "20eaa6a3-6b80-48bc-9c48-a935138169f9"
license = "Elastic License v2"
name = "Suspicious Python Script Interpreter"
os_list = ["windows"]
version = "1.0.23"
query = '''
sequence by process.entity_id with maxspan=1m
[process where (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
process.executable != null and
not process.code_signature.trusted == true and
not process.executable :
("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe",
"?:\\Python*\\python*.exe",
"?:\\Users\\*\\AppData\\Local\\*.exe",
"?:\\Users\\*\\Desktop\\*.exe",
"?:\\*\\Anaconda?\\python*.exe",
"D:\\AppsSvcs\\SeaAiSsoDocsService\\SeaAiSsoDocsService.exe",
"D:\\AppsSvcs\\GenAIServiceCode\\GenAIServiceCode.exe",
"D:\\AppsSvcs\\GenAIServiceDocs\\GenAIServiceDocs.exe",
"D:\\AppsSvcs\\SsoAiServiceDocs\\SsoAiServiceDocs.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\Python\\Python*\\python.exe",
"?:\\ProgramData\\checkmk\\agent\\modules\\python*\\.venv\\Scripts\\python.exe",
"?:\\Users\\*\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.*\\LocalCache\\local-packages\\*\\Scripts\\dist\\LiveLinkATC*.exe") and
not process.hash.sha256 :
("b80be3102561bf891454bd52673fdcd49d08b14c17061c077d6a88ca5ba3e9e3",
"8e7bbf6e1bc3588f6d13b8372ca1bef37b6758b8a3a17bda424eba140dd4e8fe",
"37c3aa7e782e7331d9831ce5df27d80ac8760657ba51beb75a60b93e2d2f138b",
"bf2cd24734e0aba2495fa8ca138c79df8d8d56309001a69a47abbe55a1872a15",
"5a20b73eae6179b4553c2a066afe1ca1d9873bb1005ce1e9459d7edb9c63a280",
"3cfb1833ddab2145a62a7b3df311dcf4315d14ddb88f6be1e04557943e920d22",
"a37e022b30fd8c91ade968373fa0ca714e915a207fe4e93ac5f86fdae289cf3a",
"c475438563d23dc91dd9bba960b11fa1b194409967648770390f68fed62c1e57",
"74991c716e16c5b2ed186096e24b1f739597c48d328a52b85576911aa36ce25c",
"0bea60c6a85b369eb237520af21fa47c33f4bcf42d83d3cb0a9c91cfaac89959",
"50e109260bbaafa95d107f4bb0a9e54ec3494735c54b6da3885f2f1079e36d5b",
"cacde2ae530296624adbca7393f84015f0d5cb0e1c1c5a4345b91e3a841dd5f9",
"14f1d41be0a0218233b1b823ddb9ed3ac06603c15c56c2f11aa4a286e72c2e4e",
"03b8dfcf64c4e9801becb8945cdf1ebc6f3524daf5de75f662204553e97a4f05",
"ca78c09f7c334844dba28d0d6438ac507d14ad2874c04635cae42d398df4b6fd",
"8f067758c753c4d325653f2349bf5f761c4e1b4fb8a4516a152afc2375a88800",
"9ad4c8d68a26f6feb2287e9d9895358a5a560ecc34cb3649edade01b054e1dd5",
"8f8eaad0cbf91258227c1ed118813d940de56b324d358a9261f1fa18727beac1",
"a487293c9b2439024db52441bfa2a6220117e461e8124659bd962dcd5eb9ca58",
"7e5506b2975365bc490e27bf141593ec6d1da8858311b7dc1872dce1681ed1e5",
"dc9d9b130c2271fb3d5ebce3f10b84682d7c420ccb72220f7942f40b9e833c82",
"273823283ed4d333a585462dba323186bbb436522182488936879aa3af35cfbb",
"39813ef813924c17f0b19aef66b7b80987670e39a3f6daae2ef0b5a0b62f71e0",
"c70fa68e604f91387bbe920971057cb04148c0fed4142124ccd9226abfb93538",
"afbe4150814176a86abb7192b14465b88a0cbf3a58b512eaa533fb56dccc6077",
"7351523031359477a5ac0e6d39b04dec624fd3e990f85e698b6f2a77873963fd",
"5ab87d9be556f9ba07686993399ddf36713e3ed453c0ccb36bb6b76c5946d044",
"a55091876a0682795353e398f1a5f974a2ee5e38ce0fcab79519b9d1ec464db9",
"bdd94e30ad1f48c3d537aabbe65353ec5b7c80a338c13afb280a4bb9a4d77c58",
"be4827351259b82b0e347cce4b15ff4b25a63a06c754c2621fbcf7134fc30342",
"a53af751d32103fab234be6ae680fc0f6057989d8ff1486d8d5b26ccde0b3d70",
"1a59794c7c29f4569a0fe87bc9d9ffbf57835358c69f957950cd9718151f1af6",
"3d8595f90fb478cb0f3673a4e5162ac054638fe699a3879ad47514cf872077dd",
"87c927fb0f347bcb689d115e6515b285302d2253cab727924924b85da9056a9e",
"ff6b583cfc19ea28e9d3580af49e6db71675a5869e27de5f2940580948258b32",
"31f692eaa4a205f52235f43ee69b23c6789b45ed11e5a831e9b9b460c3985867",
"3c2e7b09c5bd39f7c0dd7413d497825c4383fe02ad27410c2b7abf315f4fd91d",
"129502c5d1e7c5ce49941fda604e654e69235cf5fe856fbf2a610303e8de6e26",
"b0200d91dda15b6a76be5b57a247247fc5d6b5ba833b8b9f186d89745f1a82dd",
"6f463847cc8951b63ae47381e308b380a981ee93e6ccc5a279474a59f2fa0e30",
"51291914e0cf34090ed205738f1d98d8a73b3f394094bc7175876e1b1039ceb1",
"0149486bdaebe992502756f4c6fb5be6e9fa927598355e33283f517620479fb4",
"f2dda7c8cf878054bdff6943a479fe3e7d41ba74079089670e8e0a2bf680220c",
"3dff263228c025f393b9ec418dc4b0d4796d51d2775500061e566f7fb40a9857",
"eca5e5510e95804fd6af240d4247806e022214b14a7e2d68b825363b846b35f0",
"3489700e2aaee32c4806cf9ad590352db4f35bffeca4a7ec510beaf81069d877",
"60104130ddba5a1c0af212e88c044adedf672aa59d69c5ead20581f79d069346",
"a03e3bcdff4f47bd18b17733c764bfbbddaa247ce6f850c5bf48a5e5e6308da7",
"1bedd9c0ceb91dd745808293591a4896e3be67066dbe267fe6d664733965fe15",
"a3e7ae2761115925e5b367de1684a15f880eba028686d40bcd7d377641b311ee",
"b0ecc848b56af95a7d945e2a97d8466dc8c387468bbb3264c334dd996a953517",
"b0dd44c64e360ca412640fbbd8744483901db12c659ee28b3e752b040e2cba62")
]
[library where dll.name : ("win32api*.pyd", "win32process.pyd", "win32security.pyd", "md.cp*-win32.pyd", "win32crypt.pyd", "win32net.pyd")]
[network where
event.action : ("disconnect_received", "connection_attempted") and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
"192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10", "FF00::/8")]
'''
min_endpoint_version = "8.10.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where (process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
process.executable != null and
not process.code_signature.trusted == true and
not process.executable :
("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe",
"?:\\Python*\\python*.exe",
"?:\\Users\\*\\AppData\\Local\\*.exe",
"?:\\Users\\*\\Desktop\\*.exe",
"?:\\*\\Anaconda?\\python*.exe",
"D:\\AppsSvcs\\SeaAiSsoDocsService\\SeaAiSsoDocsService.exe",
"D:\\AppsSvcs\\GenAIServiceCode\\GenAIServiceCode.exe",
"D:\\AppsSvcs\\GenAIServiceDocs\\GenAIServiceDocs.exe",
"D:\\AppsSvcs\\SsoAiServiceDocs\\SsoAiServiceDocs.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\Python\\Python*\\python.exe",
"?:\\ProgramData\\checkmk\\agent\\modules\\python*\\.venv\\Scripts\\python.exe",
"?:\\Users\\*\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.*\\LocalCache\\local-packages\\*\\Scripts\\dist\\LiveLinkATC*.exe") and
not process.hash.sha256 :
("b80be3102561bf891454bd52673fdcd49d08b14c17061c077d6a88ca5ba3e9e3",
"8e7bbf6e1bc3588f6d13b8372ca1bef37b6758b8a3a17bda424eba140dd4e8fe",
"37c3aa7e782e7331d9831ce5df27d80ac8760657ba51beb75a60b93e2d2f138b",
"bf2cd24734e0aba2495fa8ca138c79df8d8d56309001a69a47abbe55a1872a15",
"5a20b73eae6179b4553c2a066afe1ca1d9873bb1005ce1e9459d7edb9c63a280",
"3cfb1833ddab2145a62a7b3df311dcf4315d14ddb88f6be1e04557943e920d22",
"a37e022b30fd8c91ade968373fa0ca714e915a207fe4e93ac5f86fdae289cf3a",
"c475438563d23dc91dd9bba960b11fa1b194409967648770390f68fed62c1e57",
"74991c716e16c5b2ed186096e24b1f739597c48d328a52b85576911aa36ce25c",
"0bea60c6a85b369eb237520af21fa47c33f4bcf42d83d3cb0a9c91cfaac89959",
"50e109260bbaafa95d107f4bb0a9e54ec3494735c54b6da3885f2f1079e36d5b",
"cacde2ae530296624adbca7393f84015f0d5cb0e1c1c5a4345b91e3a841dd5f9",
"14f1d41be0a0218233b1b823ddb9ed3ac06603c15c56c2f11aa4a286e72c2e4e",
"03b8dfcf64c4e9801becb8945cdf1ebc6f3524daf5de75f662204553e97a4f05",
"ca78c09f7c334844dba28d0d6438ac507d14ad2874c04635cae42d398df4b6fd",
"8f067758c753c4d325653f2349bf5f761c4e1b4fb8a4516a152afc2375a88800",
"9ad4c8d68a26f6feb2287e9d9895358a5a560ecc34cb3649edade01b054e1dd5",
"8f8eaad0cbf91258227c1ed118813d940de56b324d358a9261f1fa18727beac1",
"a487293c9b2439024db52441bfa2a6220117e461e8124659bd962dcd5eb9ca58",
"7e5506b2975365bc490e27bf141593ec6d1da8858311b7dc1872dce1681ed1e5",
"dc9d9b130c2271fb3d5ebce3f10b84682d7c420ccb72220f7942f40b9e833c82",
"273823283ed4d333a585462dba323186bbb436522182488936879aa3af35cfbb",
"39813ef813924c17f0b19aef66b7b80987670e39a3f6daae2ef0b5a0b62f71e0",
"c70fa68e604f91387bbe920971057cb04148c0fed4142124ccd9226abfb93538",
"afbe4150814176a86abb7192b14465b88a0cbf3a58b512eaa533fb56dccc6077",
"7351523031359477a5ac0e6d39b04dec624fd3e990f85e698b6f2a77873963fd",
"5ab87d9be556f9ba07686993399ddf36713e3ed453c0ccb36bb6b76c5946d044",
"a55091876a0682795353e398f1a5f974a2ee5e38ce0fcab79519b9d1ec464db9",
"bdd94e30ad1f48c3d537aabbe65353ec5b7c80a338c13afb280a4bb9a4d77c58",
"be4827351259b82b0e347cce4b15ff4b25a63a06c754c2621fbcf7134fc30342",
"a53af751d32103fab234be6ae680fc0f6057989d8ff1486d8d5b26ccde0b3d70",
"1a59794c7c29f4569a0fe87bc9d9ffbf57835358c69f957950cd9718151f1af6",
"3d8595f90fb478cb0f3673a4e5162ac054638fe699a3879ad47514cf872077dd",
"87c927fb0f347bcb689d115e6515b285302d2253cab727924924b85da9056a9e",
"ff6b583cfc19ea28e9d3580af49e6db71675a5869e27de5f2940580948258b32",
"31f692eaa4a205f52235f43ee69b23c6789b45ed11e5a831e9b9b460c3985867",
"3c2e7b09c5bd39f7c0dd7413d497825c4383fe02ad27410c2b7abf315f4fd91d",
"129502c5d1e7c5ce49941fda604e654e69235cf5fe856fbf2a610303e8de6e26",
"b0200d91dda15b6a76be5b57a247247fc5d6b5ba833b8b9f186d89745f1a82dd",
"6f463847cc8951b63ae47381e308b380a981ee93e6ccc5a279474a59f2fa0e30",
"51291914e0cf34090ed205738f1d98d8a73b3f394094bc7175876e1b1039ceb1",
"0149486bdaebe992502756f4c6fb5be6e9fa927598355e33283f517620479fb4",
"f2dda7c8cf878054bdff6943a479fe3e7d41ba74079089670e8e0a2bf680220c",
"3dff263228c025f393b9ec418dc4b0d4796d51d2775500061e566f7fb40a9857",
"eca5e5510e95804fd6af240d4247806e022214b14a7e2d68b825363b846b35f0",
"3489700e2aaee32c4806cf9ad590352db4f35bffeca4a7ec510beaf81069d877",
"60104130ddba5a1c0af212e88c044adedf672aa59d69c5ead20581f79d069346",
"a03e3bcdff4f47bd18b17733c764bfbbddaa247ce6f850c5bf48a5e5e6308da7",
"1bedd9c0ceb91dd745808293591a4896e3be67066dbe267fe6d664733965fe15",
"a3e7ae2761115925e5b367de1684a15f880eba028686d40bcd7d377641b311ee",
"b0ecc848b56af95a7d945e2a97d8466dc8c387468bbb3264c334dd996a953517",
"b0dd44c64e360ca412640fbbd8744483901db12c659ee28b3e752b040e2cba62")
]
Stage 2: library
[library where dll.name : ("win32api*.pyd", "win32process.pyd", "win32security.pyd", "md.cp*-win32.pyd", "win32crypt.pyd", "win32net.pyd")]
Stage 3: network
[network where
event.action : ("disconnect_received", "connection_attempted") and
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
"192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10", "FF00::/8")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard |
event.action | wildcard |
| field:"EventType" kind:wildcard |
process.Ext.relative_file_creation_time | le |
| field:"process.Ext.relative_file_creation_time" kind:le value:"300" |
process.Ext.relative_file_name_modify_time | le |
| field:"process.Ext.relative_file_name_modify_time" kind:le value:"300" |
process.executable | is_not_null | field:"Image" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Python*\python*.exe, ?:\Users\*\AppData\Local\*.exe, ?:\Users\*\Desktop\*.exe, ?:\*\Anaconda?\python*.exe, D:\AppsSvcs\SeaAiSsoDocsService\SeaAiSsoDocsService.exe, D:\AppsSvcs\GenAIServiceCode\GenAIServiceCode.exe, D:\AppsSvcs\GenAIServiceDocs\GenAIServiceDocs.exe, D:\AppsSvcs\SsoAiServiceDocs\SsoAiServiceDocs.exe, ?:\Users\*\AppData\Local\Programs\Python\Python*\python.exe, ?:\ProgramData\checkmk\agent\modules\python*\.venv\Scripts\python.exe, ?:\Users\*\AppData\Local\Packages\PythonSoftwareFoundation.Python.*\LocalCache\local-packages\*\Scripts\dist\LiveLinkATC*.exe | excludes:process.executable |
process.hash.sha256 | eq | b80be3102561bf891454bd52673fdcd49d08b14c17061c077d6a88ca5ba3e9e3, 8e7bbf6e1bc3588f6d13b8372ca1bef37b6758b8a3a17bda424eba140dd4e8fe, 37c3aa7e782e7331d9831ce5df27d80ac8760657ba51beb75a60b93e2d2f138b, bf2cd24734e0aba2495fa8ca138c79df8d8d56309001a69a47abbe55a1872a15, 5a20b73eae6179b4553c2a066afe1ca1d9873bb1005ce1e9459d7edb9c63a280, 3cfb1833ddab2145a62a7b3df311dcf4315d14ddb88f6be1e04557943e920d22, a37e022b30fd8c91ade968373fa0ca714e915a207fe4e93ac5f86fdae289cf3a, c475438563d23dc91dd9bba960b11fa1b194409967648770390f68fed62c1e57, 74991c716e16c5b2ed186096e24b1f739597c48d328a52b85576911aa36ce25c, 0bea60c6a85b369eb237520af21fa47c33f4bcf42d83d3cb0a9c91cfaac89959, 50e109260bbaafa95d107f4bb0a9e54ec3494735c54b6da3885f2f1079e36d5b, cacde2ae530296624adbca7393f84015f0d5cb0e1c1c5a4345b91e3a841dd5f9, 14f1d41be0a0218233b1b823ddb9ed3ac06603c15c56c2f11aa4a286e72c2e4e, 03b8dfcf64c4e9801becb8945cdf1ebc6f3524daf5de75f662204553e97a4f05, ca78c09f7c334844dba28d0d6438ac507d14ad2874c04635cae42d398df4b6fd, 8f067758c753c4d325653f2349bf5f761c4e1b4fb8a4516a152afc2375a88800, 9ad4c8d68a26f6feb2287e9d9895358a5a560ecc34cb3649edade01b054e1dd5, 8f8eaad0cbf91258227c1ed118813d940de56b324d358a9261f1fa18727beac1, a487293c9b2439024db52441bfa2a6220117e461e8124659bd962dcd5eb9ca58, 7e5506b2975365bc490e27bf141593ec6d1da8858311b7dc1872dce1681ed1e5, dc9d9b130c2271fb3d5ebce3f10b84682d7c420ccb72220f7942f40b9e833c82, 273823283ed4d333a585462dba323186bbb436522182488936879aa3af35cfbb, 39813ef813924c17f0b19aef66b7b80987670e39a3f6daae2ef0b5a0b62f71e0, c70fa68e604f91387bbe920971057cb04148c0fed4142124ccd9226abfb93538, afbe4150814176a86abb7192b14465b88a0cbf3a58b512eaa533fb56dccc6077, 7351523031359477a5ac0e6d39b04dec624fd3e990f85e698b6f2a77873963fd, 5ab87d9be556f9ba07686993399ddf36713e3ed453c0ccb36bb6b76c5946d044, a55091876a0682795353e398f1a5f974a2ee5e38ce0fcab79519b9d1ec464db9, bdd94e30ad1f48c3d537aabbe65353ec5b7c80a338c13afb280a4bb9a4d77c58, be4827351259b82b0e347cce4b15ff4b25a63a06c754c2621fbcf7134fc30342, a53af751d32103fab234be6ae680fc0f6057989d8ff1486d8d5b26ccde0b3d70, 1a59794c7c29f4569a0fe87bc9d9ffbf57835358c69f957950cd9718151f1af6, 3d8595f90fb478cb0f3673a4e5162ac054638fe699a3879ad47514cf872077dd, 87c927fb0f347bcb689d115e6515b285302d2253cab727924924b85da9056a9e, ff6b583cfc19ea28e9d3580af49e6db71675a5869e27de5f2940580948258b32, 31f692eaa4a205f52235f43ee69b23c6789b45ed11e5a831e9b9b460c3985867, 3c2e7b09c5bd39f7c0dd7413d497825c4383fe02ad27410c2b7abf315f4fd91d, 129502c5d1e7c5ce49941fda604e654e69235cf5fe856fbf2a610303e8de6e26, b0200d91dda15b6a76be5b57a247247fc5d6b5ba833b8b9f186d89745f1a82dd, 6f463847cc8951b63ae47381e308b380a981ee93e6ccc5a279474a59f2fa0e30, 51291914e0cf34090ed205738f1d98d8a73b3f394094bc7175876e1b1039ceb1, 0149486bdaebe992502756f4c6fb5be6e9fa927598355e33283f517620479fb4, f2dda7c8cf878054bdff6943a479fe3e7d41ba74079089670e8e0a2bf680220c, 3dff263228c025f393b9ec418dc4b0d4796d51d2775500061e566f7fb40a9857, eca5e5510e95804fd6af240d4247806e022214b14a7e2d68b825363b846b35f0, 3489700e2aaee32c4806cf9ad590352db4f35bffeca4a7ec510beaf81069d877, 60104130ddba5a1c0af212e88c044adedf672aa59d69c5ead20581f79d069346, a03e3bcdff4f47bd18b17733c764bfbbddaa247ce6f850c5bf48a5e5e6308da7, 1bedd9c0ceb91dd745808293591a4896e3be67066dbe267fe6d664733965fe15, a3e7ae2761115925e5b367de1684a15f880eba028686d40bcd7d377641b311ee, b0ecc848b56af95a7d945e2a97d8466dc8c387468bbb3264c334dd996a953517, b0dd44c64e360ca412640fbbd8744483901db12c659ee28b3e752b040e2cba62 | excludes:process.hash.sha256 |
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
Suspicious Reading of procfs Syscall File
#This rule detects command lines that reference another process or thread's procfs syscall file. The "/proc/<pid>/syscall" interface exposes the current syscall arguments, stack pointer, and instruction pointer, which can support process discovery and preparation for process injection. Self and thread-self aliases are excluded.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2026/08/25"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/08/31"
[rule]
author = ["Elastic"]
description = """
This rule detects command lines that reference another process or thread's procfs syscall file. The
"/proc/<pid>/syscall" interface exposes the current syscall arguments, stack pointer, and instruction
pointer, which can support process discovery and preparation for process injection. Self and thread-self
aliases are excluded.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Reading of procfs Syscall File"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious Reading of procfs Syscall File
This rule detects Linux utilities reading another process or thread’s `/proc/<pid>/syscall` file, which exposes its active system call, arguments, stack pointer, and instruction pointer and can support process discovery or injection preparation. An attacker may repeatedly run `cat /proc/1234/syscall` to inspect a privileged service’s execution state before selecting it as an injection target.
### Possible investigation steps
- Resolve the referenced PID to its executable, owner, privileges, container or namespace, and service role to determine why it was targeted.
- Review the reader’s full command line, parent process, user, working directory, executable path, hash, signature, and surrounding process tree for evidence of scripts, shells, or unauthorized tooling.
- Correlate nearby activity for repeated procfs enumeration, `ptrace` use, debugger attachment, access to `/proc/<pid>/mem` or `/proc/<pid>/maps`, suspicious signal delivery, and credential or privilege changes.
- Compare the activity with host baselines and approved monitoring or troubleshooting workflows, then examine whether the same user, binary, or command pattern appears on other systems.
- If unexplained or malicious, isolate the host, preserve process and audit telemetry, terminate unauthorized processes, revoke exposed credentials, and investigate the initial access and persistence mechanism.
### False positive analysis
- An administrator troubleshooting a stalled or high-resource process may read its `/proc/<pid>/syscall` file; confirm the target PID, initiating user, parent shell, timing, and alignment with an approved support activity.
- An authorized diagnostic or monitoring script may periodically inspect process syscall state using standard Linux utilities; verify the script path, owner, execution schedule, expected target processes, and consistency with the host’s established baseline.
### Response and remediation
- Isolate the affected Linux host or container while preserving volatile evidence, including the reader process, targeted PID, process tree, open files, network connections, and relevant `/proc` artifacts.
- Terminate unauthorized processes and remove persistence associated with the activity, including malicious systemd units, cron entries, shell startup modifications, container hooks, kernel modules, and altered binaries.
- Revoke credentials or tokens accessible to the implicated accounts and processes, rotate affected secrets, and review privileged accounts for unauthorized SSH keys or sudo configuration changes.
- Escalate immediately to incident response if the activity includes `ptrace`, access to `/proc/<pid>/mem` or `/proc/<pid>/maps`, code injection indicators, privileged-process targeting, credential theft, or similar behavior on multiple systems.
- Rebuild compromised hosts or containers from verified images, restore validated data and configuration, patch exploited software, and confirm that unauthorized files, processes, accounts, and connections are absent before reconnecting them.
- Harden the environment by restricting procfs visibility with `hidepid`, enforcing least privilege and ptrace restrictions, strengthening SELinux or AppArmor policies, limiting debugging tools, and monitoring repeated access to other processes’ procfs files.
"""
references = [
"https://man7.org/linux/man-pages/man5/proc_pid_syscall.5.html",
"https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection"
]
risk_score = 47
rule_id = "6327bdae-4dc4-4e2e-b29d-3fd100af522c"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Platform: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
(
process.name in (
"cat", "less", "more", "head", "tail", "nano", "vi", "vim", "strings", "nvim", "vim.basic",
"vim.tiny", "od", "hexdump", "xxd", "hx", "hexedit", "pager", "tr"
) or
(
process.name in (
"find", "awk", "gawk", "mawk", "nawk", "grep", "fgrep", "rgrep", "xargs", "sed", "tee"
) and
process.args_count <= 20
)
) and
process.command_line like "*/proc/*/syscall*" and
not (
process.command_line like ("*/proc/self/syscall*", "*/proc/thread-self/syscall*") or
process.args like "/proc/*/syscall/comm"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Discovery"
id = "TA0007"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat.technique]]
name = "Process Discovery"
id = "T1057"
reference = "https://attack.mitre.org/techniques/T1057/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
(
process.name in (
"cat", "less", "more", "head", "tail", "nano", "vi", "vim", "strings", "nvim", "vim.basic",
"vim.tiny", "od", "hexdump", "xxd", "hx", "hexedit", "pager", "tr"
) or
(
process.name in (
"find", "awk", "gawk", "mawk", "nawk", "grep", "fgrep", "rgrep", "xargs", "sed", "tee"
) and
process.args_count <= 20
)
) and
process.command_line like "*/proc/*/syscall*" and
not (
process.command_line like ("*/proc/self/syscall*", "*/proc/thread-self/syscall*") or
process.args like "/proc/*/syscall/comm"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args_count | le |
| field:"process.args_count" kind:le value:"20" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*/proc/*/syscall*" |
process.name | in |
| field:"process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | /proc/*/syscall/comm | excludes:process.args field:"process.args" value:"/proc/*/syscall/comm" |
process.command_line | match | /proc/self/syscall, /proc/thread-self/syscall | excludes:process.command_line field:"process.command_line" value:"/proc/self/syscall" field:"process.command_line" value:"/proc/thread-self/syscall" |
Suspicious Unsigned Application Execution via Shell
#Detects when an unsigned binary is executed within the Applications directory via a shell with no command line arguments. Recent Geacon samples have been observed executing second stage payloads in this way via the .zshrc persistence mechanism.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when an unsigned binary is executed within the Applications directory via a shell with no command line
arguments. Recent Geacon samples have been observed executing second stage payloads in this way via the .zshrc
persistence mechanism.
"""
id = "e9aa04eb-7d71-4c6e-aa86-f1f7c3003b67"
license = "Elastic License v2"
name = "Suspicious Unsigned Application Execution via Shell"
os_list = ["macos"]
version = "1.0.5"
query = '''
process where event.type == "start" and event.action == "exec" and
process.executable like "/Applications/*" and process.code_signature.exists == false and
process.args like "/Applications/*" and process.args_count == 1 and
process.parent.name in ("bash", "zsh", "sh") and process.parent.args_count == 0 and
not process.args like~ "/Applications/*.app/*" and
not process.executable == "/Applications/phits/bin/phits334_mac.exe"
'''
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and
process.executable like "/Applications/*" and process.code_signature.exists == false and
process.args like "/Applications/*" and process.args_count == 1 and
process.parent.name in ("bash", "zsh", "sh") and process.parent.args_count == 0 and
not process.args like~ "/Applications/*.app/*" and
not process.executable == "/Applications/phits/bin/phits334_mac.exe"
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | /Applications/*.app/* | excludes:process.args field:"process.args" value:"/Applications/*.app/*" |
process.executable | eq | /Applications/phits/bin/phits334_mac.exe | excludes:process.executable field:"process.executable" value:"/Applications/phits/bin/phits334_mac.exe" |
Unusual High Denied Sensitive Information Policy Blocks Detected
#Detects repeated compliance violation 'BLOCKED' actions coupled with specific policy name such as 'sensitive_information_policy', indicating persistent misuse or attempts to probe the model's denied topics.
Known False Positives
- New model deployments.
- Testing updates to compliance policies.
MITRE ATLAS Coverage
Adversarial-ML threat framework (not MITRE ATT&CK).
| Tactic | Techniques |
|---|---|
| Execution | |
| Privilege Escalation | |
| Defense Evasion |
Rule Body
[metadata]
creation_date = "2024/11/20"
integration = ["aws_bedrock"]
maturity = "production"
updated_date = "2025/11/10"
[rule]
author = ["Elastic"]
description = """
Detects repeated compliance violation 'BLOCKED' actions coupled with specific policy name such as
'sensitive_information_policy', indicating persistent misuse or attempts to probe the model's denied topics.
"""
false_positives = ["New model deployments.", "Testing updates to compliance policies."]
from = "now-60m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Unusual High Denied Sensitive Information Policy Blocks Detected"
note = """## Triage and analysis
### Investigating Unusual High Denied Sensitive Information Policy Blocks Detected
Amazon Bedrock Guardrail is a set of features within Amazon Bedrock designed to help businesses apply robust safety and privacy controls to their generative AI applications.
It enables users to set guidelines and filters that manage content quality, relevancy, and adherence to responsible AI practices.
Through Guardrail, organizations can define "sensitive information filters" to prevent the model from generating content on specific, undesired subjects,
and they can establish thresholds for harmful content categories.
#### Possible investigation steps
- Identify the user account that queried sensitive information and whether it should perform this kind of action.
- Investigate other alerts associated with the user account during the past 48 hours.
- Consider the time of day. If the user is a human (not a program or script), did the activity take place during a normal time of day?
- Examine the account's prompts and responses in the last 24 hours.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking Amazon Bedrock model access, prompts generated, and responses to the prompts by the account in the last 24 hours.
### False positive analysis
- Verify the user account that queried denied topics, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
### 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.
- Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
- Identify any regulatory or legal ramifications related to this activity.
- Review the permissions assigned to the implicated user group or role behind these requests to ensure they are authorized and expected to access bedrock and ensure that the least privilege principle is being followed.
- 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.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",
"https://atlas.mitre.org/techniques/AML.T0051",
"https://atlas.mitre.org/techniques/AML.T0054",
"https://www.elastic.co/security-labs/elastic-advances-llm-security",
]
risk_score = 47
rule_id = "0e1af929-42ed-4262-a846-55a7c54e7c84"
setup = """## Setup
This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:
https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
"""
severity = "medium"
tags = [
"Domain: LLM",
"Data Source: AWS Bedrock",
"Data Source: AWS S3",
"Use Case: Policy Violation",
"Mitre Atlas: T0051",
"Mitre Atlas: T0054",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-aws_bedrock.invocation-*
// Expand multi-valued policy name field
| mv_expand gen_ai.policy.name
| mv_expand gen_ai.policy.action
// Filter for blocked actions related to sensitive info policy
| where
gen_ai.policy.action == "BLOCKED"
and gen_ai.compliance.violation_detected == "true"
and gen_ai.policy.name == "sensitive_information_policy"
// keep only relevant fields
| keep user.id
// count how many times each user triggered a sensitive info block
| stats
Esql.ml_policy_blocked_sensitive_info_count = count()
by user.id
// Filter for users with more than 5 violations
| where Esql.ml_policy_blocked_sensitive_info_count > 5
// sort highest to lowest
| sort Esql.ml_policy_blocked_sensitive_info_count desc
'''
Stages and Predicates
Stage 1: from
from logs-aws_bedrock.invocation-*
Stage 2: mv_expand
| mv_expand gen_ai.policy.name
Stage 3: mv_expand
| mv_expand gen_ai.policy.action
Stage 4: where
| where
gen_ai.policy.action == "BLOCKED"
and gen_ai.compliance.violation_detected == "true"
and gen_ai.policy.name == "sensitive_information_policy"
Stage 5: keep
| keep user.id
Stage 6: stats
| stats
Esql.ml_policy_blocked_sensitive_info_count = count()
by user.id
Stage 7: where
| where Esql.ml_policy_blocked_sensitive_info_count > 5
Stage 8: sort
| sort Esql.ml_policy_blocked_sensitive_info_count desc
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.ml_policy_blocked_sensitive_info_count | STATS Esql.ml_policy_blocked_sensitive_info_count = count() |
user.id | STATS BY |
Unusual Region Name for Okta Privileged Operations Detected
#A machine learning job has identified a user performing privileged operations in Okta from an uncommon geographical location, indicating potential privileged access activity. This could suggest a compromised account, unauthorized access, or an attacker using stolen credentials to escalate privileges.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2025/02/18"
integration = ["pad", "okta"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has identified a user performing privileged operations in Okta from an uncommon geographical
location, indicating potential privileged access activity. This could suggest a compromised account, unauthorized
access, or an attacker using stolen credentials to escalate privileges.
"""
from = "now-1h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_okta_rare_region_name_by_user_ea"
name = "Unusual Region Name for Okta Privileged Operations Detected"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Region Name for Okta Privileged Operations Detected
Okta is a widely used identity management service that controls access to applications and data. Adversaries may exploit stolen credentials to perform privileged operations from unusual locations, bypassing security measures. The detection rule leverages machine learning to identify anomalies in user activity, such as access from uncommon regions, indicating potential unauthorized access or privilege escalation attempts.
### Possible investigation steps
- Review the alert details to identify the user account involved and the specific unusual region from which the privileged operations were detected.
- Check the user's recent login history and activity logs in Okta to determine if there are other instances of access from uncommon regions or any other suspicious activities.
- Verify with the user or their manager whether the access from the unusual region was expected or authorized, and if the user is currently traveling or using a VPN.
- Investigate any recent changes to the user's account, such as password resets or modifications to multi-factor authentication settings, to identify potential signs of compromise.
- Correlate the detected activity with other security logs and alerts to identify any related incidents or patterns that might indicate a broader attack or compromise.
- Assess the risk and impact of the detected activity by determining the specific privileged operations performed and whether any sensitive data or systems were accessed.
- If unauthorized access is confirmed, follow the organization's incident response procedures to contain and remediate the threat, including resetting the user's credentials and reviewing access permissions.
### False positive analysis
- Users traveling for business may trigger false positives if they access Okta from uncommon regions. To manage this, create exceptions for users with known travel patterns by updating their profiles with expected travel locations.
- Remote employees working from different geographical locations than usual can cause false alerts. Implement a process to regularly update the list of approved remote work locations for these users.
- Employees using VPNs that route through different countries might be flagged. Identify and whitelist common VPN exit nodes used by your organization to prevent these false positives.
- Temporary assignments or projects in different regions can lead to alerts. Establish a communication protocol for employees to notify the security team of such assignments, allowing for temporary exceptions to be made.
- Consider time-based analysis to differentiate between legitimate access during business hours and suspicious activity at unusual times, reducing false positives from legitimate users accessing Okta from uncommon regions.
### Response and remediation
- Immediately isolate the affected user account by disabling it to prevent further unauthorized access or privilege escalation.
- Conduct a thorough review of recent privileged operations performed by the affected account to identify any unauthorized changes or access.
- Reset the password for the compromised account and enforce multi-factor authentication (MFA) to enhance security.
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
- Review and update access controls and permissions for the affected account to ensure they align with the principle of least privilege.
- Monitor for any additional suspicious activity across other accounts and systems to identify potential lateral movement or further compromise.
- Document the incident details and response actions taken for future reference and to improve incident response processes."""
references = [
"https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
"https://docs.elastic.co/en/integrations/pad",
]
risk_score = 21
rule_id = "a8f7187f-76d6-4c1d-a1d5-1ff301ccc120"
setup = """## Setup
The rule requires the Privileged Access Detection integration assets to be installed, as well as Okta logs collected by integrations such as Okta.
### Privileged Access Detection Setup
The Privileged Access Detection integration detects privileged access activity by identifying abnormalities in Windows, Linux and Okta events. Anomalies are detected using Elastic's Anomaly Detection feature.
#### Prerequisite Requirements:
- Fleet is required for Privileged Access Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Okta events collected by [Okta](https://docs.elastic.co/en/integrations/okta) integration.
- To add the Okta integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.
#### The following steps should be executed to install assets associated with the Privileged Access Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Privileged Access Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
"Data Source: Okta",
"Use Case: Privileged Access Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Privilege Escalation",
"Resources: Investigation Guide",
]
type = "machine_learning"
[[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 = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[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/"
Windows Service Configuration Hjack
#Identifies suspicious modification of a Windows service configuration using RPC. Adversaries may use this technique to maintain persistence or run with System privileges avoiding logging related to service creation.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[rule]
description = """
Identifies suspicious modification of a Windows service configuration using RPC. Adversaries may use this technique to
maintain persistence or run with System privileges avoiding logging related to service creation.
"""
id = "4a964318-31be-46de-9bc6-fde362e37c60"
license = "Elastic License v2"
name = "Windows Service Configuration Hjack"
os_list = ["windows"]
version = "1.0.4"
query = '''
sequence with maxspan=3m
[registry where event.action == "modification" and process.name : "services.exe" and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath", "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\Parameters\\ServiceDll")] as event0
[any where
(event.category : "library" and not dll.code_signature.status : "trusted" and stringcontains~(event0.registry.data.strings, dll.path)) or
(event.category : "process" and event.action == "start" and process.parent.name : "services.exe" and stringcontains~(event0.registry.data.strings, process.name))]
[registry where event.action == "modification" and process.name : "services.exe" and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath", "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\Parameters\\ServiceDll") and
event0.registry.path == registry.path and registry.data.strings : "?*" and
not stringcontains~(event0.registry.data.strings, registry.data.strings)]
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: registry
[registry where event.action == "modification" and process.name : "services.exe" and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath", "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\Parameters\\ServiceDll")] as event0
Stage 2: any
[any where
(event.category : "library" and not dll.code_signature.status : "trusted" and stringcontains~(event0.registry.data.strings, dll.path)) or
(event.category : "process" and event.action == "start" and process.parent.name : "services.exe" and stringcontains~(event0.registry.data.strings, process.name))]
Stage 3: registry
[registry where event.action == "modification" and process.name : "services.exe" and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath", "HKLM\\SYSTEM\\ControlSet*\\Services\\*\\Parameters\\ServiceDll") and
event0.registry.path == registry.path and registry.data.strings : "?*" and
not stringcontains~(event0.registry.data.strings, registry.data.strings)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.category | wildcard |
| field:"event.category" kind:wildcard |
event0.registry.data.strings | contains |
| field:"event0.registry.data.strings" kind:contains |
event0.registry.path | eq |
| field:"event0.registry.path" kind:eq value:"registry.path" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"services.exe" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"services.exe" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard value:"?*" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
event0.registry.data.strings | contains | registry.data.strings | excludes:event0.registry.data.strings field:"event0.registry.data.strings" value:"registry.data.strings" |
Windows Shortcut File Embedded Object Execution
#Identifies the execution of a script or program extracted from within a Windows shortcut (lnk) file. Adversaries may embed malicious scripts or files in a shortcut file before delivering it to their target in order to trick them into executing the payload.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = """
Identifies the execution of a script or program extracted from within a Windows shortcut (lnk) file. Adversaries may
embed malicious scripts or files in a shortcut file before delivering it to their target in order to trick them into
executing the payload.
"""
id = "8076640d-ec66-4d24-a252-ee2f054e00a1"
license = "Elastic License v2"
name = "Windows Shortcut File Embedded Object Execution"
os_list = ["windows"]
reference = ["https://docs.google.com/presentation/d/13SsBd0wI0PpyH5C8WlnE_DsJjy1KxAjZ5Dmke9FHfRE/"]
version = "1.0.31"
query = '''
sequence with maxspan=60s
[process where event.action == "start" and process.name : "cmd.exe" and
process.command_line :
("*find*.*.lnk*>*&*",
"*.lnk*find*>*&*",
"*dir*/s*/b*.lnk*",
"*dir*.lnk*/s*/b*",
"*for*/f*in*.lnk*",
"*LoadFromFile*.lnk*>*&*",
"*.lnk*do type*",
"*/s*/d*type*.lnk*",
"*.doc.lnk*",
"*.pdf.lnk*")
] by process.entity_id
[file where event.action != "deletion" and process.name : "cmd.exe"] by process.entity_id
[process where event.action == "start" and
not process.executable :
("?:\\Windows\\system32\\attrib.exe",
"?:\\Windows\\SysWOW64\\attrib.exe",
"?:\\Windows\\system32\\find.exe",
"?:\\Windows\\SysWOW64\\find.exe",
"?:\\Windows\\system32\\findstr.exe",
"?:\\Windows\\SysWOW64\\findstr.exe",
"?:\\Windows\\system32\\conhost.exe",
"?:\\Windows\\SysWOW64\\conhost.exe") and
not (process.name : "cmd.exe" and
process.command_line :
("*find*.*.lnk*>*",
"*.lnk*find*>*",
"*dir*/s*/b*.lnk*",
"*dir*.lnk*/s*/b*",
"*for*/f*in*.lnk*",
"*LoadFromFile*.lnk*",
"*.lnk*do type*",
"*/s*/d*type*.lnk*",
"*.doc.lnk*",
"*.pdf.lnk*"))
] by process.parent.entity_id
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[[threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.001"
name = "Malicious Link"
reference = "https://attack.mitre.org/techniques/T1204/001/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and process.name : "cmd.exe" and
process.command_line :
("*find*.*.lnk*>*&*",
"*.lnk*find*>*&*",
"*dir*/s*/b*.lnk*",
"*dir*.lnk*/s*/b*",
"*for*/f*in*.lnk*",
"*LoadFromFile*.lnk*>*&*",
"*.lnk*do type*",
"*/s*/d*type*.lnk*",
"*.doc.lnk*",
"*.pdf.lnk*")
] by process.entity_id
Stage 2: file
[file where event.action != "deletion" and process.name : "cmd.exe"] by process.entity_id
Stage 3: process
[process where event.action == "start" and
not process.executable :
("?:\\Windows\\system32\\attrib.exe",
"?:\\Windows\\SysWOW64\\attrib.exe",
"?:\\Windows\\system32\\find.exe",
"?:\\Windows\\SysWOW64\\find.exe",
"?:\\Windows\\system32\\findstr.exe",
"?:\\Windows\\SysWOW64\\findstr.exe",
"?:\\Windows\\system32\\conhost.exe",
"?:\\Windows\\SysWOW64\\conhost.exe") and
not (process.name : "cmd.exe" and
process.command_line :
("*find*.*.lnk*>*",
"*.lnk*find*>*",
"*dir*/s*/b*.lnk*",
"*dir*.lnk*/s*/b*",
"*for*/f*in*.lnk*",
"*LoadFromFile*.lnk*",
"*.lnk*do type*",
"*/s*/d*type*.lnk*",
"*.doc.lnk*",
"*.pdf.lnk*"))
] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"cmd.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | wildcard | *find*.*.lnk*>*, *.lnk*find*>*, *dir*/s*/b*.lnk*, *dir*.lnk*/s*/b*, *for*/f*in*.lnk*, *LoadFromFile*.lnk*, *.lnk*do type*, */s*/d*type*.lnk*, *.doc.lnk*, *.pdf.lnk* | excludes:process.command_line |
process.name | eq | cmd.exe | excludes:process.name field:"process.name" value:"cmd.exe" |
process.executable | eq | ?:\Windows\system32\attrib.exe, ?:\Windows\SysWOW64\attrib.exe, ?:\Windows\system32\find.exe, ?:\Windows\SysWOW64\find.exe, ?:\Windows\system32\findstr.exe, ?:\Windows\SysWOW64\findstr.exe, ?:\Windows\system32\conhost.exe, ?:\Windows\SysWOW64\conhost.exe | excludes:process.executable |
Windows System Network Connections Discovery
#This rule identifies the execution of commands that can be used to enumerate network connections. Adversaries may attempt to get a listing of network connections to or from a compromised system to identify targets within an environment.
MITRE ATT&CK Coverage
Rule Body
[metadata]
bypass_bbr_timing = true
creation_date = "2023/07/14"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
This rule identifies the execution of commands that can be used to enumerate network connections. Adversaries may
attempt to get a listing of network connections to or from a compromised system to identify targets within an
environment.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Windows System Network Connections Discovery"
risk_score = 21
rule_id = "c4e9ed3e-55a2-4309-a012-bc3c78dad10a"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Rule Type: BBR",
"Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where event.type == "start" and
(
process.name : "netstat.exe" or
(
(
(process.name : "net.exe" or process.pe.original_file_name == "net.exe") or
(
(process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and
not process.parent.name : "net.exe"
)
) and process.args : ("use", "user", "session", "config") and not process.args: ("/persistent:*", "/delete", "\\\\*")
) or
(process.name : "nbtstat.exe" and process.args : "-s*")
) and not user.id : "S-1-5-18"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1016"
name = "System Network Configuration Discovery"
reference = "https://attack.mitre.org/techniques/T1016/"
[[rule.threat.technique]]
id = "T1049"
name = "System Network Connections Discovery"
reference = "https://attack.mitre.org/techniques/T1049/"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[[rule.threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
(
process.name : "netstat.exe" or
(
(
(process.name : "net.exe" or process.pe.original_file_name == "net.exe") or
(
(process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and
not process.parent.name : "net.exe"
)
) and process.args : ("use", "user", "session", "config") and not process.args: ("/persistent:*", "/delete", "\\\\*")
) or
(process.name : "nbtstat.exe" and process.args : "-s*")
) and not user.id : "S-1-5-18"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |