Detection rules › Elastic
Elastic rules: 38
AWS Discovery API Calls via CLI from a Single Resource
#Detects when a single AWS resource is running multiple read-only, discovery API calls in a 10-second window. This behavior could indicate an actor attempting to discover the AWS infrastructure using compromised credentials or a compromised instance. Adversaries may use this information to identify potential targets for further exploitation or to gain a better understanding of the target's infrastructure.
Known False Positives
- Administrators or automated systems may legitimately perform multiple `Describe`, `List`, `Get` and `Generate` API calls in a short time frame. Verify the user identity and the purpose of the API calls to determine if the behavior is expected.
MITRE ATT&CK Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- AWS CloudTrail Log Evasion (Elastic)
- AWS EC2 Instance Interaction with IAM Service (Elastic)
- AWS IAM API Calls via Temporary Session Tokens (Elastic)
- AWS Lambda Event Source Mapping Creation (Elastic)
- AWS Lambda Function Created or Updated (Elastic)
- AWS Lambda Function High-Frequency Invocation by a Single Principal (Elastic)
- AWS Lambda Function Invoked by an Unusual Principal (Elastic)
- AWS Lambda Function Invoked Cross-Account (Elastic)
Rule Body
[metadata]
creation_date = "2024/11/04"
integration = ["aws"]
maturity = "production"
min_stack_comments = "Changing min stack to 9.3.0, the latest minimum supported version for 9.X releases."
min_stack_version = "9.3.0"
updated_date = "2026/07/20"
[rule]
author = ["Elastic"]
description = """
Detects when a single AWS resource is running multiple read-only, discovery API calls in a 10-second window. This
behavior could indicate an actor attempting to discover the AWS infrastructure using compromised credentials or a
compromised instance. Adversaries may use this information to identify potential targets for further exploitation or to
gain a better understanding of the target's infrastructure.
"""
false_positives = [
"""
Administrators or automated systems may legitimately perform multiple `Describe`, `List`, `Get` and `Generate` API
calls in a short time frame. Verify the user identity and the purpose of the API calls to determine if the behavior
is expected.
""",
]
from = "now-6m"
language = "esql"
license = "Elastic License v2"
name = "AWS Discovery API Calls via CLI from a Single Resource"
note = """## Triage and analysis
### Investigating AWS Discovery API Calls via CLI from a Single Resource
This rule detects when a single AWS identity executes more than five unique discovery-related API calls (`Describe*`, `List*`, `Get*`, or `Generate*`) within a 10-second window using the AWS CLI.
High volumes of diverse “read-only” API calls in such a short period can indicate scripted reconnaissance, often an early phase of compromise after credential exposure or access to a compromised EC2 instance.
### Possible investigation steps
**Identify the actor and session context**
- **Actor ARN (`aws.cloudtrail.user_identity.arn`)**: Determine which IAM user, role, or service principal performed the actions.
- Check whether this identity normally performs enumeration activity or belongs to automation infrastructure.
- **Identity type (`Esql.aws_cloudtrail_user_identity_arn_type`)**: Validate if the caller is a human IAM user, assumed role, or federated identity. Unusual types (e.g., temporary credentials from an unfamiliar role) may indicate lateral movement.
- **Access key (`Esql.aws_cloudtrail_user_identity_access_key_id_values`)** – Identify which specific access key or temporary credential was used.
- If multiple suspicious keys are found, use AWS IAM console or `aws iam list-access-keys` to determine when they were last used or rotated.
- **Account (`Esql.cloud_account_id_values`)** – Confirm which AWS account was affected and whether it matches the intended operational context (e.g., production vs. sandbox).
**Assess the API call pattern and intent**
- **Distinct action count (`Esql.event_action_count_distinct`)**: Note how many unique API calls occurred within each 10-second window. Counts far above normal operational baselines may indicate scripted reconnaissance.
- **API actions (`Esql.event_action_values`)**: Review which discovery APIs were invoked.
- Focus on services such as EC2 (`DescribeInstances`), IAM (`ListRoles`, `ListAccessKeys`), S3 (`ListBuckets`), and KMS (`ListKeys`), which adversaries frequently query to map assets.
- **Service providers (`Esql.event_provider_values`)**: Identify which AWS services were targeted.
- Multi-service enumeration (IAM + EC2 + S3) suggests broad discovery rather than a specific diagnostic task.
- **Time window (`Esql.time_window_date_trunc`)**: Verify whether activity occurred during normal maintenance windows or outside expected hours.
**Analyze the source and origin**
- **Source IP (`Esql.source_ip_values`)**: Check the originating IPs to determine whether the calls came from a known internal host, an EC2 instance, or an unfamiliar external network.
- Compare with known corporate CIDR ranges, VPC flow logs, or guardrail baselines.
- **Source organization (`Esql.source_as_organization_name_values`)**: Review the associated ASN or organization.
- If the ASN belongs to a commercial ISP or VPN service, investigate possible credential compromise or remote attacker usage.
**Correlate with additional events**
- Search CloudTrail for the same `aws.cloudtrail.user_identity.arn` or `aws_cloudtrail_user_identity_access_key_id_values` within ±30 minutes.
- Look for follow-on actions such as `GetCallerIdentity`, `AssumeRole`, `CreateAccessKey`, or data access (`GetObject`, `CopySnapshot`).
- Correlate this enumeration with authentication anomalies or privilege-related findings.
- Cross-reference `Esql.cloud_account_id_values` with other alerts for lateral or privilege escalation patterns.
### False positive analysis
Legitimate, high-frequency API activity may originate from:
- **Inventory or compliance automation**: Scripts or tools such as AWS Config, Cloud Custodian, or custom CMDB collection performing periodic Describe/List calls.
- **Operational monitoring systems**: DevOps pipelines, Terraform, or deployment verifiers enumerating resources.
- **Security tooling**: Security scanners performing asset discovery across services.
Validate by confirming:
- Whether the `aws.cloudtrail.user_identity.arn` corresponds to a documented automation or monitoring identity.
- That the observed `Esql.event_action_values` match known inventory or cost-reporting workflows.
- Timing alignment with approved maintenance schedules.
### Response and remediation
If the activity is unexpected or originates from unrecognized credentials, follow AWS’s incident-handling guidance:
**Contain**
- Temporarily disable or rotate the access key (`Esql.aws_cloudtrail_user_identity_access_key_id_values`) using IAM.
- Restrict outbound connectivity for the instance or resource from which the API calls originated.
**Investigate**
- Retrieve full CloudTrail logs for the actor and `Esql.time_window_date_trunc` interval.
- Identify any subsequent write or privilege-modification actions.
- Review associated IAM policies for excessive permissions.
**Recover and Harden**
- Rotate credentials, enforce MFA on human users, and tighten IAM role trust policies.
- Implement AWS Config rules or SCPs to monitor and restrict large-scale enumeration.
**Post-Incident Actions**
- Document the finding and response in your organization’s IR management system.
- Update detection logic or allow-lists for known benign automation.
- Validate recovery by confirming no new suspicious discovery bursts occur.
### Additional information
- **AWS Documentation**
- [CloudTrail Event Reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)
- [AWS Security Incident Response Guide](https://docs.aws.amazon.com/whitepapers/latest/aws-security-incident-response-guide/aws-security-incident-response-guide.pdf)
- **AWS Playbook Resources**
- [AWS Incident Response Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/tree/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks)
- [AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework)
"""
references = [
"https://stratus-red-team.cloud/attack-techniques/AWS/aws.discovery.ec2-enumerate-from-instance/",
"https://kudelskisecurity.com/research/investigating-two-variants-of-the-trivy-supply-chain-compromise",
]
risk_score = 21
rule_id = "74f45152-9aee-11ef-b0a5-f661ea17fbcd"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: AWS EC2",
"Data Source: AWS IAM",
"Data Source: AWS S3",
"Data Source: AWS Cloudtrail",
"Data Source: AWS RDS",
"Data Source: AWS Lambda",
"Data Source: AWS STS",
"Data Source: AWS KMS",
"Data Source: AWS SES",
"Data Source: AWS Cloudfront",
"Data Source: AWS DynamoDB",
"Data Source: AWS Elastic Load Balancing",
"Data Source: AWS Organizations",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-aws.cloudtrail-* metadata _id, _version, _index
// create time window buckets of 10 seconds
| eval Esql.time_window_date_trunc = date_trunc(10 seconds, @timestamp)
| where
data_stream.dataset == "aws.cloudtrail"
// exclude service account and console behavior
and source.ip IS NOT NULL
and aws.cloudtrail.session_credential_from_console IS NULL
and event.provider in (
"iam.amazonaws.com",
"ec2.amazonaws.com",
"s3.amazonaws.com",
"rds.amazonaws.com",
"lambda.amazonaws.com",
"dynamodb.amazonaws.com",
"kms.amazonaws.com",
"cloudfront.amazonaws.com",
"elasticloadbalancing.amazonaws.com",
"cloudtrail.amazonaws.com",
"sts.amazonaws.com",
"ses.amazonaws.com",
"organizations.amazonaws.com"
)
// ignore AWS service actions
and aws.cloudtrail.user_identity.type != "AWSService"
// filter for aws-cli specifically
and user_agent.name == "aws-cli"
// exclude DescribeCapacityReservations events related to AWS Config
and event.action != "DescribeCapacityReservations"
and user.name != "AWSServiceRoleForConfig"
// filter for Describe, Get, List, and Generate API calls
| where true in (
starts_with(event.action, "Describe"),
starts_with(event.action, "Get"),
starts_with(event.action, "List"),
starts_with(event.action, "Generate")
)
// keep relevant fields (preserving ECS fields and computed time window)
| keep
@timestamp,
Esql.time_window_date_trunc,
event.action,
aws.cloudtrail.user_identity.arn,
aws.cloudtrail.user_identity.type,
aws.cloudtrail.user_identity.access_key_id,
source.ip,
cloud.account.id,
event.provider,
user_agent.name,
source.as.organization.name,
cloud.region,
data_stream.namespace
// count the number of unique API calls per time window and actor
| stats
Esql.event_action_count_distinct = count_distinct(event.action),
Esql.event_action_values = VALUES(event.action),
Esql.event_timestamp_values = VALUES(@timestamp),
Esql.aws_cloudtrail_user_identity_type_values = VALUES(aws.cloudtrail.user_identity.type),
Esql.aws_cloudtrail_user_identity_access_key_id_values = VALUES(aws.cloudtrail.user_identity.access_key_id),
Esql.source_ip_values = VALUES(source.ip),
Esql.cloud_account_id_values = VALUES(cloud.account.id),
Esql.event_provider_values = VALUES(event.provider),
Esql.user_agent_name_values = VALUES(user_agent.name),
Esql.source_as_organization_name_values = VALUES(source.as.organization.name),
Esql.cloud_region_values = VALUES(cloud.region),
Esql.data_stream_namespace_values = VALUES(data_stream.namespace)
by Esql.time_window_date_trunc, aws.cloudtrail.user_identity.arn
// filter for more than 5 unique API calls per 10s window
| where Esql.event_action_count_distinct > 5
| keep
aws.cloudtrail.user_identity.arn,
Esql.time_window_date_trunc,
Esql.event_action_count_distinct,
Esql.event_action_values,
Esql.event_timestamp_values,
Esql.aws_cloudtrail_user_identity_type_values,
Esql.aws_cloudtrail_user_identity_access_key_id_values,
Esql.source_ip_values,
Esql.cloud_account_id_values,
Esql.event_provider_values,
Esql.user_agent_name_values,
Esql.source_as_organization_name_values,
Esql.cloud_region_values,
Esql.data_stream_namespace_values
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[rule.threat.technique.subtechnique]]
id = "T1087.004"
name = "Cloud Account"
reference = "https://attack.mitre.org/techniques/T1087/004/"
[[rule.threat.technique]]
id = "T1526"
name = "Cloud Service Discovery"
reference = "https://attack.mitre.org/techniques/T1526/"
[[rule.threat.technique]]
id = "T1580"
name = "Cloud Infrastructure Discovery"
reference = "https://attack.mitre.org/techniques/T1580/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[rule.investigation_fields]
field_names = [
"Esql.event_action_count_distinct",
"Esql.time_window_date_trunc",
"aws.cloudtrail.user_identity.arn",
"Esql.aws_cloudtrail_user_identity_type_values",
"Esql.aws_cloudtrail_user_identity_access_key_id_values",
"Esql.source_ip_values",
"Esql.source_as_organization_name_values",
"Esql.event_provider_values",
"Esql.event_action_values",
"Esql.event_timestamp_values",
"Esql.cloud_account_id_values",
"Esql.cloud_region_values",
"Esql.data_stream_namespace_values",
]
Stages and Predicates
Stage 1: from
from logs-aws.cloudtrail-* metadata _id, _version, _index
Stage 2: eval
| eval Esql.time_window_date_trunc = date_trunc(10 seconds, @timestamp)
Stage 3: where
| where
data_stream.dataset == "aws.cloudtrail"
and source.ip IS NOT NULL
and aws.cloudtrail.session_credential_from_console IS NULL
and event.provider in (
"iam.amazonaws.com",
"ec2.amazonaws.com",
"s3.amazonaws.com",
"rds.amazonaws.com",
"lambda.amazonaws.com",
"dynamodb.amazonaws.com",
"kms.amazonaws.com",
"cloudfront.amazonaws.com",
"elasticloadbalancing.amazonaws.com",
"cloudtrail.amazonaws.com",
"sts.amazonaws.com",
"ses.amazonaws.com",
"organizations.amazonaws.com"
)
and aws.cloudtrail.user_identity.type != "AWSService"
and user_agent.name == "aws-cli"
and event.action != "DescribeCapacityReservations"
and user.name != "AWSServiceRoleForConfig"
Stage 4: where
| where true in (
starts_with(event.action, "Describe"),
starts_with(event.action, "Get"),
starts_with(event.action, "List"),
starts_with(event.action, "Generate")
)
Stage 5: keep
| keep
@timestamp,
Esql.time_window_date_trunc,
event.action,
aws.cloudtrail.user_identity.arn,
aws.cloudtrail.user_identity.type,
aws.cloudtrail.user_identity.access_key_id,
source.ip,
cloud.account.id,
event.provider,
user_agent.name,
source.as.organization.name,
cloud.region,
data_stream.namespace
Stage 6: stats
| stats
Esql.event_action_count_distinct = count_distinct(event.action),
Esql.event_action_values = VALUES(event.action),
Esql.event_timestamp_values = VALUES(@timestamp),
Esql.aws_cloudtrail_user_identity_type_values = VALUES(aws.cloudtrail.user_identity.type),
Esql.aws_cloudtrail_user_identity_access_key_id_values = VALUES(aws.cloudtrail.user_identity.access_key_id),
Esql.source_ip_values = VALUES(source.ip),
Esql.cloud_account_id_values = VALUES(cloud.account.id),
Esql.event_provider_values = VALUES(event.provider),
Esql.user_agent_name_values = VALUES(user_agent.name),
Esql.source_as_organization_name_values = VALUES(source.as.organization.name),
Esql.cloud_region_values = VALUES(cloud.region),
Esql.data_stream_namespace_values = VALUES(data_stream.namespace)
by Esql.time_window_date_trunc, aws.cloudtrail.user_identity.arn
Stage 7: where
| where Esql.event_action_count_distinct > 5
Stage 8: keep
| keep
aws.cloudtrail.user_identity.arn,
Esql.time_window_date_trunc,
Esql.event_action_count_distinct,
Esql.event_action_values,
Esql.event_timestamp_values,
Esql.aws_cloudtrail_user_identity_type_values,
Esql.aws_cloudtrail_user_identity_access_key_id_values,
Esql.source_ip_values,
Esql.cloud_account_id_values,
Esql.event_provider_values,
Esql.user_agent_name_values,
Esql.source_as_organization_name_values,
Esql.cloud_region_values,
Esql.data_stream_namespace_values
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
aws.cloudtrail.user_identity.arn | KEEP aws.cloudtrail.user_identity.arn |
Esql.time_window_date_trunc | KEEP Esql.time_window_date_trunc |
Esql.event_action_count_distinct | KEEP Esql.event_action_count_distinct |
Esql.event_action_values | KEEP Esql.event_action_values |
Esql.event_timestamp_values | KEEP Esql.event_timestamp_values |
Esql.aws_cloudtrail_user_identity_type_values | KEEP Esql.aws_cloudtrail_user_identity_type_values |
Esql.aws_cloudtrail_user_identity_access_key_id_values | KEEP Esql.aws_cloudtrail_user_identity_access_key_id_values |
Esql.source_ip_values | KEEP Esql.source_ip_values |
Esql.cloud_account_id_values | KEEP Esql.cloud_account_id_values |
Esql.event_provider_values | KEEP Esql.event_provider_values |
Esql.user_agent_name_values | KEEP Esql.user_agent_name_values |
Esql.source_as_organization_name_values | KEEP Esql.source_as_organization_name_values |
Esql.cloud_region_values | KEEP Esql.cloud_region_values |
Esql.data_stream_namespace_values | KEEP Esql.data_stream_namespace_values |
Connection to Commonly Abused Free SSL Certificate Providers
#Identifies unusual processes connecting to domains using known free SSL certificates. Adversaries may employ a known encryption algorithm to conceal command and control traffic.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 3: Network connection |
Rule Body
[metadata]
creation_date = "2020/11/04"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies unusual processes connecting to domains using known free SSL certificates. Adversaries may employ a known
encryption algorithm to conceal command and control traffic.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.network-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Connection to Commonly Abused Free SSL Certificate Providers"
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 Connection to Commonly Abused Free SSL Certificate Providers
Free SSL certificates, like those from Let's Encrypt, enable secure web traffic encryption. Adversaries exploit these to mask malicious command and control (C2) communications. The detection rule identifies unusual Windows processes accessing domains with such certificates, excluding common false positives, to flag potential misuse of encrypted channels for C2 activities.
### Possible investigation steps
- Review the process executable path to confirm if it is a native Windows process and assess the legitimacy of its network activity. Focus on paths like "C:\\Windows\\System32\\*.exe" and "C:\\Windows\\SysWOW64\\*.exe".
- Investigate the specific domain accessed by the process, such as those ending in "*.letsencrypt.org" or "*.sslforfree.com", to determine if it is associated with known malicious activity or if it is a legitimate service.
- Check the process name against the list of excluded false positives, ensuring it is not "svchost.exe", "MicrosoftEdge*.exe", or "msedge.exe", which are common and typically benign.
- Analyze the network traffic associated with the process to identify any unusual patterns or anomalies that could indicate command and control activity.
- Correlate the alert with other security events or logs from the same host to identify any additional indicators of compromise or related suspicious activities.
### False positive analysis
- Windows system processes like svchost.exe and MicrosoftEdge.exe are common false positives due to their legitimate network activities. These can be excluded from the detection rule to reduce noise.
- Regularly update the list of excluded processes to include any new system processes that are verified to have legitimate reasons for accessing domains with free SSL certificates.
- Monitor and analyze network traffic patterns to identify any additional processes that consistently generate false positives, and consider adding them to the exclusion list if they are deemed non-threatening.
- Use process whitelisting to allow known safe applications that frequently access these domains, ensuring they do not trigger alerts unnecessarily.
- Implement a review process to periodically reassess the exclusion list, ensuring it remains relevant and does not inadvertently allow malicious activities to go undetected.
### Response and remediation
- Isolate the affected system from the network to prevent further malicious communication and potential lateral movement.
- Terminate any suspicious processes identified in the alert that are not typically associated with network activity, such as those running from unusual paths or with unexpected network connections.
- Conduct a thorough review of the system's recent activity logs to identify any unauthorized changes or additional indicators of compromise.
- Remove any malicious files or executables found on the system, ensuring that all remnants of the threat are eradicated.
- Restore the system from a known good backup if any critical system files or configurations have been altered.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
risk_score = 21
rule_id = "e3cf38fa-d5b8-46cc-87f9-4a7513e4281d"
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 22 - DNS Query](https://ela.st/sysmon-event-22-setup)
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
network where host.os.type == "windows" and network.protocol == "dns" and
/* Add new free SSL certificate provider domains here */
dns.question.name : ("*letsencrypt.org", "*.sslforfree.com", "*.zerossl.com", "*.freessl.org") and
/* Native Windows process paths that are unlikely to have network connections to domains secured using free SSL certificates */
process.executable : ("C:\\Windows\\System32\\*.exe",
"C:\\Windows\\System\\*.exe",
"C:\\Windows\\SysWOW64\\*.exe",
"C:\\Windows\\Microsoft.NET\\Framework*\\*.exe",
"C:\\Windows\\explorer.exe",
"C:\\Windows\\notepad.exe") and
/* Insert noisy false positives here */
not process.name : ("svchost.exe", "MicrosoftEdge*.exe", "msedge.exe")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1573"
name = "Encrypted Channel"
reference = "https://attack.mitre.org/techniques/T1573/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Stages and Predicates
Stage 1: network
network where host.os.type == "windows" and network.protocol == "dns" and
dns.question.name : ("*letsencrypt.org", "*.sslforfree.com", "*.zerossl.com", "*.freessl.org") and
process.executable : ("C:\\Windows\\System32\\*.exe",
"C:\\Windows\\System\\*.exe",
"C:\\Windows\\SysWOW64\\*.exe",
"C:\\Windows\\Microsoft.NET\\Framework*\\*.exe",
"C:\\Windows\\explorer.exe",
"C:\\Windows\\notepad.exe") and
not process.name : ("svchost.exe", "MicrosoftEdge*.exe", "msedge.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dns.question.name | wildcard |
| field:"QueryName" kind:wildcard |
network.protocol | eq |
| field:"DestinationPortName" kind:eq value:"dns" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.name | wildcard | svchost.exe, MicrosoftEdge*.exe, msedge.exe | excludes:process.name field:"process.name" value:"svchost.exe" field:"process.name" value:"MicrosoftEdge*.exe" field:"process.name" value:"msedge.exe" |
Direct Interactive Kubernetes API Request by Common Utilities
#This rule leverages a combination of Defend for Containers and Kubernetes audit logs to detect the execution of direct interactive Kubernetes API requests. An adversary may need to execute direct interactive Kubernetes API requests to gain access to the Kubernetes API server or other resources within the cluster. These requests are often used to enumerate the Kubernetes API server or other resources within the cluster, and may indicate an attempt to move laterally within the cluster. Note that this rule may not trigger if the authorization token of the request is expanded within the process argument list, as the length of the "process.args" field may lead to the field being ignored.
Known False Positives
- There is a potential for false positives if the direct interactive Kubernetes API requests are used for legitimate purposes, such as debugging or troubleshooting. 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.
- There is a risk of false positives if there are several containers named the same, as the rule may correlate the request to the wrong container.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Discovery |
Rule Body
[metadata]
creation_date = "2026/01/21"
integration = ["cloud_defend", "kubernetes"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
This rule leverages a combination of Defend for Containers and Kubernetes audit logs to detect the execution of direct
interactive Kubernetes API requests. An adversary may need to execute direct interactive Kubernetes API requests to gain
access to the Kubernetes API server or other resources within the cluster. These requests are often used to enumerate
the Kubernetes API server or other resources within the cluster, and may indicate an attempt to move laterally within
the cluster. Note that this rule may not trigger if the authorization token of the request is expanded within the process
argument list, as the length of the "process.args" field may lead to the field being ignored.
"""
false_positives = [
"""
There is a potential for false positives if the direct interactive Kubernetes API requests are used for legitimate purposes,
such as debugging or troubleshooting. 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.
""",
"""
There is a risk of false positives if there are several containers named the same, as the rule may correlate the request
to the wrong container.
""",
]
from = "now-6m"
index = ["logs-cloud_defend.process*", "logs-kubernetes.audit_logs-*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Direct Interactive Kubernetes API Request by Common Utilities"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Direct Interactive Kubernetes API Request by Common Utilities
This detection links an interactive invocation of common networking utilities or kubectl inside a container to a near-simultaneous Kubernetes API response, indicating hands-on-keyboard access to the API server for discovery or lateral movement. A common attacker pattern is compromising a pod, reading its mounted service account token, then running curl or kubectl interactively to query /api or /apis endpoints to list pods and secrets and map cluster scope.
### Possible investigation steps
- From Kubernetes audit logs linked to the pod, capture the authenticated principal, namespace, verbs, and request URIs to determine whether the activity focused on discovery or sensitive resources like secrets or RBAC objects.
- Correlate the interactive container activity with kubelet exec/attach or terminal session telemetry to identify who initiated the session and through which source IP or control-plane endpoint.
- Inspect the pod’s service account by validating access to the mounted token path and enumerating its RoleBindings and ClusterRoleBindings to quantify effective privileges and decide on immediate revocation or rotation.
- Review the container image provenance and available shell history or command logs to confirm use of networking utilities or kubectl and identify any reads of secrets, kubeconfig files, or /api and /apis endpoints.
- Expand the time window to find prior or subsequent API calls from the same pod, namespace, or node, and quarantine or cordon the workload if you observe sustained enumeration or cross-namespace access.
### False positive analysis
- An operator uses kubectl exec -it to enter a pod and runs kubectl or curl to list resources or verify RBAC, producing interactive process starts and near-simultaneous Kubernetes audit responses that are expected during troubleshooting.
- During routine connectivity or certificate checks, an engineer attaches to a container that includes curl/openssl/socat/ncat and interactively tests the Kubernetes API server endpoint, generating correlated audit events without malicious intent.
### Response and remediation
- Immediately isolate the implicated pod by terminating the interactive shell and curl/kubectl processes, applying a deny-all NetworkPolicy in its namespace, and temporarily blocking pod egress to the kube-apiserver address.
- Revoke and rotate the service account credentials used by the pod, invalidate the token at /var/run/secrets/kubernetes.io/serviceaccount/token, and remove excess RoleBindings or ClusterRoleBindings tied to that identity.
- Delete and restore the workload from a trusted image that excludes curl/wget/openssl/socat/ncat, with automountServiceAccountToken disabled and least-privilege RBAC enforced.
- Escalate to incident response if the pod read Secrets or ConfigMaps, modified RBAC objects, attempted create/patch/delete on cluster-scoped resources, or originated from an unapproved operator workstation or bastion.
- Harden by restricting kubectl exec/attach to a small admin group with MFA, enabling admission controls (Pod Security Admission, Gatekeeper, or Kyverno) to block shells or kubectl/netcat in images, and applying egress NetworkPolicies so only approved namespaces can reach https://kubernetes.default.svc.
"""
risk_score = 47
rule_id = "9d312839-339a-4e10-af2e-a49b15b15d13"
severity = "medium"
tags = [
"Data Source: Elastic Defend for Containers",
"Data Source: Kubernetes",
"Domain: Container",
"Domain: Kubernetes",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
sequence with maxspan=1s
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
process.name in ("wget", "curl", "openssl", "socat", "ncat", "kubectl") or
(
/* Account for tools that execute utilities as a subprocess, in this case the target utility name will appear as a process arg */
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in (
"wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget",
"ssl_client", "/bin/ssl_client", "/usr/bin/ssl_client", "/usr/local/bin/ssl_client",
"curl", "/bin/curl", "/usr/bin/curl", "/usr/local/bin/curl",
"openssl", "/bin/openssl", "/usr/bin/openssl", "/usr/local/bin/openssl",
"socat", "/bin/socat", "/usr/bin/socat", "/usr/local/bin/socat",
"ncat", "/bin/ncat", "/usr/bin/ncat", "/usr/local/bin/ncat",
"kubectl", "/bin/kubectl", "/usr/bin/kubectl", "/usr/local/bin/kubectl"
) and
/* default exclusion list to not FP on default multi-process commands */
not process.args in (
"which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and process.interactive == true and container.id like "*"
] by orchestrator.resource.name
[any where data_stream.dataset == "kubernetes.audit_logs" and kubernetes.audit.stage in ("ResponseComplete", "ResponseStarted")] by `kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name`
'''
[[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]]
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.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1s, correlated by kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name, orchestrator.resource.name.
Stage 1: process
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
process.name in ("wget", "curl", "openssl", "socat", "ncat", "kubectl") or
(
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in (
"wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget",
"ssl_client", "/bin/ssl_client", "/usr/bin/ssl_client", "/usr/local/bin/ssl_client",
"curl", "/bin/curl", "/usr/bin/curl", "/usr/local/bin/curl",
"openssl", "/bin/openssl", "/usr/bin/openssl", "/usr/local/bin/openssl",
"socat", "/bin/socat", "/usr/bin/socat", "/usr/local/bin/socat",
"ncat", "/bin/ncat", "/usr/bin/ncat", "/usr/local/bin/ncat",
"kubectl", "/bin/kubectl", "/usr/bin/kubectl", "/usr/local/bin/kubectl"
) and
not process.args in (
"which", "/bin/which", "/usr/bin/which", "/usr/local/bin/which",
"man", "/bin/man", "/usr/bin/man", "/usr/local/bin/man",
"chmod", "/bin/chmod", "/usr/bin/chmod", "/usr/local/bin/chmod",
"chown", "/bin/chown", "/usr/bin/chown", "/usr/local/bin/chown"
)
)
) and process.interactive == true and container.id like "*"
] by orchestrator.resource.name
Stage 2: any
[any where data_stream.dataset == "kubernetes.audit_logs" and kubernetes.audit.stage in ("ResponseComplete", "ResponseStarted")] by `kubernetes.audit.user.extra.authentication.kubernetes.io/pod-name`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
container.id | wildcard |
| field:"container.id" kind:wildcard value:"*" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"kubernetes.audit_logs" |
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
kubernetes.audit.stage | in |
| field:"kubernetes.audit.stage" kind:in |
process.args | in |
| field:"process.args" kind:in |
process.interactive | eq |
| field:"process.interactive" kind:eq value:"true" |
process.name | in |
| field:"process_basename" kind:in |
Entra ID Conditional Access MFA Bypass with Unusual User, Client and Source ASN
#Identifies the first observed instance of a Microsoft first-party public client application acquiring a Microsoft Graph token using single-factor (password-only) authentication while an MFA Conditional Access grant control went unenforced, for a given user, application, and source autonomous system (ASN). This pattern is associated with the Conditional Access "resource exclusion" bypass: when a tenant's "all resources" Conditional Access policy contains at least one application exclusion, Entra ID issues tokens for low-privilege baseline scopes (User.Read, openid, profile, email) to any resource, including Microsoft Graph, without enforcing the policy's grant controls (such as MFA). An adversary holding only a stolen password can therefore obtain a Graph token through a trusted first-party public client (for example, Microsoft Bing Search) and enumerate directory objects, even though the tenant requires MFA. Critically, the overall conditional_access_status is never "failure" for this technique (the sign-in is not blocked); it is reported as "success" or "notApplied" depending on what other policies exist in the tenant, so detections that key on Conditional Access failures will not observe it. The reliable fingerprint is in the per-policy results: a policy whose enforced grant control is MFA reports a result of "notApplied" for this sign-in, meaning the MFA requirement was silently not enforced while the single-factor, password-only sign-in still succeeded.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence | |
| Stealth | |
| Defense Impairment | |
| Credential Access |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/06/22"
integration = ["azure"]
maturity = "production"
updated_date = "2026/06/22"
[rule]
author = ["Elastic"]
description = """
Identifies the first observed instance of a Microsoft first-party public client application acquiring a Microsoft Graph
token using single-factor (password-only) authentication while an MFA Conditional Access grant control went unenforced,
for a given user, application, and source autonomous system (ASN). This pattern is associated with the Conditional
Access "resource exclusion" bypass: when a tenant's "all resources" Conditional Access policy contains at least one
application exclusion, Entra ID issues tokens for low-privilege baseline scopes (User.Read, openid, profile, email) to
any resource, including Microsoft Graph, without enforcing the policy's grant controls (such as MFA). An adversary
holding only a stolen password can therefore obtain a Graph token through a trusted first-party public client (for
example, Microsoft Bing Search) and enumerate directory objects, even though the tenant requires MFA. Critically, the
overall conditional_access_status is never "failure" for this technique (the sign-in is not blocked); it is reported as
"success" or "notApplied" depending on what other policies exist in the tenant, so detections that key on Conditional
Access failures will not observe it. The reliable fingerprint is in the per-policy results: a policy whose enforced
grant control is MFA reports a result of "notApplied" for this sign-in, meaning the MFA requirement was silently not
enforced while the single-factor, password-only sign-in still succeeded.
"""
from = "now-9m"
index = ["filebeat-*", "logs-azure.signinlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID Conditional Access MFA Bypass with Unusual User, Client and Source ASN"
note = """## Triage and analysis
### Investigating Entra ID Conditional Access MFA Bypass with Unusual User, Client and Source ASN
This rule fires the first time a user signs in to Microsoft Graph through a Microsoft first-party app using single-factor, password-only authentication, keyed on the user, app, and source ASN within the history window. First-party apps are matched by their owner tenant (`app_owner_tenant_id` `f8cdef31-a31e-4b4a-93e4-5f571e91255a`) instead of a fixed client ID list, so switching to a different first-party client does not get around the detection. The password-only form of this bypass depends on first-party apps: they are pre-consented in every tenant and cannot be blocked, so a stolen password is enough to use one. A third-party or confidential client would mean the attacker already controls an app in the tenant, which is a different scenario.
The behavior comes from the Conditional Access resource-exclusion bypass. If an "all resources" CA policy excludes even one application, Entra ID issues tokens for baseline scopes (User.Read, openid, profile, email) to Microsoft Graph without applying the policy's grant controls, so MFA is skipped. Default directory permissions then let that `User.Read` token read groups, service principals, directory roles, and devices.
Do not read too much into the top-level `azure.signinlogs.properties.conditional_access_status` here. It shows `success` or `notApplied` (never `failure`, since the sign-in is not blocked), and which one you see depends on the other policies in the tenant. The useful evidence is in `azure.signinlogs.properties.applied_conditional_access_policies`: an MFA grant control (`enforced_grant_controls` of `Mfa`) that came back `notApplied` on a sign-in that was still single-factor and password-based. That is what the query keys on.
### Possible investigation steps
- Review `azure.signinlogs.properties.user_principal_name` to identify the user and whether they hold privileged roles or are otherwise a high-value target.
- Confirm the client via `azure.signinlogs.properties.app_display_name` and `azure.signinlogs.properties.app_id`. End-user authentication of clients such as Microsoft Bing Search to Microsoft Graph is uncommon and warrants scrutiny; everyday clients (Microsoft Teams, OneDrive, Outlook Mobile) are far more likely to be benign.
- Examine `source.ip`, `source.as.number`, `source.as.organization.name`, and `source.geo.*` for hosting-provider or geographic anomalies inconsistent with the user's normal sign-in locations.
- Inspect `azure.signinlogs.properties.applied_conditional_access_policies` for the sign-in. A policy with `enforced_grant_controls` of `Mfa` and a `result` of `notApplied`, on a `singleFactorAuthentication` / `Password` sign-in, means the MFA grant control was present but not enforced. Note the aggregate `conditional_access_status` may read `success` or `notApplied` and is not by itself indicative.
- Review whether the tenant has an "all resources" Conditional Access policy with one or more application exclusions, which is the configuration that enables this bypass.
- Pivot to `logs-azure.graphactivitylogs-*` for the same `user_principal_object_id` and `app_id` to identify directory enumeration (requests to `/groups`, `/servicePrincipals`, `/directoryRoles`, `/devices`, `/users`) shortly after the sign-in.
- Correlate using `azure.signinlogs.properties.session_id` to reconstruct the full token-acquisition sequence, including any non-interactive token redemption.
### False positive analysis
- Everyday first-party public clients (Microsoft Teams, OneDrive, Outlook Mobile, Microsoft 365 Copilot, Microsoft To-Do, Edge, Windows Search) legitimately acquire Microsoft Graph tokens with single-factor authentication, particularly when MFA was already satisfied earlier in the session or no MFA policy applies to that application. Expect benign first-time `(user, app, ASN)` combinations, especially during onboarding or first use of a tool.
- Users signing in from a new network (travel, VPN, new ISP) will present a new ASN and may trigger the New Terms condition once.
- In tenants with broad MFA Conditional Access policies, those policies can legitimately report `notApplied` for single-factor sign-ins that are genuinely out of policy scope (for example, sign-ins from a trusted named location or an app excluded from the policy). The `applied_conditional_access_policies` condition therefore sharpens, but does not perfectly isolate, the bypass; corroborate with the application identity and source.
- The rule scopes to all Microsoft first-party applications via `app_owner_tenant_id` rather than a fixed client ID list, so it covers every first-party public client but is correspondingly broad. New Terms on `(user, app_id, ASN)` limits this to first-occurrence events; consider allowlisting expected `(user, app)` pairs, or specific high-volume everyday first-party apps, to further reduce volume.
- Tune by excluding known developer or automation identities that routinely use these clients against Microsoft Graph.
### Response and remediation
- Contact the user to confirm whether they initiated the sign-in and used the detected application.
- If unauthorized, revoke the user's refresh tokens and require password reset and MFA re-registration.
- Review `logs-azure.graphactivitylogs-*` for directory enumeration or data access performed with the issued token.
- Remediate the enabling configuration: review "all resources" Conditional Access policies for application exclusions, and enable strict baseline-scope enforcement so baseline scopes do not bypass grant controls.
- Block the source IP or ASN if confirmed malicious.
"""
references = [
"https://dirkjanm.io/bypassing-conditional-access-with-resource-exclusion/",
"https://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema",
]
risk_score = 47
rule_id = "921544bd-e2aa-44a6-9fb9-98629c342adf"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Sign-in Logs",
"Use Case: Identity and Access Audit",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "azure.signinlogs" and
event.outcome: "success" and
azure.signinlogs.properties.user_type: "Member" and
azure.signinlogs.properties.authentication_requirement: "singleFactorAuthentication" and
azure.signinlogs.properties.conditional_access_status: ("success" or "notApplied") and
azure.signinlogs.properties.authentication_details.authentication_method: "Password" and
azure.signinlogs.properties.applied_conditional_access_policies.enforced_grant_controls: "Mfa" and
azure.signinlogs.properties.applied_conditional_access_policies.result: "notApplied" and
(
azure.signinlogs.properties.resource_id: "00000003-0000-0000-c000-000000000000" or
azure.signinlogs.properties.resource_display_name: "Microsoft Graph"
) and
azure.signinlogs.properties.app_owner_tenant_id: "f8cdef31-a31e-4b4a-93e4-5f571e91255a" and
azure.signinlogs.properties.user_principal_name: * and
azure.signinlogs.properties.app_id: * and
source.as.number: *
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.009"
name = "Conditional Access Policies"
reference = "https://attack.mitre.org/techniques/T1556/009/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"azure.signinlogs.properties.user_principal_name",
"azure.signinlogs.properties.app_id",
"azure.signinlogs.properties.app_display_name",
"azure.signinlogs.properties.resource_id",
"azure.signinlogs.properties.resource_display_name",
"azure.signinlogs.properties.authentication_requirement",
"azure.signinlogs.properties.conditional_access_status",
"azure.signinlogs.properties.applied_conditional_access_policies.display_name",
"azure.signinlogs.properties.applied_conditional_access_policies.enforced_grant_controls",
"azure.signinlogs.properties.applied_conditional_access_policies.result",
"azure.signinlogs.properties.is_interactive",
"azure.signinlogs.properties.session_id",
"source.ip",
"source.as.number",
"source.as.organization.name",
"source.geo.country_name",
"user_agent.original",
]
[rule.new_terms]
field = "new_terms_fields"
value = [
"azure.signinlogs.properties.user_principal_name",
"azure.signinlogs.properties.app_id",
"source.as.number",
]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset: "azure.signinlogs" and
event.outcome: "success" and
azure.signinlogs.properties.user_type: "Member" and
azure.signinlogs.properties.authentication_requirement: "singleFactorAuthentication" and
azure.signinlogs.properties.conditional_access_status: ("success" or "notApplied") and
azure.signinlogs.properties.authentication_details.authentication_method: "Password" and
azure.signinlogs.properties.applied_conditional_access_policies.enforced_grant_controls: "Mfa" and
azure.signinlogs.properties.applied_conditional_access_policies.result: "notApplied" and
(
azure.signinlogs.properties.resource_id: "00000003-0000-0000-c000-000000000000" or
azure.signinlogs.properties.resource_display_name: "Microsoft Graph"
) and
azure.signinlogs.properties.app_owner_tenant_id: "f8cdef31-a31e-4b4a-93e4-5f571e91255a" and
azure.signinlogs.properties.user_principal_name: * and
azure.signinlogs.properties.app_id: * and
source.as.number: *
Indicators
These rows show field, operator, and value matches.
Entra ID Microsoft Authentication Broker Sign-In with Non-Standard User Agent
#Detects Microsoft Entra ID sign-in activity where the Microsoft Authentication Broker authenticates is using a user agent that is not consistent with common browser, mobile, or Windows platform authentication clients. Adversary-in-the-middle and OAuth phishing tooling often presents scripted or relayed user agents (for example Node.js, Python, or generic HTTP libraries) while still targeting first-party resources through the broker.
Known False Positives
- Legitimate automation, SDKs, or custom applications that obtain tokens through the Microsoft Authentication Broker against Graph, Azure AD, or Device Registration Service may use non-browser user agents. Baseline approved service principals, managed identities, and developer tooling before tuning exclusions for known automation patterns.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Stealth | |
| Credential Access |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/05/27"
integration = ["azure"]
maturity = "production"
updated_date = "2026/05/27"
[rule]
author = ["Elastic"]
description = """
Detects Microsoft Entra ID sign-in activity where the Microsoft Authentication Broker authenticates is using a user agent
that is not consistent with common browser, mobile, or Windows platform authentication clients. Adversary-in-the-middle and OAuth phishing
tooling often presents scripted or relayed user agents (for example Node.js, Python, or generic HTTP libraries) while
still targeting first-party resources through the broker.
"""
false_positives = [
"""
Legitimate automation, SDKs, or custom applications that obtain tokens through the Microsoft Authentication Broker
against Graph, Azure AD, or Device Registration Service may use non-browser user agents. Baseline approved
service principals, managed identities, and developer tooling before tuning exclusions for known automation
patterns.
""",
]
from = "now-9m"
index = ["logs-azure.signinlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID Microsoft Authentication Broker Sign-In with Non-Standard User Agent"
note = """## Triage and analysis
### Investigating Entra ID Microsoft Authentication Broker Sign-In with Non-Standard User Agent
Review `azure.signinlogs.properties.user_principal_name`, `user_agent.original`,
`azure.signinlogs.properties.resource_display_name`, `azure.signinlogs.properties.session_id`, `source.ip`, and
`source.as.organization.name`.
Confirm whether the user or application intentionally used a non-browser client against the requested resource.
### Possible investigation steps
- Inspect `user_agent.original` for automation libraries (for example `node`, `axios`, `python-requests`, `curl`).
- Correlate `azure.signinlogs.properties.session_id` with other sign-ins, device registration audit events, or Graph
activity in the same time window.
- Review conditional access outcomes and identity protection signals for the user.
- Compare `source.ip` and ASN against expected VPN, MDM, and developer egress.
### False positive analysis
- Microsoft platform and mobile clients using Mozilla-, Dalvik-, CFNetwork-, or Windows-AzureAD-Authentication-Provider-
style user agents are excluded by design.
- First-party CLI tools and test harnesses that legitimately broker tokens may still match if they use uncommon user
agent strings.
### Response and remediation
- If malicious, revoke refresh tokens for the user, review newly registered devices, and reset credentials per policy.
- Escalate when paired with suspicious ASN sign-ins, multi-IP OAuth flows, or follow-on Graph data access.
"""
references = [
"https://www.volexity.com/blog/2025/04/22/phishing-for-codes-russian-threat-actors-target-microsoft-365-oauth-workflows/",
"https://dirkjanm.io/phishing-for-microsoft-entra-primary-refresh-tokens/",
"https://any.run/malware-trends/tycoon/",
]
risk_score = 73
rule_id = "c22f89d9-b674-4650-8454-02242c8b35eb"
severity = "high"
setup = """
Microsoft Entra ID sign-in logs (`logs-azure.signinlogs-*`) must populate `user_agent.original`,
`azure.signinlogs.properties.app_display_name`, and `azure.signinlogs.properties.resource_display_name`.
"""
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Sign-In Logs",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Tactic: Credential Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"azure.signinlogs" and event.action:"Sign-in activity" and event.outcome:(success or Success) and
(azure.signinlogs.properties.app_display_name:"Microsoft Authentication Broker" or azure.signinlogs.properties.app_id:"29d9ed98-a469-4536-ade2-f981bc1d605e") and
user_agent.original:(* and not (Mozilla* or Dalvik* or *CFNetwork* or Windows-AzureAD-Authentication-Provider* or Java*ThinkPad*)) and
azure.signinlogs.properties.resource_display_name:*
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"source.as.number",
"source.as.organization.name",
"source.geo.country_name",
"event.outcome",
"azure.signinlogs.properties.user_principal_name",
"azure.signinlogs.properties.session_id",
"azure.signinlogs.properties.app_display_name",
"azure.signinlogs.properties.app_id",
"azure.signinlogs.properties.resource_display_name",
"azure.signinlogs.properties.resource_id",
"azure.signinlogs.properties.authentication_protocol",
"azure.tenant_id",
]
[[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.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 = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: query
data_stream.dataset:"azure.signinlogs" and event.action:"Sign-in activity" and event.outcome:(success or Success) and
(azure.signinlogs.properties.app_display_name:"Microsoft Authentication Broker" or azure.signinlogs.properties.app_id:"29d9ed98-a469-4536-ade2-f981bc1d605e") and
user_agent.original:(* and not (Mozilla* or Dalvik* or *CFNetwork* or Windows-AzureAD-Authentication-Provider* or Java*ThinkPad*)) and
azure.signinlogs.properties.resource_display_name:*
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
azure.signinlogs.properties.app_display_name | eq |
| field:"azure_ad::app_display_name" kind:eq value:"Microsoft Authentication Broker" |
azure.signinlogs.properties.app_id | eq |
| field:"azure_ad::app_id" kind:eq value:"29d9ed98-a469-4536-ade2-f981bc1d605e" |
azure.signinlogs.properties.resource_display_name | is_not_null | field:"azure_ad::resource_display_name" kind:is_not_null | |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"azure.signinlogs" |
event.action | eq |
| field:"EventType" kind:eq value:"Sign-in activity" |
event.outcome | in |
| field:"event.outcome" kind:in |
user_agent.original | is_not_null | field:"aws::userAgent" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user_agent.original | match | CFNetwork | excludes:user_agent.original field:"user_agent.original" value:"CFNetwork" |
user_agent.original | starts_with | Dalvik | excludes:user_agent.original field:"user_agent.original" value:"Dalvik" |
user_agent.original | starts_with | Mozilla | excludes:user_agent.original field:"user_agent.original" value:"Mozilla" |
user_agent.original | starts_with | Windows-AzureAD-Authentication-Provider | excludes:user_agent.original field:"user_agent.original" value:"Windows-AzureAD-Authentication-Provider" |
user_agent.original | wildcard | Java*ThinkPad* | excludes:user_agent.original field:"user_agent.original" value:"Java*ThinkPad*" |
Execution of a DNGUard Protected Program
#Identifies when a program is loading DNGUard DLL (DNGuard HVM is a .NET obfuscator and code protector), this may indicate an attempt to bypass static detection by obfuscating malicious code.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies when a program is loading DNGUard DLL (DNGuard HVM is a .NET obfuscator and code protector), this may
indicate an attempt to bypass static detection by obfuscating malicious code.
"""
id = "e691d379-6d01-43cc-9f1e-ab10df48a6bc"
license = "Elastic License v2"
name = "Execution of a DNGUard Protected Program"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1027/002/", "http://www.dnguard.net/products.php"]
version = "1.0.23"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
not process.executable : "?:\\Program Files (x86)\\Digiarty\\WinX MediaTrans\\MediaTrans.exe"]
[library where
(dll.name :"HVMRuntm.dll" or
dll.hash.sha256 :"a0b11444c5913bc048c2f97b670cc801176df17565c48d6e7a30fef651ca8426" or
dll.pe.imphash : "b2ff0f091ba14e9fe411060ab1560c66")]
'''
min_endpoint_version = "8.4.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.002"
name = "Software Packing"
reference = "https://attack.mitre.org/techniques/T1027/002/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
not process.executable : "?:\\Program Files (x86)\\Digiarty\\WinX MediaTrans\\MediaTrans.exe"]
Stage 2: library
[library where
(dll.name :"HVMRuntm.dll" or
dll.hash.sha256 :"a0b11444c5913bc048c2f97b670cc801176df17565c48d6e7a30fef651ca8426" or
dll.pe.imphash : "b2ff0f091ba14e9fe411060ab1560c66")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.hash.sha256 | wildcard |
| field:"Hashes" kind:wildcard value:"a0b11444c5913bc048c2f97b670cc801176df17565c48d6e7a30fef651ca8426" |
dll.name | wildcard |
| field:"dll.name" kind:wildcard value:"HVMRuntm.dll" |
dll.pe.imphash | wildcard |
| field:"dll.pe.imphash" kind:wildcard value:"b2ff0f091ba14e9fe411060ab1560c66" |
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.relative_file_creation_time | le |
| field:"process.Ext.relative_file_creation_time" kind:le value:"500" |
process.Ext.relative_file_name_modify_time | le |
| field:"process.Ext.relative_file_name_modify_time" kind:le value:"500" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | ?:\Program Files (x86)\Digiarty\WinX MediaTrans\MediaTrans.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Digiarty\WinX MediaTrans\MediaTrans.exe" |
Execution via MSSQL xp_cmdshell Stored Procedure
#Identifies execution via MSSQL xp_cmdshell stored procedure. Malicious users may attempt to elevate their privileges by using xp_cmdshell, which is disabled by default, thus, it's important to review the context of it's use.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence |
Rule Body
[metadata]
creation_date = "2020/08/14"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies execution via MSSQL xp_cmdshell stored procedure. Malicious users may attempt to elevate their privileges by
using xp_cmdshell, which is disabled by default, thus, it's important to review the context of it's use.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "kuery"
license = "Elastic License v2"
name = "Execution via MSSQL xp_cmdshell Stored Procedure"
note = """## Triage and analysis
### Investigating Execution via MSSQL xp_cmdshell Stored Procedure
Microsoft SQL Server (MSSQL) has procedures meant to extend its functionality, the Extended Stored Procedures. These procedures are external functions written in C/C++; some provide interfaces for external programs. This is the case for xp_cmdshell, which spawns a Windows command shell and passes in a string for execution. Attackers can use this to execute commands on the system running the SQL server, commonly to escalate their privileges and establish persistence.
The xp_cmdshell procedure is disabled by default, but when used, it has the same security context as the MSSQL Server service account, which is often privileged.
#### Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
- Examine the command line to determine if the command executed is potentially harmful or malicious.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
### False positive analysis
- This mechanism can be used legitimately, but it brings inherent risk. The security team must monitor any activity of it. If recurrent tasks are being executed using this mechanism, consider adding exceptions — preferably with a full command line.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- 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.
- Ensure that SQL servers are not directly exposed to the internet. If there is a business justification for such, use an allowlist to allow only connections from known legitimate sources.
- Disable the xp_cmdshell stored procedure.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
references = ["https://thedfirreport.com/2022/07/11/select-xmrig-from-sqlserver/"]
risk_score = 47
rule_id = "4ed493fc-d637-4a36-80ff-ac84937e5461"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
host.os.type:windows and event.category:process and event.type:start and
process.parent.name:"sqlservr.exe" and process.command_line : * and
(
(
(process.name.caseless : "cmd.exe" or process.pe.original_file_name : "Cmd.Exe") and
not process.args : (
\\\\* or diskfree or rmdir or mkdir or dir or DIR or del or rename or bcp or md or ren or REN or send or echo or
ECHO or TYPE or type or EXIST or forfiles or sqlcmd or SQLCMD or dtexec or Sort-Object or cat or copy or COPY or
move or MOVE or CD\\ or show or rd or powercfg or "C:\SPAN4\DATA\RISKPARAM.SPN" or ("@ECHO" and "@FOR") or
("@echo" and "@for") or (SET and PATH=*) or ("-ExecutionPolicy" and "-File") or MSSQLFDLauncher$DATEV_DBENGINE or
(wmic and (cpu or computersystem or logicaldisk or os or ComputerSystem or volume)) or -s\:C\:\\WINDOWS\\SERVIC* or
D\:\\* or E\:\\* or F\:\\* or Z\:\\* or "C:\Program Files\Amazon\AWSCLIV2\aws.exe" or C\:\\7-Zip\\7z.exe* or
C\:\\FTP* or *\(Get-Item* or C\:\\ProgramData\\Daktronics*
) and
not process.command_line : (
"\"C:\\Windows\\system32\\cmd.exe\" /c " or
"\"C:\\Windows\\System32\\cmd.exe\""
)
) or
process.name.caseless:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
process.name:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
process.pe.original_file_name:("CertUtil.exe" or "bitsadmin.exe" or "vpnbridge.exe")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"
[[rule.threat.technique.subtechnique]]
id = "T1505.001"
name = "SQL Stored Procedures"
reference = "https://attack.mitre.org/techniques/T1505/001/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[rule.new_terms]
field = "new_terms_fields"
value = ["host.id", "process.command_line"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
Stages and Predicates
Stage 1: new_terms
host.os.type:windows and event.category:process and event.type:start and
process.parent.name:"sqlservr.exe" and process.command_line : * and
(
(
(process.name.caseless : "cmd.exe" or process.pe.original_file_name : "Cmd.Exe") and
not process.args : (
\\\\* or diskfree or rmdir or mkdir or dir or DIR or del or rename or bcp or md or ren or REN or send or echo or
ECHO or TYPE or type or EXIST or forfiles or sqlcmd or SQLCMD or dtexec or Sort-Object or cat or copy or COPY or
move or MOVE or CD\\ or show or rd or powercfg or "C:\SPAN4\DATA\RISKPARAM.SPN" or ("@ECHO" and "@FOR") or
("@echo" and "@for") or (SET and PATH=*) or ("-ExecutionPolicy" and "-File") or MSSQLFDLauncher$DATEV_DBENGINE or
(wmic and (cpu or computersystem or logicaldisk or os or ComputerSystem or volume)) or -s\:C\:\\WINDOWS\\SERVIC* or
D\:\\* or E\:\\* or F\:\\* or Z\:\\* or "C:\Program Files\Amazon\AWSCLIV2\aws.exe" or C\:\\7-Zip\\7z.exe* or
C\:\\FTP* or *\(Get-Item* or C\:\\ProgramData\\Daktronics*
) and
not process.command_line : (
"\"C:\\Windows\\system32\\cmd.exe\" /c " or
"\"C:\\Windows\\System32\\cmd.exe\""
)
) or
process.name.caseless:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
process.name:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
process.pe.original_file_name:("CertUtil.exe" or "bitsadmin.exe" or "vpnbridge.exe")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.category | eq |
| field:"event.category" kind:eq value:"process" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | is_not_null | field:"CommandLine" kind:is_not_null | |
process.name | in |
| field:"process_basename" kind:in |
process.name.caseless | eq |
| field:"process.name.caseless" kind:eq value:"cmd.exe" |
process.name.caseless | in |
| field:"process.name.caseless" kind:in |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"sqlservr.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"Cmd.Exe" |
process.pe.original_file_name | in |
| field:"OriginalFileName" kind:in |
Exploit - Detected - Elastic Endgame
#Elastic Endgame detected an Exploit. Click the Elastic Endgame icon in the event.module column or the link in the rule.reference column for additional information.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2020/02/18"
maturity = "production"
promotion = true
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Elastic Endgame detected an Exploit. Click the Elastic Endgame icon in the event.module column or the link in the
rule.reference column for additional information.
"""
from = "now-2m"
index = ["endgame-*"]
interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
name = "Exploit - Detected - Elastic Endgame"
risk_score = 73
rule_id = "2003cdc8-8d83-4aa5-b132-1f9a8eb48514"
setup = """## Setup
### Additional notes
For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "high"
tags = [
"Data Source: Elastic Endgame",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Privilege Escalation",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.kind:alert and event.module:endgame and endgame.metadata.type:detection and (event.action:exploit_event or endgame.event_subtype_full:exploit_event)
'''
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 Exploit - Detected - Elastic Endgame
Elastic Endgame is a security solution that monitors and detects exploit attempts within an environment. Adversaries exploit vulnerabilities to execute unauthorized code or escalate privileges. The detection rule identifies alerts from the Endgame module, focusing on exploit-related events. It leverages metadata and event actions to flag high-risk activities, aiding in swift threat detection and response.
### Possible investigation steps
- Review the alert details to confirm the presence of event.kind:alert and event.module:endgame, ensuring the alert is relevant to the Elastic Endgame detection.
- Examine the event.action and endgame.event_subtype_full fields to determine the specific exploit event type, which can provide insight into the nature of the exploit attempt.
- Investigate the endgame.metadata.type field to gather additional context about the detection, such as the source and target of the exploit attempt.
- Check the associated risk score and severity level to prioritize the investigation and response efforts, focusing on high-risk activities.
- Correlate the alert with other related events in the environment to identify potential patterns or additional indicators of compromise.
- Consult the MITRE ATT&CK framework for the Execution tactic (TA0002) to understand potential techniques that might have been used and to guide further investigation steps.
### False positive analysis
- Routine software updates or patches may trigger exploit detection alerts. Users can create exceptions for known update processes by identifying their unique metadata or event actions.
- Legitimate administrative tools that perform actions similar to exploits might be flagged. Users should whitelist these tools by specifying their event.module or event.action attributes.
- Automated scripts used for system maintenance could mimic exploit behavior. To prevent false positives, users can exclude these scripts by defining their specific endgame.event_subtype_full.
- Security testing activities, such as penetration tests, may generate alerts. Users can manage these by setting temporary exceptions during the testing period, based on the event.kind or event.module.
### Response and remediation
- Isolate the affected system immediately to prevent further exploitation or lateral movement within the network.
- Terminate any unauthorized processes identified as part of the exploit event to halt malicious activity.
- Apply relevant security patches or updates to the affected system to address the exploited vulnerability and prevent recurrence.
- Conduct a thorough forensic analysis of the affected system to identify any additional indicators of compromise or secondary payloads.
- Restore the system from a known good backup if necessary, ensuring that the backup is free from any malicious artifacts.
- Monitor the network for any signs of similar exploit attempts, using enhanced logging and alerting based on the identified threat indicators.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to ensure comprehensive remediation."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: query
event.kind:alert and event.module:endgame and endgame.metadata.type:detection and (event.action:exploit_event or endgame.event_subtype_full:exploit_event)
Indicators
These rows show field, operator, and value matches.
Kernel Driver Load
#Detects the loading of a Linux kernel module through system calls. Threat actors may leverage Linux kernel modules to load a rootkit on a system providing them with complete control and the ability to hide from security products. As other rules monitor for the addition of Linux kernel modules through system utilities or .ko files, this rule covers the gap that evasive rootkits leverage by monitoring for kernel module additions on the lowest level through auditd_manager.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation | |
| Stealth |
Rule Body
[metadata]
creation_date = "2023/10/26"
integration = ["auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Detects the loading of a Linux kernel module through system calls. Threat actors may leverage Linux kernel modules to
load a rootkit on a system providing them with complete control and the ability to hide from security products. As other
rules monitor for the addition of Linux kernel modules through system utilities or .ko files, this rule covers the gap
that evasive rootkits leverage by monitoring for kernel module additions on the lowest level through auditd_manager.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
language = "eql"
license = "Elastic License v2"
name = "Kernel Driver Load"
risk_score = 21
rule_id = "3e12a439-d002-4944-bc42-171c0dcb9b96"
setup = """## Setup
This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.
```
Kibana -->
Management -->
Integrations -->
Auditd Manager -->
Add Auditd Manager
```
`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
For this detection rule to trigger, the following additional audit rules are required to be added to the integration:
```
-a always,exit -F arch=b64 -S finit_module -S init_module -S delete_module -F auid!=-1 -k modules
-a always,exit -F arch=b32 -S finit_module -S init_module -S delete_module -F auid!=-1 -k modules
```
Add the newly installed `auditd manager` to an agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
"""
severity = "low"
tags = [
"Data Source: Auditd Manager",
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
driver where host.os.type == "linux" and event.action == "loaded-kernel-module" and
auditd.data.syscall in ("init_module", "finit_module")
'''
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 Kernel Driver Load
Kernel modules extend the functionality of the Linux kernel, allowing dynamic loading of drivers and other components. Adversaries exploit this by loading malicious modules, or rootkits, to gain stealthy control over systems. The 'Kernel Driver Load' detection rule leverages auditd to monitor system calls like `init_module`, identifying unauthorized module loads indicative of potential rootkit activity, thus enhancing threat detection and system integrity.
### Possible investigation steps
- Review the alert details to identify the specific host where the kernel module was loaded, focusing on the host.os.type field to confirm it is a Linux system.
- Examine the event.action field to verify that the action was indeed "loaded-kernel-module" and check the auditd.data.syscall field for the specific system call used, either "init_module" or "finit_module".
- Investigate the timeline of events on the affected host around the time of the alert to identify any suspicious activities or changes, such as new user accounts, unexpected network connections, or file modifications.
- Check the system logs and audit logs on the affected host for any additional context or anomalies that coincide with the module load event.
- Identify the source and legitimacy of the loaded kernel module by examining the module's file path, signature, and associated metadata, if available.
- Assess the potential impact and scope of the incident by determining if similar alerts have been triggered on other hosts within the environment, indicating a broader campaign or attack.
### False positive analysis
- Legitimate kernel module updates or installations can trigger alerts. Regularly scheduled updates or installations by trusted administrators should be documented and excluded from monitoring to reduce noise.
- System utilities that load kernel modules as part of their normal operation may cause false positives. Identify these utilities and create exceptions for their expected behavior.
- Automated configuration management tools that deploy or update kernel modules can generate alerts. Ensure these tools are recognized and their activities are whitelisted.
- Development environments where kernel modules are frequently compiled and tested may lead to frequent alerts. Exclude specific development hosts or processes from monitoring to avoid unnecessary alerts.
- Security software that loads kernel modules for protection purposes might be flagged. Verify and exclude these modules if they are from trusted vendors.
### Response and remediation
- Isolate the affected system from the network immediately to prevent further malicious activity and lateral movement.
- Verify the legitimacy of the loaded kernel module by checking its source and integrity. If the module is unauthorized or suspicious, unload it using appropriate system commands.
- Conduct a thorough scan of the system using updated antivirus or anti-malware tools to identify and remove any additional malicious components or rootkits.
- Review and analyze system logs, especially those related to auditd, to identify any unauthorized access or changes made by the adversary. This can help in understanding the scope of the compromise.
- Restore the system from a known good backup if the integrity of the system is in question and if the malicious activity cannot be fully remediated.
- Implement stricter access controls and monitoring on kernel module loading activities to prevent unauthorized actions in the future. This may include restricting module loading to trusted users or processes.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
[[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.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1014"
name = "Rootkit"
reference = "https://attack.mitre.org/techniques/T1014/"
[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 = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[rule.threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: driver
driver where host.os.type == "linux" and event.action == "loaded-kernel-module" and
auditd.data.syscall in ("init_module", "finit_module")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
auditd.data.syscall | in |
| field:"auditd.data.syscall" kind:in |
event.action | eq |
| field:"EventType" kind:eq value:"loaded-kernel-module" |
Keystroke Input Capture via DirectInput
#Identifies attempts to enumerate keystroke state using the Windows DirectInput API. Adversaries may log user keystrokes to intercept credentials or other information from the user as the user types them.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Rule Body
[rule]
description = """
Identifies attempts to enumerate keystroke state using the Windows DirectInput API. Adversaries may log user keystrokes
to intercept credentials or other information from the user as the user types them.
"""
id = "102b5c1a-7f2a-4254-8b26-6b299705fce7"
license = "Elastic License v2"
name = "Keystroke Input Capture via DirectInput"
os_list = ["windows"]
reference = [
"https://attack.mitre.org/techniques/T1056/001/",
"https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee416842(v=vs.85)",
"https://wikileaks.org/ciav7p1/cms/page_3375220.html",
"https://www.elastic.co/security-labs/protecting-your-devices-from-information-theft-keylogger-protection",
]
version = "1.0.13"
query = '''
api where process.executable : "C:\\*" and
process.thread.Ext.call_stack_final_user_module.name : "dinput*.dll" and
(process.code_signature.exists == false or
process.code_signature.status == "errorBadDigest" or
process.code_signature.subject_name in ("The MathWorks, Inc.", "AutoIt Consulting Ltd", "Python Software Foundation") or
(process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation") and process.executable : "?:\\Windows\\*" )) and
(process.Ext.api.name == "RegisterRawInputDevices" and
process.Ext.api.parameters.usage == "KEYBOARD" and process.thread.Ext.call_stack_summary like "*|dinput?.dll|*") and
not process.executable : ("?:\\Windows\\System32\\dxdiag.exe", "?:\\Windows\\SysWOW64\\dxdiag.exe") and
not (process.executable : "?:\\Windows\\System32\\rundll32.exe" and
process.command_line : "?:\\WINDOWS\\system32\\rundll32.exe ?:\\WINDOWS\\system32\\inetcpl.cpl,ClearMyTracksByProcess*") and
not (process.executable : "?:\\Windows\\Sys*\\regsvr32.exe" and process.command_line : "*\\Program Files*\\LGHUB\\sdks\\sdk_legacy_steering_wheel*") and
not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*",
"?:\\Windows\\System32\\Macromed\\Flash\\FlashUtil_ActiveX.exe") and
not process.thread.Ext.call_stack_summary like
"wow64win.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|win32u.dll|dinput8.dll|Unknown*"
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1056"
name = "Input Capture"
reference = "https://attack.mitre.org/techniques/T1056/"
[[threat.technique.subtechnique]]
id = "T1056.001"
name = "Keylogging"
reference = "https://attack.mitre.org/techniques/T1056/001/"
[threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.executable : "C:\\*" and
process.thread.Ext.call_stack_final_user_module.name : "dinput*.dll" and
(process.code_signature.exists == false or
process.code_signature.status == "errorBadDigest" or
process.code_signature.subject_name in ("The MathWorks, Inc.", "AutoIt Consulting Ltd", "Python Software Foundation") or
(process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation") and process.executable : "?:\\Windows\\*" )) and
(process.Ext.api.name == "RegisterRawInputDevices" and
process.Ext.api.parameters.usage == "KEYBOARD" and process.thread.Ext.call_stack_summary like "*|dinput?.dll|*") and
not process.executable : ("?:\\Windows\\System32\\dxdiag.exe", "?:\\Windows\\SysWOW64\\dxdiag.exe") and
not (process.executable : "?:\\Windows\\System32\\rundll32.exe" and
process.command_line : "?:\\WINDOWS\\system32\\rundll32.exe ?:\\WINDOWS\\system32\\inetcpl.cpl,ClearMyTracksByProcess*") and
not (process.executable : "?:\\Windows\\Sys*\\regsvr32.exe" and process.command_line : "*\\Program Files*\\LGHUB\\sdks\\sdk_legacy_steering_wheel*") and
not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*",
"?:\\Windows\\System32\\Macromed\\Flash\\FlashUtil_ActiveX.exe") and
not process.thread.Ext.call_stack_summary like
"wow64win.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|win32u.dll|dinput8.dll|Unknown*"
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:"RegisterRawInputDevices" |
process.Ext.api.parameters.usage | eq |
| field:"process.Ext.api.parameters.usage" kind:eq value:"KEYBOARD" |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.status | eq |
| field:"SignatureStatus" kind:eq value:"errorBadDigest" |
process.code_signature.subject_name | in |
| field:"Signature" kind:in |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.thread.Ext.call_stack_final_user_module.name | wildcard |
| field:"process.thread.Ext.call_stack_final_user_module.name" kind:wildcard value:"dinput*.dll" |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"*|dinput?.dll|*" |
Exclusions
The rule actively suppresses these predicates.
M365 Teams Rogue Help Desk Chat Created
#Identifies a one-on-one Microsoft Teams chat created by a user from a foreign tenant whose display name, member profile, or email local-part resembles IT help desk or Microsoft security staff. Adversaries abuse cross-tenant Teams external access to impersonate support personnel and socially engineer victims into granting remote access or disclosing credentials.
Known False Positives
- Legitimate external partners or managed service providers with help desk-style display names may trigger this rule. Validate the sender tenant, domain, and business relationship before closing as benign.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | ChatCreated |
Rule Body
[metadata]
creation_date = "2026/06/22"
integration = ["o365"]
maturity = "production"
updated_date = "2026/06/22"
[rule]
author = ["Elastic"]
description = """
Identifies a one-on-one Microsoft Teams chat created by a user from a foreign tenant whose display name, member
profile, or email local-part resembles IT help desk or Microsoft security staff. Adversaries abuse cross-tenant Teams
external access to impersonate support personnel and socially engineer victims into granting remote access or
disclosing credentials.
"""
false_positives = [
"""
Legitimate external partners or managed service providers with help desk-style display names may trigger this rule.
Validate the sender tenant, domain, and business relationship before closing as benign.
""",
]
from = "now-9m"
index = ["logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Teams Rogue Help Desk Chat Created"
note = """## Triage and analysis
### Investigating M365 Teams Rogue Help Desk Chat Created
Threat actors create external Microsoft 365 tenants and initiate unsolicited one-on-one Teams chats while impersonating
IT help desk or Microsoft security personnel. These chats often precede vishing, Quick Assist abuse, or malicious link
delivery.
Review `user.email`, `user.domain`, `o365.audit.Members.DisplayName`, `o365.audit.ChatThreadId`, and
`o365.audit.ParticipantInfo`. Correlate follow-on `MessageSent` events for `source.ip` and `source.geo`, and
`CallParticipantDetail` events sharing the same `o365.audit.CallId` or chat thread for vishing activity.
#### Possible investigation steps
- Identify the external sender from `user.email`, `user.domain`, and `o365.audit.Members` and determine whether the
tenant or domain is known and trusted.
- Compare `user.name` to `o365.audit.Members.DisplayName` — actors often use a lowercase mailbox alias such as
`helpdesk` while presenting as `Help Desk` in Teams.
- Confirm `o365.audit.ParticipantInfo.HasForeignTenantUsers` is true and that no guest users are involved.
- Pivot on `o365.audit.ChatThreadId` for `MessageSent` and `CallParticipantDetail` events in the same session.
- Review `MessageSent` `source.ip` and `source.geo` for unexpected origin countries relative to the sender profile.
- Correlate with mail-flood, MFA fatigue, or URL click alerts for the targeted user in the same time window.
- Review whether the victim accepted the chat or responded, and hunt for follow-on remote support tool execution on
their endpoint.
- Check whether the sender tenant appears newly created, trial-based, or otherwise anomalous for your environment.
### False positive analysis
- Approved external support vendors may use help desk-style display names. Maintain an allowlist of trusted external
tenants or sender domains when recurring benign matches occur.
- The `user.email` and `user.name` impersonation clauses target external mailbox aliases such as `helpdesk@`. Prefer
exceptions anchored on verified tenant IDs or sender domains rather than broad name-based exclusions.
### Response and remediation
- Warn the targeted user not to engage and confirm whether they accepted the chat or shared credentials.
- Block or restrict the external tenant via Teams federation policy if malicious.
- Hunt for additional `ChatCreated` events from the same external tenant across the organization.
- Review Teams external access settings and consider blocking trial tenants or restricting federation to an allowlist."""
references = [
"https://www.microsoft.com/en-us/security/blog/2026/04/18/crosstenant-helpdesk-impersonation-data-exfiltration-human-operated-intrusion-playbook/",
"https://www.microsoft.com/en-us/security/blog/2024/05/15/threat-actors-misusing-quick-assist-in-social-engineering-attacks-leading-to-ransomware/",
]
risk_score = 73
rule_id = "e8e7b6b6-78b0-4015-97fe-c2f28468e0d4"
severity = "high"
tags = [
"Domain: Cloud",
"Domain: SaaS",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:o365.audit and event.action:"ChatCreated" and event.provider:"MicrosoftTeams" and event.outcome:"success" and
o365.audit.ParticipantInfo.HasOtherGuestUsers:false and o365.audit.ParticipantInfo.HasGuestUsers:false and
o365.audit.ParticipantInfo.HasForeignTenantUsers:true and o365.audit.CommunicationType:"OneOnOne" and
(
o365.audit.Members:(
"Help Desk" or "Help Desk Team" or "Help Desk IT" or "IT Help Desk" or
"Microsoft Security" or "Microsoft Security" or "Microsoft Support"
) or
user.email:(
*helpdesk* or *help.desk* or *help-desk* or *help_desk* or
*ithelp* or *it.help* or *itsupport* or *it.support* or *it-support*
) or
user.name:(*helpdesk* or *help-desk* or *ithelp* or *itsupport*)
)
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user.email",
"user.domain",
"user.id",
"o365.audit.Members",
"o365.audit.Members.DisplayName",
"o365.audit.ChatThreadId",
"o365.audit.ResourceTenantId",
"o365.audit.CommunicationType",
"o365.audit.ParticipantInfo.HasForeignTenantUsers",
"o365.audit.ParticipantInfo.HasGuestUsers",
"o365.audit.ParticipantInfo.HasOtherGuestUsers",
"o365.audit.ParticipantInfo.ParticipatingDomains",
"event.action",
"event.provider",
]
[[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.003"
name = "Spearphishing via Service"
reference = "https://attack.mitre.org/techniques/T1566/003/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
Stages and Predicates
Stage 1: query
data_stream.dataset:o365.audit and event.action:"ChatCreated" and event.provider:"MicrosoftTeams" and event.outcome:"success" and
o365.audit.ParticipantInfo.HasOtherGuestUsers:false and o365.audit.ParticipantInfo.HasGuestUsers:false and
o365.audit.ParticipantInfo.HasForeignTenantUsers:true and o365.audit.CommunicationType:"OneOnOne" and
(
o365.audit.Members:(
"Help Desk" or "Help Desk Team" or "Help Desk IT" or "IT Help Desk" or
"Microsoft Security" or "Microsoft Security" or "Microsoft Support"
) or
user.email:(
*helpdesk* or *help.desk* or *help-desk* or *help_desk* or
*ithelp* or *it.help* or *itsupport* or *it.support* or *it-support*
) or
user.name:(*helpdesk* or *help-desk* or *ithelp* or *itsupport*)
)
Indicators
These rows show field, operator, and value matches.
MFA Deactivation with no Re-Activation for Okta User Account
#Detects multi-factor authentication (MFA) deactivation with no subsequent re-activation for an Okta user account. An adversary may deactivate MFA for an Okta user account in order to weaken the authentication requirements for the account.
Known False Positives
- If the behavior of deactivating MFA for Okta user accounts is expected, consider adding exceptions to this rule to filter false positives.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Attempt to Reset MFA Factors for an Okta User Account (Elastic)
- New Device/Location sign-in along with critical operation (Kusto)
- Okta Authentication Bypass via Skeleton Key Injection - Behavioral (Panther)
- Okta Investigate MFA and Password resets (Panther)
- Okta MFA Reset or Deactivated (Sigma)
- Okta Multi-Factor Authentication Disabled (Splunk)
- Okta User MFA Reset All (Panther)
- Okta User Password and MFA Factor Reset or Deactivated (YARA-L)
Rule Body
[metadata]
creation_date = "2020/05/20"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Detects multi-factor authentication (MFA) deactivation with no subsequent re-activation for an Okta user account. An
adversary may deactivate MFA for an Okta user account in order to weaken the authentication requirements for the
account.
"""
false_positives = [
"""
If the behavior of deactivating MFA for Okta user accounts is expected, consider adding exceptions to this rule to
filter false positives.
""",
]
from = "now-12h"
index = ["logs-okta.system*"]
interval = "6h"
language = "eql"
license = "Elastic License v2"
name = "MFA Deactivation with no Re-Activation for Okta User Account"
note = """## Triage and analysis
### Investigating MFA Deactivation with no Re-Activation for Okta User Account
MFA is used to provide an additional layer of security for user accounts. An adversary may achieve MFA deactivation for an Okta user account to achieve persistence.
This rule fires when an Okta user account has MFA deactivated and no subsequent MFA reactivation is observed within 12 hours.
#### Possible investigation steps:
- Identify the entity related to the alert by reviewing `okta.target.alternate_id`, `okta.target.id` or `user.target.full_name` fields. This should give the username of the account being targeted. Verify if MFA is deactivated for the target entity.
- Using the `okta.target.alternate_id` field, search for MFA re-activation events where `okta.event_type` is `user.mfa.factor.activate`. Note if MFA re-activation attempts were made against the target.
- Identify the actor performing the deactivation by reviewing `okta.actor.alternate_id`, `okta.actor.id` or `user.full_name` fields. This should give the username of the account performing the action. Determine if deactivation was performed by a separate user.
- Review events where `okta.event_type` is `user.authenticate*` to determine if the actor or target accounts had suspicious login activity.
- Geolocation details found in `client.geo*` related fields may be useful in determining if the login activity was suspicious for this user.
- Examine related administrative activity by the actor for privilege misuse or suspicious changes.
#### False positive steps:
- Determine with the target user if MFA deactivation was expected.
- Determine if MFA is required for the target user account.
#### Response and remediation:
- If the MFA deactivation was not expected, consider deactivating the user
- This should be followed by resetting the user's password and re-enabling MFA.
- If the MFA deactivation was expected, consider adding an exception to this rule to filter false positives.
- Investigate the source of the attack. If a specific machine or network is compromised, additional steps may need to be taken to address the issue.
- Encourage users to use complex, unique passwords and consider implementing multi-factor authentication.
- Check if the compromised account was used to access or alter any sensitive data, applications or systems.
- Review the client user-agent to determine if it's a known custom application that can be whitelisted.
"""
references = [
"https://developer.okta.com/docs/reference/api/system-log/",
"https://developer.okta.com/docs/reference/api/event-types/",
"https://www.elastic.co/security-labs/testing-okta-visibility-and-detection-dorothy",
"https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
"https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
]
risk_score = 21
rule_id = "cd89602e-9db0-48e3-9391-ae3bf241acd8"
setup = "The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.\n"
severity = "low"
tags = [
"Tactic: Persistence",
"Use Case: Identity and Access Audit",
"Data Source: Okta",
"Domain: Cloud",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by okta.target.id with maxspan=12h
[any where data_stream.dataset == "okta.system" and okta.event_type in ("user.mfa.factor.deactivate", "user.mfa.factor.reset_all")
and okta.outcome.reason != "User reset SECURITY_QUESTION factor" and okta.outcome.result == "SUCCESS"]
![any where data_stream.dataset == "okta.system" and okta.event_type == "user.mfa.factor.activate"]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 12h, correlated by okta.target.id.
Stage 1: any
[any where data_stream.dataset == "okta.system" and okta.event_type in ("user.mfa.factor.deactivate", "user.mfa.factor.reset_all")
and okta.outcome.reason != "User reset SECURITY_QUESTION factor" and okta.outcome.result == "SUCCESS"]
Stage 2: any (negated)
![any where data_stream.dataset == "okta.system" and okta.event_type == "user.mfa.factor.activate"]
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" |
okta.event_type | in |
| field:"okta::eventType" kind:in |
okta.outcome.reason | ne |
| field:"okta::outcome.reason" kind:ne value:"User reset SECURITY_QUESTION factor" |
okta.outcome.result | eq |
| field:"okta::outcome.result" kind:eq value:"SUCCESS" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
data_stream.dataset | eq | okta.system | excludes:data_stream.dataset field:"data_stream.dataset" value:"okta.system" |
okta.event_type | eq | user.mfa.factor.activate | excludes:okta.event_type field:"okta.event_type" value:"user.mfa.factor.activate" |
Payload Delivery via Curl and Immediate Execution
#Detects when an executable file is created by Curl, immediately made executable by Chmod and executed all within a 15 second timespan by the same parent process. This will detect attempts to gain initial access via shell scripts and automated one line commands.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when an executable file is created by Curl, immediately made executable by Chmod and executed all within a 15
second timespan by the same parent process. This will detect attempts to gain initial access via shell scripts and
automated one line commands.
"""
id = "ab583372-b42e-4e5e-8e3a-fc900de0c34e"
license = "Elastic License v2"
name = "Payload Delivery via Curl and Immediate Execution"
os_list = ["macos"]
version = "1.0.6"
query = '''
sequence by process.parent.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and
process.args in ("-o", "--output") and
not process.command_line : ("*https://raw.githubusercontent.com*", "*https://github.com*")]
[process where event.type == "start" and event.action == "exec" and process.name == "chmod" and process.args in ("+x", "777")]
[process where event.type == "start" and event.action == "exec" and (process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.executable like ("/opt/homebrew/*", "/usr/local/Cellar/*")]
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and
process.args in ("-o", "--output") and
not process.command_line : ("*https://raw.githubusercontent.com*", "*https://github.com*")]
Stage 2: process
[process where event.type == "start" and event.action == "exec" and process.name == "chmod" and process.args in ("+x", "777")]
Stage 3: process
[process where event.type == "start" and event.action == "exec" and (process.code_signature.trusted == false or process.code_signature.exists == false) and
not process.executable like ("/opt/homebrew/*", "/usr/local/Cellar/*")]
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | match | https://raw.githubusercontent.com, https://github.com | excludes:process.command_line field:"process.command_line" value:"https://raw.githubusercontent.com" field:"process.command_line" value:"https://github.com" |
process.executable | starts_with | /opt/homebrew/, /usr/local/Cellar/ | excludes:process.executable field:"process.executable" value:"/opt/homebrew/" field:"process.executable" value:"/usr/local/Cellar/" |
Payload Downloaded via Curl or Wget by Web Server
#This rule detects when a web server downloads a payload via curl or wget. Attackers may exploit RCE or file upload vulnerabilities to download malicious files to web servers to gain/maintain access and to establish a command and control channel.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Persistence | |
| Lateral Movement | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects when a web server downloads a payload via curl or wget. Attackers may exploit RCE or file upload
vulnerabilities to download malicious files to web servers to gain/maintain access and to establish a command and
control channel.
"""
id = "aac41cc3-fc4a-4dea-b8d6-252ded1cb3fc"
license = "Elastic License v2"
name = "Payload Downloaded via Curl or Wget by Web Server"
os_list = ["linux"]
version = "1.0.9"
query = '''
process where event.type == "start" and event.action == "exec" and process.parent.interactive == false and (
process.parent.name in (
"nginx", "apache2", "httpd", "caddy", "mongrel_rails", "uwsgi", "daphne", "httpd.worker", "flask",
"php-cgi", "php-fcgi", "php-cgi.cagefs", "lswsctrl", "varnishd", "uvicorn", "waitress-serve", "starman",
"frankenphp", "zabbix_server", "asterisk", "sw-engine-fpm"
) or
process.parent.name like ("php-fpm*", "gunicorn*", "*.cgi", "*.fcgi") or
(
process.parent.name like "ruby*" and
process.parent.command_line like~ ("*puma*", "*rails*", "*passenger*") and
not process.command_line like "*github.com/phusion/passenger/releases/download/release*"
) or
(process.parent.name like "python*" and process.parent.command_line like~ (
"*hypercorn*", "*flask*", "*uvicorn*", "*django*", "*app.py*", "*server.py*", "*wsgi.py*", "*asgi.py*"
)) or
(process.parent.name like "perl*" and process.parent.command_line like~ "*plackup*") or
(process.parent.name == "node" and process.parent.command_line like~ (
"*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
"*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
) and
not (
process.parent.args like (
"/opt/cursor-agent/*", "/home/*/*", "/root/*", "/opt/vscode-server/*", "/usr/lib/node_modules/openclaw/dist/index.js",
"/home/*/.npm-global/lib/node_modules/openclaw/dist/index.js", "openclaw-gateway"
) or
process.parent.executable like "/*/.cursor-server/bin/linux-x64/*/node"
)
) or
(process.parent.name == "java" and process.parent.args like~ (
/* Tomcat */
"org.apache.catalina.startup.Bootstrap", "-Dcatalina.base=*",
/* Jetty */
"org.eclipse.jetty.start.Main", "-Djetty.home=*",
/* WildFly / JBoss */
"org.jboss.modules.Main", "-Djboss.home.dir=*",
/* WebLogic */
"weblogic.Server", "-Dweblogic.Name=*", "*weblogic-launcher.jar*",
/* WebSphere traditional + Liberty */
"com.ibm.ws.runtime.WsServer", "com.ibm.ws.kernel.boot.cmdline.Bootstrap",
/* GlassFish */
"com.sun.enterprise.glassfish.bootstrap.ASMain",
/* Resin */
"com.caucho.server.resin.Resin",
/* Spring Boot */
"org.springframework.boot.loader.*",
/* Quarkus */
"*quarkus-run.jar*", "io.quarkus.runner.GeneratedMain",
/* Micronaut */
"io.micronaut.runtime.Micronaut",
/* Dropwizard */
"io.dropwizard.cli.ServerCommand",
/* Play */
"play.core.server.ProdServerStart",
/* Helidon */
"io.helidon.microprofile.server.Main", "io.helidon.webserver*",
/* Vert.x */
"io.vertx.core.Launcher",
/* Keycloak */
"org.keycloak*",
/* Apereo CAS */
"org.apereo.cas*",
/* Elasticsearch */
"org.elasticsearch.bootstrap.Elasticsearch",
/* Atlassian / Gerrit */
"com.atlassian.jira.startup.Launcher", "*BitbucketServerLauncher*", "com.google.gerrit.pgm.Daemon",
/* Solr */
"*-Dsolr.solr.home=*",
/* Jenkins */
"*jenkins.war*"
)
)
) and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in ("-c", "-cl", "-lc") and
process.command_line like ("*wget *", "*curl *") and
(
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*" or
process.command_line like ("*http*", "*ftp*")
) and
(
(
process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
process.command_line like~ ("*curl* --output*", "*curl* --remote-name*")
) or
(
(
process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
process.command_line like~ "*wget* --output-document*"
) and
not process.command_line like """*--output-document "-"*"""
) or
process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
(
process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") and
not process.command_line like ("*> /dev/null*", "*>/dev/null*", "*curl*/etc/cobra/*/uploads/whatsapp/*")
)
) and
not (
process.command_line like (
"*-O /dev/null*", "*-o /dev/null*", "*wget -qcO --user-agent=*", "*curl * | python -m json.tool",
"*http://:8008/dacx/fileoperation*", "*http://${host}:9000/api/system/liveness*"
) or
(process.parent.name == "ruby" and process.command_line like "*/tmp/passenger-native-support-*") or
(process.parent.name == "asterisk" and process.command_line like "*bapi.*.group/v2/call/outgoing*") or
(process.parent.name == "node" and process.command_line like "*/tmp/.claude/shell-snapshots/*") or
(process.parent.name == "apache2" and process.command_line like "*/var/www/html/cacti/dati/weathermap/*.jpg") or
process.parent.executable like "*/.vscode-server/cli/servers/*/server/node"
)
'''
min_endpoint_version = "8.2.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"
[[threat.technique.subtechnique]]
id = "T1505.003"
name = "Web Shell"
reference = "https://attack.mitre.org/techniques/T1505/003/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"
[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.2.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.parent.interactive == false and (
process.parent.name in (
"nginx", "apache2", "httpd", "caddy", "mongrel_rails", "uwsgi", "daphne", "httpd.worker", "flask",
"php-cgi", "php-fcgi", "php-cgi.cagefs", "lswsctrl", "varnishd", "uvicorn", "waitress-serve", "starman",
"frankenphp", "zabbix_server", "asterisk", "sw-engine-fpm"
) or
process.parent.name like ("php-fpm*", "gunicorn*", "*.cgi", "*.fcgi") or
(
process.parent.name like "ruby*" and
process.parent.command_line like~ ("*puma*", "*rails*", "*passenger*") and
not process.command_line like "*github.com/phusion/passenger/releases/download/release*"
) or
(process.parent.name like "python*" and process.parent.command_line like~ (
"*hypercorn*", "*flask*", "*uvicorn*", "*django*", "*app.py*", "*server.py*", "*wsgi.py*", "*asgi.py*"
)) or
(process.parent.name like "perl*" and process.parent.command_line like~ "*plackup*") or
(process.parent.name == "node" and process.parent.command_line like~ (
"*next start*", "*--port*", "*PORT=*", "*HOST=*", "*0.0.0.0*", "*/dist/*.js*", "*/build/*.js*", "*/server/*.js*",
"*/app/*.js*", "*/apps/*/*.js*", "*/index.js*", "*/main.js*", "*/srv/*", "*/opt/*", "*/var/www/*", "*n8n*"
) and
not (
process.parent.args like (
"/opt/cursor-agent/*", "/home/*/*", "/root/*", "/opt/vscode-server/*", "/usr/lib/node_modules/openclaw/dist/index.js",
"/home/*/.npm-global/lib/node_modules/openclaw/dist/index.js", "openclaw-gateway"
) or
process.parent.executable like "/*/.cursor-server/bin/linux-x64/*/node"
)
) or
(process.parent.name == "java" and process.parent.args like~ (
"org.apache.catalina.startup.Bootstrap", "-Dcatalina.base=*",
"org.eclipse.jetty.start.Main", "-Djetty.home=*",
"org.jboss.modules.Main", "-Djboss.home.dir=*",
"weblogic.Server", "-Dweblogic.Name=*", "*weblogic-launcher.jar*",
"com.ibm.ws.runtime.WsServer", "com.ibm.ws.kernel.boot.cmdline.Bootstrap",
"com.sun.enterprise.glassfish.bootstrap.ASMain",
"com.caucho.server.resin.Resin",
"org.springframework.boot.loader.*",
"*quarkus-run.jar*", "io.quarkus.runner.GeneratedMain",
"io.micronaut.runtime.Micronaut",
"io.dropwizard.cli.ServerCommand",
"play.core.server.ProdServerStart",
"io.helidon.microprofile.server.Main", "io.helidon.webserver*",
"io.vertx.core.Launcher",
"org.keycloak*",
"org.apereo.cas*",
"org.elasticsearch.bootstrap.Elasticsearch",
"com.atlassian.jira.startup.Launcher", "*BitbucketServerLauncher*", "com.google.gerrit.pgm.Daemon",
"*-Dsolr.solr.home=*",
"*jenkins.war*"
)
)
) and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in ("-c", "-cl", "-lc") and
process.command_line like ("*wget *", "*curl *") and
(
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*" or
process.command_line like ("*http*", "*ftp*")
) and
(
(
process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
process.command_line like~ ("*curl* --output*", "*curl* --remote-name*")
) or
(
(
process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
process.command_line like~ "*wget* --output-document*"
) and
not process.command_line like """*--output-document "-"*"""
) or
process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
(
process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") and
not process.command_line like ("*> /dev/null*", "*>/dev/null*", "*curl*/etc/cobra/*/uploads/whatsapp/*")
)
) and
not (
process.command_line like (
"*-O /dev/null*", "*-o /dev/null*", "*wget -qcO --user-agent=*", "*curl * | python -m json.tool",
"*http://:8008/dacx/fileoperation*", "*http://${host}:9000/api/system/liveness*"
) or
(process.parent.name == "ruby" and process.command_line like "*/tmp/passenger-native-support-*") or
(process.parent.name == "asterisk" and process.command_line like "*bapi.*.group/v2/call/outgoing*") or
(process.parent.name == "node" and process.command_line like "*/tmp/.claude/shell-snapshots/*") or
(process.parent.name == "apache2" and process.command_line like "*/var/www/html/cacti/dati/weathermap/*.jpg") or
process.parent.executable like "*/.vscode-server/cli/servers/*/server/node"
)
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 | in |
| field:"process.args" kind:in |
process.command_line | regex_match |
| field:"CommandLine" kind:regex_match |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard |
process.parent.command_line | wildcard |
| field:"ParentCommandLine" kind:wildcard |
process.parent.interactive | eq |
| field:"process.parent.interactive" kind:eq value:"false" |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Persistent Scripts in the Startup Directory
#Identifies script engines creating files in the Startup folder, or the creation of script files in the Startup folder. Adversaries may abuse this technique to maintain persistence in an environment.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2020/11/18"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
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 script engines creating files in the Startup folder, or the creation of script files in the Startup folder.
Adversaries may abuse this technique to maintain persistence in an environment.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.file-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Persistent Scripts in the Startup Directory"
note = """## Triage and analysis
### Performance
This rule may have low to medium performance impact due to the generic nature of VBS and JS scripts being loaded by Windows script engines.
### Investigating Persistent Scripts in the Startup Directory
The Windows Startup folder is a special folder in Windows. Programs added to this folder are executed during account logon, without user interaction, providing an excellent way for attackers to maintain persistence.
This rule looks for shortcuts created by wscript.exe or cscript.exe, or js/vbs scripts created by any 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 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.
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
- Examine the host for derived artifacts that indicate suspicious activities:
- 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.
- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.
### False positive analysis
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
### Related rules
- Suspicious Startup Shell Folder Modification - c8b150f0-0164-475b-a75e-74b47800a9ff
- Startup Folder Persistence via Unsigned Process - 2fba96c0-ade5-4bce-b92f-a5df2509da3f
### 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.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""
risk_score = 47
rule_id = "f7c4dc5a-a58d-491d-9f14-9b66507121c0"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type != "deletion" and
/* Call attention to file extensions that may be used for malicious purposes */
/* Optionally, Windows scripting engine processes targeting shortcut files */
(
file.extension : ("vbs", "vbe", "wsh", "wsf", "js", "jse", "sct", "hta", "ps1", "bat", "cmd") or
process.name : ("wscript.exe", "cscript.exe")
) and not (startsWith(user.domain, "NT") or endsWith(user.domain, "NT"))
/* Identify files created or changed in the startup folder */
and file.path : (
"?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
"?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\*")
'''
[[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.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"
[[rule.threat.technique.subtechnique]]
id = "T1547.009"
name = "Shortcut Modification"
reference = "https://attack.mitre.org/techniques/T1547/009/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type != "deletion" and
(
file.extension : ("vbs", "vbe", "wsh", "wsf", "js", "jse", "sct", "hta", "ps1", "bat", "cmd") or
process.name : ("wscript.exe", "cscript.exe")
) and not (startsWith(user.domain, "NT") or endsWith(user.domain, "NT"))
and file.path : (
"?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
"?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | ne |
| field:"event.type" kind:ne value:"deletion" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.domain | ends_with | NT | excludes:user.domain field:"user.domain" value:"NT" |
user.domain | starts_with | NT | excludes:user.domain field:"user.domain" value:"NT" |
Potential NFS Destructive Operation Burst
#Identifies a burst of successful NFS write activity combined with destructive REMOVE or RENAME operations from a single client to one export server within a one-minute window. Ransomware and destructive actors often encrypt, delete, or rename large numbers of files on mounted NFS shares; this aggregation surfaces that behavior using NFS opcode telemetry when file paths are not available on the wire.
Known False Positives
- Backup deduplication engines, migration utilities, and filesystem sync tools can generate high volumes of legitimate NFS writes. Validate the source against known backup or storage-management hosts before escalating.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Impact |
Rule Body
[metadata]
creation_date = "2026/07/31"
integration = ["network_traffic"]
maturity = "production"
min_stack_comments = "Requires ES|QL JSON_EXTRACT on _source to read NFS opcode and status fields."
min_stack_version = "9.4.0"
updated_date = "2026/07/31"
[rule]
author = ["Elastic"]
description = """
Identifies a burst of successful NFS write activity combined with destructive REMOVE or RENAME operations from a single
client to one export server within a one-minute window. Ransomware and destructive actors often encrypt, delete, or
rename large numbers of files on mounted NFS shares; this aggregation surfaces that behavior using NFS opcode telemetry
when file paths are not available on the wire.
"""
false_positives = [
"""
Backup deduplication engines, migration utilities, and filesystem sync tools can generate high volumes of legitimate
NFS writes. Validate the source against known backup or storage-management hosts before escalating.
""",
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
max_signals = 5
name = "Potential NFS Destructive Operation Burst"
note = """## Triage and analysis
### Investigating Potential NFS Destructive Operation Burst
Remote encryption over NFS typically manifests as sustained successful WRITE activity paired with REMOVE/RENAME
operations from one client IP against a single export. This rule aggregates mutating NFS opcodes because Packetbeat
does not publish individual file paths in the NFS data stream.
### Possible investigation steps
- Review `Esql.write_ops`, `Esql.destructive_ops`, and `Esql.values_opcodes`, and compare `source.ip` to approved backup
or admin hosts.
- Pivot to endpoint telemetry on the source for ransomware families, suspicious processes, or recent `mount.nfs` activity.
- Inspect the export for ransom notes, mass extension changes, or abnormal file timestamps following the alert window.
- Correlate with preceding AUTH_SYS root UID or READDIR-heavy activity from the same client.
### False positive analysis
- Scheduled backup, rsync-style sync, or VM storage migration from known infrastructure is the most common benign cause.
Exception stable backup clients after validating opcode mix and timing against maintenance windows.
### Response and remediation
- Isolate the source host from the export if ransomware is suspected and snapshot the export where possible.
- Revoke export access for the client IP and audit `/etc/exports` for overly permissive entries.
- Restore affected data from immutable backups after confirming the encryption stage has ended.
"""
references = ["https://attack.mitre.org/techniques/T1486/", "https://attack.mitre.org/techniques/T1039/"]
risk_score = 47
rule_id = "8e78b1a5-9674-4a96-8ce7-76ef54566a85"
setup = """## Setup
This rule requires the Elastic **network_traffic** integration with the **NFS** protocol module enabled on a sensor that
observes NFS traffic to monitored export servers.
"""
severity = "medium"
tags = [
"Domain: Network",
"Use Case: Threat Detection",
"Use Case: Network Security Monitoring",
"Tactic: Impact",
"Data Source: Network Packet Capture",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-network_traffic.nfs-*, packetbeat-* metadata _source
| eval
Esql.opcode = TO_UPPER(COALESCE(
JSON_EXTRACT(_source, "network_traffic.nfs.opcode"),
JSON_EXTRACT(_source, "nfs.opcode")
)),
Esql.status = TO_UPPER(COALESCE(
JSON_EXTRACT(_source, "network_traffic.nfs.status"),
JSON_EXTRACT(_source, "nfs.status")
))
| where Esql.opcode in ("WRITE", "REMOVE", "RENAME") and Esql.status == "NFS_OK" and
source.ip is not null and destination.ip is not null
| eval Esql.time_window = DATE_TRUNC(1 minutes, @timestamp)
| eval Esql.is_write = CASE(Esql.opcode == "WRITE", 1, 0),
Esql.is_destructive = CASE(Esql.opcode == "REMOVE" or Esql.opcode == "RENAME", 1, 0)
| stats
Esql.mutating_ops = COUNT(*),
Esql.write_ops = SUM(Esql.is_write),
Esql.destructive_ops = SUM(Esql.is_destructive),
Esql.values_opcodes = VALUES(Esql.opcode)
by Esql.time_window, source.ip, destination.ip
| where Esql.mutating_ops >= 100 and Esql.write_ops > 0 and Esql.destructive_ops >= 20
| keep source.ip, destination.ip, Esql.*
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
[rule.alert_suppression]
group_by = ["source.ip", "destination.ip"]
missing_fields_strategy = "suppress"
[rule.alert_suppression.duration]
unit = "h"
value = 1
Stages and Predicates
Stage 1: from
from logs-network_traffic.nfs-*, packetbeat-* metadata _source
Stage 2: eval
| eval
Esql.opcode = TO_UPPER(COALESCE(
JSON_EXTRACT(_source, "network_traffic.nfs.opcode"),
JSON_EXTRACT(_source, "nfs.opcode")
)),
Esql.status = TO_UPPER(COALESCE(
JSON_EXTRACT(_source, "network_traffic.nfs.status"),
JSON_EXTRACT(_source, "nfs.status")
))
Stage 3: where
| where Esql.opcode in ("WRITE", "REMOVE", "RENAME") and Esql.status == "NFS_OK" and
source.ip is not null and destination.ip is not null
Stage 4: eval
| eval Esql.time_window = DATE_TRUNC(1 minutes, @timestamp)
Stage 5: eval
| eval Esql.is_write = CASE(Esql.opcode == "WRITE", 1, 0),
Esql.is_destructive = CASE(Esql.opcode == "REMOVE" or Esql.opcode == "RENAME", 1, 0)
Esql.is_destructive =Esql.opcode == "REMOVE" or Esql.opcode == "RENAME"10Esql.is_write =Esql.opcode == "WRITE"10Stage 6: stats
| stats
Esql.mutating_ops = COUNT(*),
Esql.write_ops = SUM(Esql.is_write),
Esql.destructive_ops = SUM(Esql.is_destructive),
Esql.values_opcodes = VALUES(Esql.opcode)
by Esql.time_window, source.ip, destination.ip
Stage 7: where
| where Esql.mutating_ops >= 100 and Esql.write_ops > 0 and Esql.destructive_ops >= 20
Stage 8: keep
| keep source.ip, destination.ip, Esql.*
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
source.ip | KEEP source.ip |
destination.ip | KEEP destination.ip |
Esql.* | KEEP Esql.* |
Process Memory Write to a Non Child Process
#Identifies attempts to write or modify protection to the address space of a remote non-child process and by an unsigned or untrusted final user module. This behavior is consistent with remote code injection attacks.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to write or modify protection to the address space of a remote non-child process and by an unsigned
or untrusted final user module. This behavior is consistent with remote code injection attacks.
"""
id = "fa2e2435-d285-485e-9890-dff92cb78ab7"
license = "Elastic License v2"
name = "Process Memory Write to a Non Child Process"
os_list = ["windows"]
version = "1.0.8"
query = '''
api where process.Ext.api.name == "WriteProcessMemory" and
process.executable != null and Target.process.executable != null and
process.Ext.api.behaviors == "cross-process" and process.Ext.api.behaviors != "parent-child" and
Target.process.executable != process.executable and not process.Ext.api.summary : "*Unknown*" and
/* WPM triggers multiple times at process creation */
not (_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*\\kernelbase.dll!CreateProcess*")
and process.Ext.api.summary: ("*PEB*", "*PEB32*", "*ProcessStartupInfo*")) and
not (process.Ext.api.summary: ("*PEB*", "*PEB32*", "*ProcessStartupInfo*") and
process.thread.Ext.call_stack_summary : "ntdll.dll|wow64.dll|Unknown|wow64.dll|ntdll.dll|Unknown") and
/* excluding trusted code signature */
process.thread.Ext.call_stack_final_user_module.code_signature != null and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
not (process.name : "rundll32.exe" and process.Ext.api.parameters.size <= 140 and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name : "Barco N.V." and $entry.status in ("errorTimeStamp", "errorUntrustedRoot"))) and
not (process.executable : ("\\\\?\\Volume{*}\\*.exe", "\\Device\\HarddiskVolume*\\Windows\\*.exe") and process.thread.Ext.call_stack_final_user_module.path : "?:\\*\\docker\\*\\windows\\*.dll") and
not process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined", "Kernel") and
not (Target.process.name : ("UnrealEditor.exe", "UE4Editor.exe", "UnrealEditor-Win64-DebugGame.exe") and process.Ext.api.parameters.size < 6) and
/* excluding multiple unsigned third party modules from programfiles */
not process.thread.Ext.call_stack_final_user_module.path :
("?:\\windows\\assembly\\nativeimages_*",
"?:\\windows\\winsxs\\*.dll",
"?:\\program files\\*",
"?:\\program files (x86)\\*",
"c:\\windows\\apppatch\\ummon.dll",
"c:\\windows\\apppatch\\apppatch64\\ummon.dll",
"c:\\windows\\system32\\ctiuser.dll",
"c:\\windows\\syswow64\\ctiuser.dll",
"c:\\windows\\system32\\hpzipm12.dll",
"c:\\windows\\system32\\lsasrv.dll",
"c:\\windows\\syswow64\\cwbunpls.dll",
"c:\\windows\\system32\\shsvcs.dll",
"c:\\windows\\system32\\sxssrv.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance : ("mfehcthe.dll", "system.core.ni.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("?:\\program files\\*", "?:\\program files (x86)\\*", "c:\\windows\\assembly\\nativeimages_*") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
("27fe00d32f773a95e6d50986e5e7499917f66ce881e46054c77652ef4bdf3512",
"a59e039e1520b74254a454bf48c2bceeafe7bd7ac6e5886baa482a52f86a29bf",
"f01bb9aba3f9daf4d8f5551a3b753d8011e16072a1103cf5303d617a9f866424",
"16184cf6f54d6ac4eb0a31c0e9ee8ae775bae6dfdc632e283e832f3e89de595d",
"c983d11ad519a851aca2d37739110b7913819bea1ddf2cc3ec69efe3ed3b609f",
"c3cd2439a6175ce28192904e72b14523b02559d8083a710b5e82aee400626d1a",
"7396f943823494d2ec5f2260329daa2d35b1764f01cdefd95f84ae320986a8f3",
"efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab",
"8eb0721092af3131a940f1e23bc2871e09362980e0b71a7ed7dab6e8accd1f30",
"6edb20df25d1cf0fd1b27052f2604a05db1d7ca5a3f074e7bacc229e28d17667",
"67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68",
"914299dd77f4322c99f62c37df1317ea3424d9a747d4635d10c1d3f003f6abd4",
"51b63860fd996d6d5b1753ba6bb7f3a4303f13187fbfecc96ba2b6bae52a7410",
"0255b5bf7ad66aa090be145f0ad41a0f4e33409ff5c2970081fccd863c720779",
"925a5cd982933bae1b271e1aaaa887ab469397701cd299f4397ddd8af5a351f9",
"9cb1208f1747963dc57e8bf8a8fe82b3aaa856caae3d151b6a6b97b23369f5a6",
"681303f5b5688075b5b504819d8b3c343c78e3240a3bccf371e03228970ffb10",
"30b59303bec45b020b4878b2d33d63bd719d89820456a7ee0a920178efe089f4",
"8ee5bd6fea98577bd29c15055e96ec17c62ca415f4a5d26065b25a922b19d3b1",
"57854d83b50ff0a23d47c077d6da875874ea78f88f28168d8e99ffbf9f1c3153",
"c4788275a5ed2c1576e69b59e6e267ce573450ff07e54b799ec4c4edef40b502",
"a4637935f895de601850c6868d952977a84076a7b1719d0deb519f1fc0871be4",
"a99ac2554c1e392ffe3cd53f7f72f76638948533795fc04f7e15454c386b7eec",
"b031da6137f9442a6cc9f4b4546b4057b666726cb7c9224c4ca857a60f2ec1e1",
"586d8eeaec3a439978836a512bf2f5a987cbe2ba72e5bb10322d04cd65fe8d09",
"ebdc2c2cedd5e549ba8d5e3f474d29204e1cf073e2b26e75f60bb429d2b5a088",
"80eb757f729a943ff0919df1eb980b80f8419f76648407834d95c76adfd21624",
"e71eb30f24c82bc4fa1c645eecbe343f5a44526043fc3a13047183dac5f212f3",
"c46f9f3c710ff2baabea480670220e0328e7bcc2aa3c598c3f982728e0b5652d",
"7f1ab7572a89534366172df3ae5f0182aab1ae3ef992b684a84c5c1a10e8315f",
"d7624e57820ccd1bae7881e08af40bc3522971278018fdfbe0ca98302292165c",
"e0f11ad44d1c1e11f9308f9aaee4d8bcac86ff6e0b4a41d1e75879f6cfd56049",
"2266a567ba921d1c2661258cd5b31150274cb781ac01413c34a471557123ba65",
"1f2e936a57994e16b457f249a64af4786877f7beaab003fb521a20e45031f408",
"e8eaf74988082b8c8222dabed68218069c8eb4e93acd3619a776bc28d39e5ce5",
"39fdb47a5f349e06bbb7dc1cedcc81a051d1dffe373956871325f8327e858afa",
"f7af5eac1d34a2ddc619dd0c3172ec28334b8d79efc1f8ad758124b7e5aae0d5",
"8f3d19065d0d1295bbfbf7591aa02af3a5dc70fde74bac670c18ccd8f7306008",
"d6b771bedda261bcfe9dd1d1402b7d33b5cd2764cd53d941957e32920cfbeb19",
"3e02857de5a59331e1f7fc7e1ddf5ae58e8680d298bb44b49bd316e0b3a1f024",
"954b4385cf4faecfbf9cd04e01c059eb09113a78ee727149b63a65b495a28a6c",
"8851b734602eb00da5b1cfc1e40d38f1cb32e0add2df257ff9d7dbd520b4d5da",
"b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac",
"5231df995d71991ee4108937bb12e4d3f344a96fb0c4cd82c14e18061d6c4730",
"4daef5be9503c580697b36b0b60a702c109e23840c0632ca00ef4a233603018e",
"fd788a077e026905f1565e0d2a65dfc6c55699c098a59879d6b0b3f3b8459ae8",
"dc641636d5d782b31d29ce823e951d1a2164c86ee06bf2f65a841360fb7af356",
"fb4a05ce7d50721c71f66c37e0ab7e52cd46034a2e394940b3f60c9c2afb079a",
"862a7e8c68f05b91ecf3a43ac5b60c6f57ee50fa98ad1b539480d541628f5c2e",
"44c87532cbb511c369b38a105fc5a84b1d89dba9dfdd5a62c311d6176fe93201",
"465aade5769d4cae2ca1f365ca634440a0444ca0ce319171c140c362d12859c4",
"d615af8e012426c8847c750a0838159d6c41385d2e50388cea28a97999b81614",
"9c63bfc10af9e801f0a009cb5e3c3c097d5eae8ee00351e2bcaa672ead352df4",
"8bca3967254a38d6789c90afe136e34e96b5840b3fc77826dcf3c73b44016ea2",
"dc2d5b2d59a18cd4e749d2cd709e4ada3751ef59d188a8bbab1bbd7562f2d609",
"759f7e4d46e10d3de2fad228994ae8bb142ff171082d175b5d233895efa047be",
"bea84d6541a56c63c570d7b637d18b4de3348c6f8b96b536002da1e7c268879f",
"bc66341f3d2cd4d5216612869731a9f653fa4d75b429ee944a0802ae9457367f",
"5497ff34548a2a0c948024e0d4f21005c18f82ed01246ee98dbb33c0389670c8",
"ebbc8af232a86e870ecf0cbb3f6c3dc79e740c14e907437bab449e2a1e098ed3",
"f3cb863c2a8f16a5f1a4ec5a4d7036f7a0b444cbd4f52226c0d463154e8d5428",
"646c951524f1fab3aaa70a4cff9469ab658a2a0bdeea4e88aa18072c54c83430",
"c79d56dacc8e28b662dcc5fe922453d225441bfa73656942beb205bf4ad20066",
"d0735ca28e1f806da75e83a8405ed431d991c7476bc79c8be6c7b27ccce0ac31",
"175184977cf02e59af9674a24a2f2b0d8278bf886f9f7e05ef8878b5364dc3bb",
"7214d926419fe847a4795a74f9b73209990e4927bb5b56128cf30703be68cde7",
"f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"5bcb5bd390665792c5e597bcc569caa9bfb942ef7946014eb60dcef0fcf586a6",
"07d6c3a19a8e3e243e9545a41dd30a9ee1e9ad79cdd6d446c229d689e5ab574a",
"3d171205aec848f93b721891806ff86b36ba639923067f6e5dabc4cf500f5831",
"7b55a781fef86de1dd56f8956b5160d74de10c9c9179e7f5b38331eb4eefd9af",
"593384d6a5d77c75426c0fe7d93663d24e9797548dd52ff8d60f9c25ac0b70f9",
"67fffdf1b96050f8eca6e844cb23fcee2ef54f85fbfb7786ad9d6d3c39d84415",
"e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d",
"bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4",
"4f1f25bb19905c34bf75436d32c48df96afd9872c0f5fc5ab45e31f9783e1ace",
"0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5",
"6e54f990149523e9b25c4dd804986f55bdbf846ba1261f8a0ba285cdfabe0bab",
"2c8483ea06618e3c501678e4b7bd77f2e1c068cfa88c0f168abffa5f78b328ea",
"03e03d5726da2ca346a0130cf01b7fa4af46b5f8b9370d1cf63ddde1c72dd6d2",
"0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5",
"494ee86d2a538f23fcfbab1507612637b4af2b97166ed1e3b5f86da74506bca4",
"341f3841335bf2e4e2d2fe39672c591fbc819b0b64b654fc198000234fb8052b",
"9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8",
"27f6d804c989ddae14c94768240c639e14fc94bac4a56156c4f1925682004f89",
"ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696",
"4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280",
"35e1443640e39922f5488cba77b10fd97a58c65e0c4d2a0dcdd16a276c3677e1",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"c9b456c3722c60e680e8bbf3a8c9aad55bbea6af0f8de7340e4573b23b1272b6",
"472232ca821b5c2ef562ab07f53638bc2cc82eae84cea13fbe674d6022b6481c",
"cd4aa919f346bee759d4aded15c57901026307446546f8c296fa706e2e109095",
"e3a6a3337494667a6cfd7578e9a6c6b5f17f4cac82ae9a98d56cd4c2ae701542",
"0884f057877298b3dd93f3ffd749692820f7e8df52f907480484dab5000048f4",
"7291b1c32671f5416ea33d1f14ca6a36dc77e166a12e6a3868ba68b9ebfdc3d3",
"00bf4e4083d79196e54b39e2d957b25b50807c922d3cc09f5661215536895f4b",
"fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612",
"6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9",
"9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8",
"418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1",
"e09a338081b83a42e97b60311d9af749baaedb226b155d9e7bd658de1c5a349d",
"d0a62a67891bbd4eb263d328e5bf6da080bcd7d16c3b1d73e563a48263062c5a",
"1f8a5ff26f722b380754d794ad4b8d9edf69361e18ea0a2a03ed58d61e91849c",
"1dfc0c4f5442dcff2082d9258254b6861c27001aada055d960844561e699655b",
"96dca741745683eb5c2ad857e2520ccf62ab2d08eae359f6928495073925faee",
"8e1ab3bfaf8f190abb0b8a229cc7c06c6ba00f2455e60515df4bc8a78a778bc5",
"56d4677887fbcb70e9ac1b97db622c6872b610dcf4b6f0ce10a413b7ec325e19",
"1a8dcfe9d366e0075595164ed6a3a7cf65081e0595fba70bc2254647bc89c281",
"379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91",
"9e0619c604757c70bb9b0df1e43c111e32b24669522ddc75028409cfacf40197",
"ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22",
"6649961021d30e565e60c27db58305c6750b580231a0d7331522ad277a769dd3",
"1dc9d6fc9015eee05d40c876b622bef542292f2d81382dbf0845ff82ed18d25d",
"011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
"e09816f0c305936ce1061c46a35e7d1883a08acf81f94793d9d07455421761dd",
"37cf45f320b9bc4ca198bd93ac1f7882756d82f491809ea4f8907c69cfe1c9ae",
"fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e",
"9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd",
"a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014",
"e2f9e698b01ea5e525396ddb86d5dbfcf85f6f19d6e9b8e4f1d75cbcd0da626d",
"ff31fa811f9c07cc7fdaa68c9e8bca3a7b4fdf6e0a079a58175ea58ba139c7ae",
"da8a30160ab0fe450cc42aad45999e22ea848ac9a98814d420c4da884e733e22",
"af3d6298a8cd7293479f77eab032478e766dae44749489b9568c9fa50ce70890",
"32144dbc32aef6b1eab071968c2c2ee6eaf477dcb4a8eb7b8967824f48db17b7",
"11d87cac25f6d438db6c6dfec631f97fa5f6ad98e7d99fa50ac1479706efb3b5",
"c729c4b5a6ad8d247acd4b0d32d5a5999647461ee5f565c618b26d339caebbca",
"0537c3dd2378218508ebe3cc416d72a99ee2d24ae1c5525e23458f32544ef861")
'''
min_endpoint_version = "8.14.2"
[[actions]]
action = "kill_process"
field = "Target.process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.2"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "WriteProcessMemory" and
process.executable != null and Target.process.executable != null and
process.Ext.api.behaviors == "cross-process" and process.Ext.api.behaviors != "parent-child" and
Target.process.executable != process.executable and not process.Ext.api.summary : "*Unknown*" and
not (_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*\\kernelbase.dll!CreateProcess*")
and process.Ext.api.summary: ("*PEB*", "*PEB32*", "*ProcessStartupInfo*")) and
not (process.Ext.api.summary: ("*PEB*", "*PEB32*", "*ProcessStartupInfo*") and
process.thread.Ext.call_stack_summary : "ntdll.dll|wow64.dll|Unknown|wow64.dll|ntdll.dll|Unknown") and
process.thread.Ext.call_stack_final_user_module.code_signature != null and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
not (process.name : "rundll32.exe" and process.Ext.api.parameters.size <= 140 and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name : "Barco N.V." and $entry.status in ("errorTimeStamp", "errorUntrustedRoot"))) and
not (process.executable : ("\\\\?\\Volume{*}\\*.exe", "\\Device\\HarddiskVolume*\\Windows\\*.exe") and process.thread.Ext.call_stack_final_user_module.path : "?:\\*\\docker\\*\\windows\\*.dll") and
not process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined", "Kernel") and
not (Target.process.name : ("UnrealEditor.exe", "UE4Editor.exe", "UnrealEditor-Win64-DebugGame.exe") and process.Ext.api.parameters.size < 6) and
not process.thread.Ext.call_stack_final_user_module.path :
("?:\\windows\\assembly\\nativeimages_*",
"?:\\windows\\winsxs\\*.dll",
"?:\\program files\\*",
"?:\\program files (x86)\\*",
"c:\\windows\\apppatch\\ummon.dll",
"c:\\windows\\apppatch\\apppatch64\\ummon.dll",
"c:\\windows\\system32\\ctiuser.dll",
"c:\\windows\\syswow64\\ctiuser.dll",
"c:\\windows\\system32\\hpzipm12.dll",
"c:\\windows\\system32\\lsasrv.dll",
"c:\\windows\\syswow64\\cwbunpls.dll",
"c:\\windows\\system32\\shsvcs.dll",
"c:\\windows\\system32\\sxssrv.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance : ("mfehcthe.dll", "system.core.ni.dll") and
not process.thread.Ext.call_stack_final_user_module.protection_provenance_path : ("?:\\program files\\*", "?:\\program files (x86)\\*", "c:\\windows\\assembly\\nativeimages_*") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
("27fe00d32f773a95e6d50986e5e7499917f66ce881e46054c77652ef4bdf3512",
"a59e039e1520b74254a454bf48c2bceeafe7bd7ac6e5886baa482a52f86a29bf",
"f01bb9aba3f9daf4d8f5551a3b753d8011e16072a1103cf5303d617a9f866424",
"16184cf6f54d6ac4eb0a31c0e9ee8ae775bae6dfdc632e283e832f3e89de595d",
"c983d11ad519a851aca2d37739110b7913819bea1ddf2cc3ec69efe3ed3b609f",
"c3cd2439a6175ce28192904e72b14523b02559d8083a710b5e82aee400626d1a",
"7396f943823494d2ec5f2260329daa2d35b1764f01cdefd95f84ae320986a8f3",
"efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab",
"8eb0721092af3131a940f1e23bc2871e09362980e0b71a7ed7dab6e8accd1f30",
"6edb20df25d1cf0fd1b27052f2604a05db1d7ca5a3f074e7bacc229e28d17667",
"67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68",
"914299dd77f4322c99f62c37df1317ea3424d9a747d4635d10c1d3f003f6abd4",
"51b63860fd996d6d5b1753ba6bb7f3a4303f13187fbfecc96ba2b6bae52a7410",
"0255b5bf7ad66aa090be145f0ad41a0f4e33409ff5c2970081fccd863c720779",
"925a5cd982933bae1b271e1aaaa887ab469397701cd299f4397ddd8af5a351f9",
"9cb1208f1747963dc57e8bf8a8fe82b3aaa856caae3d151b6a6b97b23369f5a6",
"681303f5b5688075b5b504819d8b3c343c78e3240a3bccf371e03228970ffb10",
"30b59303bec45b020b4878b2d33d63bd719d89820456a7ee0a920178efe089f4",
"8ee5bd6fea98577bd29c15055e96ec17c62ca415f4a5d26065b25a922b19d3b1",
"57854d83b50ff0a23d47c077d6da875874ea78f88f28168d8e99ffbf9f1c3153",
"c4788275a5ed2c1576e69b59e6e267ce573450ff07e54b799ec4c4edef40b502",
"a4637935f895de601850c6868d952977a84076a7b1719d0deb519f1fc0871be4",
"a99ac2554c1e392ffe3cd53f7f72f76638948533795fc04f7e15454c386b7eec",
"b031da6137f9442a6cc9f4b4546b4057b666726cb7c9224c4ca857a60f2ec1e1",
"586d8eeaec3a439978836a512bf2f5a987cbe2ba72e5bb10322d04cd65fe8d09",
"ebdc2c2cedd5e549ba8d5e3f474d29204e1cf073e2b26e75f60bb429d2b5a088",
"80eb757f729a943ff0919df1eb980b80f8419f76648407834d95c76adfd21624",
"e71eb30f24c82bc4fa1c645eecbe343f5a44526043fc3a13047183dac5f212f3",
"c46f9f3c710ff2baabea480670220e0328e7bcc2aa3c598c3f982728e0b5652d",
"7f1ab7572a89534366172df3ae5f0182aab1ae3ef992b684a84c5c1a10e8315f",
"d7624e57820ccd1bae7881e08af40bc3522971278018fdfbe0ca98302292165c",
"e0f11ad44d1c1e11f9308f9aaee4d8bcac86ff6e0b4a41d1e75879f6cfd56049",
"2266a567ba921d1c2661258cd5b31150274cb781ac01413c34a471557123ba65",
"1f2e936a57994e16b457f249a64af4786877f7beaab003fb521a20e45031f408",
"e8eaf74988082b8c8222dabed68218069c8eb4e93acd3619a776bc28d39e5ce5",
"39fdb47a5f349e06bbb7dc1cedcc81a051d1dffe373956871325f8327e858afa",
"f7af5eac1d34a2ddc619dd0c3172ec28334b8d79efc1f8ad758124b7e5aae0d5",
"8f3d19065d0d1295bbfbf7591aa02af3a5dc70fde74bac670c18ccd8f7306008",
"d6b771bedda261bcfe9dd1d1402b7d33b5cd2764cd53d941957e32920cfbeb19",
"3e02857de5a59331e1f7fc7e1ddf5ae58e8680d298bb44b49bd316e0b3a1f024",
"954b4385cf4faecfbf9cd04e01c059eb09113a78ee727149b63a65b495a28a6c",
"8851b734602eb00da5b1cfc1e40d38f1cb32e0add2df257ff9d7dbd520b4d5da",
"b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac",
"5231df995d71991ee4108937bb12e4d3f344a96fb0c4cd82c14e18061d6c4730",
"4daef5be9503c580697b36b0b60a702c109e23840c0632ca00ef4a233603018e",
"fd788a077e026905f1565e0d2a65dfc6c55699c098a59879d6b0b3f3b8459ae8",
"dc641636d5d782b31d29ce823e951d1a2164c86ee06bf2f65a841360fb7af356",
"fb4a05ce7d50721c71f66c37e0ab7e52cd46034a2e394940b3f60c9c2afb079a",
"862a7e8c68f05b91ecf3a43ac5b60c6f57ee50fa98ad1b539480d541628f5c2e",
"44c87532cbb511c369b38a105fc5a84b1d89dba9dfdd5a62c311d6176fe93201",
"465aade5769d4cae2ca1f365ca634440a0444ca0ce319171c140c362d12859c4",
"d615af8e012426c8847c750a0838159d6c41385d2e50388cea28a97999b81614",
"9c63bfc10af9e801f0a009cb5e3c3c097d5eae8ee00351e2bcaa672ead352df4",
"8bca3967254a38d6789c90afe136e34e96b5840b3fc77826dcf3c73b44016ea2",
"dc2d5b2d59a18cd4e749d2cd709e4ada3751ef59d188a8bbab1bbd7562f2d609",
"759f7e4d46e10d3de2fad228994ae8bb142ff171082d175b5d233895efa047be",
"bea84d6541a56c63c570d7b637d18b4de3348c6f8b96b536002da1e7c268879f",
"bc66341f3d2cd4d5216612869731a9f653fa4d75b429ee944a0802ae9457367f",
"5497ff34548a2a0c948024e0d4f21005c18f82ed01246ee98dbb33c0389670c8",
"ebbc8af232a86e870ecf0cbb3f6c3dc79e740c14e907437bab449e2a1e098ed3",
"f3cb863c2a8f16a5f1a4ec5a4d7036f7a0b444cbd4f52226c0d463154e8d5428",
"646c951524f1fab3aaa70a4cff9469ab658a2a0bdeea4e88aa18072c54c83430",
"c79d56dacc8e28b662dcc5fe922453d225441bfa73656942beb205bf4ad20066",
"d0735ca28e1f806da75e83a8405ed431d991c7476bc79c8be6c7b27ccce0ac31",
"175184977cf02e59af9674a24a2f2b0d8278bf886f9f7e05ef8878b5364dc3bb",
"7214d926419fe847a4795a74f9b73209990e4927bb5b56128cf30703be68cde7",
"f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1",
"5bcb5bd390665792c5e597bcc569caa9bfb942ef7946014eb60dcef0fcf586a6",
"07d6c3a19a8e3e243e9545a41dd30a9ee1e9ad79cdd6d446c229d689e5ab574a",
"3d171205aec848f93b721891806ff86b36ba639923067f6e5dabc4cf500f5831",
"7b55a781fef86de1dd56f8956b5160d74de10c9c9179e7f5b38331eb4eefd9af",
"593384d6a5d77c75426c0fe7d93663d24e9797548dd52ff8d60f9c25ac0b70f9",
"67fffdf1b96050f8eca6e844cb23fcee2ef54f85fbfb7786ad9d6d3c39d84415",
"e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d",
"bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4",
"4f1f25bb19905c34bf75436d32c48df96afd9872c0f5fc5ab45e31f9783e1ace",
"0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5",
"6e54f990149523e9b25c4dd804986f55bdbf846ba1261f8a0ba285cdfabe0bab",
"2c8483ea06618e3c501678e4b7bd77f2e1c068cfa88c0f168abffa5f78b328ea",
"03e03d5726da2ca346a0130cf01b7fa4af46b5f8b9370d1cf63ddde1c72dd6d2",
"0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5",
"494ee86d2a538f23fcfbab1507612637b4af2b97166ed1e3b5f86da74506bca4",
"341f3841335bf2e4e2d2fe39672c591fbc819b0b64b654fc198000234fb8052b",
"9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8",
"27f6d804c989ddae14c94768240c639e14fc94bac4a56156c4f1925682004f89",
"ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696",
"4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280",
"35e1443640e39922f5488cba77b10fd97a58c65e0c4d2a0dcdd16a276c3677e1",
"b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056",
"c9b456c3722c60e680e8bbf3a8c9aad55bbea6af0f8de7340e4573b23b1272b6",
"472232ca821b5c2ef562ab07f53638bc2cc82eae84cea13fbe674d6022b6481c",
"cd4aa919f346bee759d4aded15c57901026307446546f8c296fa706e2e109095",
"e3a6a3337494667a6cfd7578e9a6c6b5f17f4cac82ae9a98d56cd4c2ae701542",
"0884f057877298b3dd93f3ffd749692820f7e8df52f907480484dab5000048f4",
"7291b1c32671f5416ea33d1f14ca6a36dc77e166a12e6a3868ba68b9ebfdc3d3",
"00bf4e4083d79196e54b39e2d957b25b50807c922d3cc09f5661215536895f4b",
"fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612",
"6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9",
"9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8",
"418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1",
"e09a338081b83a42e97b60311d9af749baaedb226b155d9e7bd658de1c5a349d",
"d0a62a67891bbd4eb263d328e5bf6da080bcd7d16c3b1d73e563a48263062c5a",
"1f8a5ff26f722b380754d794ad4b8d9edf69361e18ea0a2a03ed58d61e91849c",
"1dfc0c4f5442dcff2082d9258254b6861c27001aada055d960844561e699655b",
"96dca741745683eb5c2ad857e2520ccf62ab2d08eae359f6928495073925faee",
"8e1ab3bfaf8f190abb0b8a229cc7c06c6ba00f2455e60515df4bc8a78a778bc5",
"56d4677887fbcb70e9ac1b97db622c6872b610dcf4b6f0ce10a413b7ec325e19",
"1a8dcfe9d366e0075595164ed6a3a7cf65081e0595fba70bc2254647bc89c281",
"379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91",
"9e0619c604757c70bb9b0df1e43c111e32b24669522ddc75028409cfacf40197",
"ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22",
"6649961021d30e565e60c27db58305c6750b580231a0d7331522ad277a769dd3",
"1dc9d6fc9015eee05d40c876b622bef542292f2d81382dbf0845ff82ed18d25d",
"011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
"e09816f0c305936ce1061c46a35e7d1883a08acf81f94793d9d07455421761dd",
"37cf45f320b9bc4ca198bd93ac1f7882756d82f491809ea4f8907c69cfe1c9ae",
"fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e",
"9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd",
"a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014",
"e2f9e698b01ea5e525396ddb86d5dbfcf85f6f19d6e9b8e4f1d75cbcd0da626d",
"ff31fa811f9c07cc7fdaa68c9e8bca3a7b4fdf6e0a079a58175ea58ba139c7ae",
"da8a30160ab0fe450cc42aad45999e22ea848ac9a98814d420c4da884e733e22",
"af3d6298a8cd7293479f77eab032478e766dae44749489b9568c9fa50ce70890",
"32144dbc32aef6b1eab071968c2c2ee6eaf477dcb4a8eb7b8967824f48db17b7",
"11d87cac25f6d438db6c6dfec631f97fa5f6ad98e7d99fa50ac1479706efb3b5",
"c729c4b5a6ad8d247acd4b0d32d5a5999647461ee5f565c618b26d339caebbca",
"0537c3dd2378218508ebe3cc416d72a99ee2d24ae1c5525e23458f32544ef861")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.Ext.api.parameters.size | le | 140 | excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"140" |
process.name | eq | rundll32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.Ext.api.summary | match | PEB, PEB32, ProcessStartupInfo | excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"PEB" field:"process.Ext.api.summary" value:"PEB32" field:"process.Ext.api.summary" value:"ProcessStartupInfo" |
Target.process.name | eq | UnrealEditor.exe, UE4Editor.exe, UnrealEditor-Win64-DebugGame.exe | excludes:Target.process.name field:"Target.process.name" value:"UnrealEditor.exe" field:"Target.process.name" value:"UE4Editor.exe" field:"Target.process.name" value:"UnrealEditor-Win64-DebugGame.exe" |
process.Ext.api.parameters.size | lt | 6 | excludes:process.Ext.api.parameters.size field:"process.Ext.api.parameters.size" value:"6" |
process.thread.Ext.call_stack_summary | eq | ntdll.dll|wow64.dll|Unknown|wow64.dll|ntdll.dll|Unknown | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|wow64.dll|Unknown|wow64.dll|ntdll.dll|Unknown" |
process.executable | wildcard | \\?\Volume{*}\*.exe, \Device\HarddiskVolume*\Windows\*.exe | excludes:process.executable field:"process.executable" value:"\\?\Volume{*}\*.exe" field:"process.executable" value:"\Device\HarddiskVolume*\Windows\*.exe" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | ?:\*\docker\*\windows\*.dll | excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"?:\*\docker\*\windows\*.dll" |
process.Ext.api.summary | match | Unknown | excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"Unknown" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | eq | 27fe00d32f773a95e6d50986e5e7499917f66ce881e46054c77652ef4bdf3512, a59e039e1520b74254a454bf48c2bceeafe7bd7ac6e5886baa482a52f86a29bf, f01bb9aba3f9daf4d8f5551a3b753d8011e16072a1103cf5303d617a9f866424, 16184cf6f54d6ac4eb0a31c0e9ee8ae775bae6dfdc632e283e832f3e89de595d, c983d11ad519a851aca2d37739110b7913819bea1ddf2cc3ec69efe3ed3b609f, c3cd2439a6175ce28192904e72b14523b02559d8083a710b5e82aee400626d1a, 7396f943823494d2ec5f2260329daa2d35b1764f01cdefd95f84ae320986a8f3, efd03f2525e69cdc30b5736af74d9485728b8a94d5624da87f1431b3706980ab, 8eb0721092af3131a940f1e23bc2871e09362980e0b71a7ed7dab6e8accd1f30, 6edb20df25d1cf0fd1b27052f2604a05db1d7ca5a3f074e7bacc229e28d17667, 67435999749d9e6908a4029321c0c6f9e915135e98e01a7e499a1c55a960bc68, 914299dd77f4322c99f62c37df1317ea3424d9a747d4635d10c1d3f003f6abd4, 51b63860fd996d6d5b1753ba6bb7f3a4303f13187fbfecc96ba2b6bae52a7410, 0255b5bf7ad66aa090be145f0ad41a0f4e33409ff5c2970081fccd863c720779, 925a5cd982933bae1b271e1aaaa887ab469397701cd299f4397ddd8af5a351f9, 9cb1208f1747963dc57e8bf8a8fe82b3aaa856caae3d151b6a6b97b23369f5a6, 681303f5b5688075b5b504819d8b3c343c78e3240a3bccf371e03228970ffb10, 30b59303bec45b020b4878b2d33d63bd719d89820456a7ee0a920178efe089f4, 8ee5bd6fea98577bd29c15055e96ec17c62ca415f4a5d26065b25a922b19d3b1, 57854d83b50ff0a23d47c077d6da875874ea78f88f28168d8e99ffbf9f1c3153, c4788275a5ed2c1576e69b59e6e267ce573450ff07e54b799ec4c4edef40b502, a4637935f895de601850c6868d952977a84076a7b1719d0deb519f1fc0871be4, a99ac2554c1e392ffe3cd53f7f72f76638948533795fc04f7e15454c386b7eec, b031da6137f9442a6cc9f4b4546b4057b666726cb7c9224c4ca857a60f2ec1e1, 586d8eeaec3a439978836a512bf2f5a987cbe2ba72e5bb10322d04cd65fe8d09, ebdc2c2cedd5e549ba8d5e3f474d29204e1cf073e2b26e75f60bb429d2b5a088, 80eb757f729a943ff0919df1eb980b80f8419f76648407834d95c76adfd21624, e71eb30f24c82bc4fa1c645eecbe343f5a44526043fc3a13047183dac5f212f3, c46f9f3c710ff2baabea480670220e0328e7bcc2aa3c598c3f982728e0b5652d, 7f1ab7572a89534366172df3ae5f0182aab1ae3ef992b684a84c5c1a10e8315f, d7624e57820ccd1bae7881e08af40bc3522971278018fdfbe0ca98302292165c, e0f11ad44d1c1e11f9308f9aaee4d8bcac86ff6e0b4a41d1e75879f6cfd56049, 2266a567ba921d1c2661258cd5b31150274cb781ac01413c34a471557123ba65, 1f2e936a57994e16b457f249a64af4786877f7beaab003fb521a20e45031f408, e8eaf74988082b8c8222dabed68218069c8eb4e93acd3619a776bc28d39e5ce5, 39fdb47a5f349e06bbb7dc1cedcc81a051d1dffe373956871325f8327e858afa, f7af5eac1d34a2ddc619dd0c3172ec28334b8d79efc1f8ad758124b7e5aae0d5, 8f3d19065d0d1295bbfbf7591aa02af3a5dc70fde74bac670c18ccd8f7306008, d6b771bedda261bcfe9dd1d1402b7d33b5cd2764cd53d941957e32920cfbeb19, 3e02857de5a59331e1f7fc7e1ddf5ae58e8680d298bb44b49bd316e0b3a1f024, 954b4385cf4faecfbf9cd04e01c059eb09113a78ee727149b63a65b495a28a6c, 8851b734602eb00da5b1cfc1e40d38f1cb32e0add2df257ff9d7dbd520b4d5da, b2d86212afab00e7b9bf19b7931277130b653c9258ac419a7a24d749471ea5ac, 5231df995d71991ee4108937bb12e4d3f344a96fb0c4cd82c14e18061d6c4730, 4daef5be9503c580697b36b0b60a702c109e23840c0632ca00ef4a233603018e, fd788a077e026905f1565e0d2a65dfc6c55699c098a59879d6b0b3f3b8459ae8, dc641636d5d782b31d29ce823e951d1a2164c86ee06bf2f65a841360fb7af356, fb4a05ce7d50721c71f66c37e0ab7e52cd46034a2e394940b3f60c9c2afb079a, 862a7e8c68f05b91ecf3a43ac5b60c6f57ee50fa98ad1b539480d541628f5c2e, 44c87532cbb511c369b38a105fc5a84b1d89dba9dfdd5a62c311d6176fe93201, 465aade5769d4cae2ca1f365ca634440a0444ca0ce319171c140c362d12859c4, d615af8e012426c8847c750a0838159d6c41385d2e50388cea28a97999b81614, 9c63bfc10af9e801f0a009cb5e3c3c097d5eae8ee00351e2bcaa672ead352df4, 8bca3967254a38d6789c90afe136e34e96b5840b3fc77826dcf3c73b44016ea2, dc2d5b2d59a18cd4e749d2cd709e4ada3751ef59d188a8bbab1bbd7562f2d609, 759f7e4d46e10d3de2fad228994ae8bb142ff171082d175b5d233895efa047be, bea84d6541a56c63c570d7b637d18b4de3348c6f8b96b536002da1e7c268879f, bc66341f3d2cd4d5216612869731a9f653fa4d75b429ee944a0802ae9457367f, 5497ff34548a2a0c948024e0d4f21005c18f82ed01246ee98dbb33c0389670c8, ebbc8af232a86e870ecf0cbb3f6c3dc79e740c14e907437bab449e2a1e098ed3, f3cb863c2a8f16a5f1a4ec5a4d7036f7a0b444cbd4f52226c0d463154e8d5428, 646c951524f1fab3aaa70a4cff9469ab658a2a0bdeea4e88aa18072c54c83430, c79d56dacc8e28b662dcc5fe922453d225441bfa73656942beb205bf4ad20066, d0735ca28e1f806da75e83a8405ed431d991c7476bc79c8be6c7b27ccce0ac31, 175184977cf02e59af9674a24a2f2b0d8278bf886f9f7e05ef8878b5364dc3bb, 7214d926419fe847a4795a74f9b73209990e4927bb5b56128cf30703be68cde7, f7c78dba07128af325d8da99138ebf78be163ecfb5da5b01fa6b65b96efecef1, 5bcb5bd390665792c5e597bcc569caa9bfb942ef7946014eb60dcef0fcf586a6, 07d6c3a19a8e3e243e9545a41dd30a9ee1e9ad79cdd6d446c229d689e5ab574a, 3d171205aec848f93b721891806ff86b36ba639923067f6e5dabc4cf500f5831, 7b55a781fef86de1dd56f8956b5160d74de10c9c9179e7f5b38331eb4eefd9af, 593384d6a5d77c75426c0fe7d93663d24e9797548dd52ff8d60f9c25ac0b70f9, 67fffdf1b96050f8eca6e844cb23fcee2ef54f85fbfb7786ad9d6d3c39d84415, e3fdcd2b4c5215e74b0cabe91ce7fe2800cbf8e2a28157342960bca61bbd6b5d, bd6843726688bd7253a42180bf95671ad5b0f9e787adb4f13250f484abd9eae4, 4f1f25bb19905c34bf75436d32c48df96afd9872c0f5fc5ab45e31f9783e1ace, 0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5, 6e54f990149523e9b25c4dd804986f55bdbf846ba1261f8a0ba285cdfabe0bab, 2c8483ea06618e3c501678e4b7bd77f2e1c068cfa88c0f168abffa5f78b328ea, 03e03d5726da2ca346a0130cf01b7fa4af46b5f8b9370d1cf63ddde1c72dd6d2, 0d6ff0e37139ee86d2991d2b8389f36316778ddb6e44a6d6c727e2d4b87693a5, 494ee86d2a538f23fcfbab1507612637b4af2b97166ed1e3b5f86da74506bca4, 341f3841335bf2e4e2d2fe39672c591fbc819b0b64b654fc198000234fb8052b, 9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8, 27f6d804c989ddae14c94768240c639e14fc94bac4a56156c4f1925682004f89, ddcbecf2cd2cd4904cf21e3db40c6a918df0ed3b258473fc5d6e2688dee72696, 4e4b9bcef90731eb9b1306610fc89ba31296a5875ff5ba628f7271130aa61280, 35e1443640e39922f5488cba77b10fd97a58c65e0c4d2a0dcdd16a276c3677e1, b152de9afc373bba831dc9c1b137668462ae6d46ccd46815f2ffcc7f1bfc7056, c9b456c3722c60e680e8bbf3a8c9aad55bbea6af0f8de7340e4573b23b1272b6, 472232ca821b5c2ef562ab07f53638bc2cc82eae84cea13fbe674d6022b6481c, cd4aa919f346bee759d4aded15c57901026307446546f8c296fa706e2e109095, e3a6a3337494667a6cfd7578e9a6c6b5f17f4cac82ae9a98d56cd4c2ae701542, 0884f057877298b3dd93f3ffd749692820f7e8df52f907480484dab5000048f4, 7291b1c32671f5416ea33d1f14ca6a36dc77e166a12e6a3868ba68b9ebfdc3d3, 00bf4e4083d79196e54b39e2d957b25b50807c922d3cc09f5661215536895f4b, fdef73d692e2e181075bf43a05cd7ebe551f6b1be31f4d471ff709f83a549612, 6eed2886728608f1b3f4a54a7a7d338ef1b1669f6f53a5d38bcd352f0ec755c9, 9840c97b35afb77418d541ef2f1b5da93c0d7d9632c334ec7444ceadeb0f9fa8, 418a7dc57d5ac225d7f012fe90a1668a797fde56c9add6c3aad841ab0c1e2bc1, e09a338081b83a42e97b60311d9af749baaedb226b155d9e7bd658de1c5a349d, d0a62a67891bbd4eb263d328e5bf6da080bcd7d16c3b1d73e563a48263062c5a, 1f8a5ff26f722b380754d794ad4b8d9edf69361e18ea0a2a03ed58d61e91849c, 1dfc0c4f5442dcff2082d9258254b6861c27001aada055d960844561e699655b, 96dca741745683eb5c2ad857e2520ccf62ab2d08eae359f6928495073925faee, 8e1ab3bfaf8f190abb0b8a229cc7c06c6ba00f2455e60515df4bc8a78a778bc5, 56d4677887fbcb70e9ac1b97db622c6872b610dcf4b6f0ce10a413b7ec325e19, 1a8dcfe9d366e0075595164ed6a3a7cf65081e0595fba70bc2254647bc89c281, 379952ec8113b3692872ffb9d07c242968ee1edfac9b3b888496c1480033be91, 9e0619c604757c70bb9b0df1e43c111e32b24669522ddc75028409cfacf40197, ccae2a12091763da594e0ceb83e3aa438bccf2449b2dc91c916232ba2117ae22, 6649961021d30e565e60c27db58305c6750b580231a0d7331522ad277a769dd3, 1dc9d6fc9015eee05d40c876b622bef542292f2d81382dbf0845ff82ed18d25d, 011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570, e09816f0c305936ce1061c46a35e7d1883a08acf81f94793d9d07455421761dd, 37cf45f320b9bc4ca198bd93ac1f7882756d82f491809ea4f8907c69cfe1c9ae, fce8c609368c54a21e87dee938a5b3ee3fa910658856b8b28e8d86794c09374e, 9d569291755f1937996aecbe32fc5d8df656d0cf4122d4c10130938dfd2229fd, a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014, e2f9e698b01ea5e525396ddb86d5dbfcf85f6f19d6e9b8e4f1d75cbcd0da626d, ff31fa811f9c07cc7fdaa68c9e8bca3a7b4fdf6e0a079a58175ea58ba139c7ae, da8a30160ab0fe450cc42aad45999e22ea848ac9a98814d420c4da884e733e22, af3d6298a8cd7293479f77eab032478e766dae44749489b9568c9fa50ce70890, 32144dbc32aef6b1eab071968c2c2ee6eaf477dcb4a8eb7b8967824f48db17b7, 11d87cac25f6d438db6c6dfec631f97fa5f6ad98e7d99fa50ac1479706efb3b5, c729c4b5a6ad8d247acd4b0d32d5a5999647461ee5f565c618b26d339caebbca, 0537c3dd2378218508ebe3cc416d72a99ee2d24ae1c5525e23458f32544ef861 | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.name | in | Kernel, Undetermined, Unknown | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" |
process.thread.Ext.call_stack_final_user_module.path | wildcard | ?:\windows\assembly\nativeimages_*, ?:\windows\winsxs\*.dll, ?:\program files\*, ?:\program files (x86)\*, c:\windows\apppatch\ummon.dll, c:\windows\apppatch\apppatch64\ummon.dll, c:\windows\system32\ctiuser.dll, c:\windows\syswow64\ctiuser.dll, c:\windows\system32\hpzipm12.dll, c:\windows\system32\lsasrv.dll, c:\windows\syswow64\cwbunpls.dll, c:\windows\system32\shsvcs.dll, c:\windows\system32\sxssrv.dll | excludes:process.thread.Ext.call_stack_final_user_module.path |
process.thread.Ext.call_stack_final_user_module.protection_provenance | eq | mfehcthe.dll, system.core.ni.dll | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"mfehcthe.dll" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"system.core.ni.dll" |
process.thread.Ext.call_stack_final_user_module.protection_provenance_path | starts_with | ?:\program files\, ?:\program files (x86)\, c:\windows\assembly\nativeimages_ | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance_path field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"?:\program files\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"?:\program files (x86)\" field:"process.thread.Ext.call_stack_final_user_module.protection_provenance_path" value:"c:\windows\assembly\nativeimages_" |
Remote MSI Package Installation via MSIEXEC
#Identifies the execution of the built-in Windows Installer, MSIEXEC, to install a remote package. Adversaries may abuse msiexec.exe to launch local or network accessible MSI files.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies the execution of the built-in Windows Installer, MSIEXEC, to install a remote package. Adversaries may abuse
msiexec.exe to launch local or network accessible MSI files.
"""
id = "706bf4ca-45b7-4eb1-acae-b1228124594a"
license = "Elastic License v2"
name = "Remote MSI Package Installation via MSIEXEC"
os_list = ["windows"]
reference = [
"https://lolbas-project.github.io/lolbas/Binaries/Msiexec/",
"https://www.guardicore.com/labs/purple-fox-rootkit-now-propagates-as-a-worm/",
]
version = "1.0.32"
query = '''
sequence with maxspan=1m
[registry where process.name : "msiexec.exe" and
registry.value : "InstallSource" and registry.data.strings : "http*" and
not registry.data.strings : "https://statics.teams.cdn.office.net/*"]
[process where event.action == "start" and user.id : ("S-1-5-21*", "S-1-12-*") and
descendant of [process where process.name : "msiexec.exe"] and
not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true) and
not process.executable : ("?:\\Windows\\System32\\MsiExec.exe", "?:\\Windows\\syswow64\\MsiExec.exe", "?:\\WINDOWS\\Installer\\MSI*.tmp",
"C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe") and
not (process.code_signature.subject_name : ("Ellie Mae, Inc.", "Chatgenie LLC") and process.code_signature.trusted == true)]
'''
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.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: registry
[registry where process.name : "msiexec.exe" and
registry.value : "InstallSource" and registry.data.strings : "http*" and
not registry.data.strings : "https://statics.teams.cdn.office.net/*"]
Stage 2: process
[process where event.action == "start" and user.id : ("S-1-5-21*", "S-1-12-*") and
descendant of [process where process.name : "msiexec.exe"] and
not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true) and
not process.executable : ("?:\\Windows\\System32\\MsiExec.exe", "?:\\Windows\\syswow64\\MsiExec.exe", "?:\\WINDOWS\\Installer\\MSI*.tmp",
"C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe") and
not (process.code_signature.subject_name : ("Ellie Mae, Inc.", "Chatgenie LLC") and process.code_signature.trusted == true)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"msiexec.exe" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard value:"http*" |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard value:"InstallSource" |
user.id | wildcard |
| field:"user.id" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Renamed Windows Automaton Script Interpreter
#Identifies suspicious execution of commonly abused third party Windows automation script interpreters. Attackers may rename AutoHotKey, Rebol or KIXTART executable files or execute scripts from suspicious paths in an attempt to avoid signature-based detection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies suspicious execution of commonly abused third party Windows automation script interpreters. Attackers may
rename AutoHotKey, Rebol or KIXTART executable files or execute scripts from suspicious paths in an attempt to avoid
signature-based detection.
"""
id = "92d720dd-93b2-49e0-b68a-d5d6acbe4910"
license = "Elastic License v2"
name = "Renamed Windows Automaton Script Interpreter"
os_list = ["windows"]
reference = ["https://blog.morphisec.com/explosive-new-mirrorblast-campaign-targets-financial-companies"]
version = "1.0.36"
query = '''
process where event.action == "start" and
(
/* renamed */
(process.pe.original_file_name : "AutoHotkey.exe" and not process.name : ("AutoHotkey*.exe", "InternalAHK.exe")) or
(process.pe.original_file_name : "KIX32.EXE" and not process.name : "KIX*.EXE") or
(process.name : "rebol-view*.exe" and process.parent.name : "msiexec.exe") or
(process.name : ("KIX32.EXE", "rebol-view*.exe", "AutoIt*.exe") and
/* execution from common suspicious paths */
process.args : ("?:\\Users\\Public\\*",
"?:\\ProgramData\\*",
"?:\\Users\\*\\AppData\\*",
"?:\\Windows\\Temp\\*",
"?:\\Windows\\Tasks\\*")) or
/* legit rebol script interpreter has no original file name thus adding this hash abused by mirrorblast*/
process.hash.sha256 : "215e28f9660472b6271a9902573c9d190e4d7ccca33fcf8d6054941d52a3ab85" or
/* unusual script extension */
(process.name : ("rebol-view*.exe", "AutoHotkey*.exe", "KIX*.EXE") and process.args_count == 2 and
not process.command_line : ("*.ahk*", "*.rb*", "*.kix*", "*.scr*", "*.bms")) or
(process.Ext.relative_file_creation_time <= 300 and process.pe.original_file_name : "node.exe" and
process.code_signature.subject_name : "Node.js Foundation" and not process.name : "node*.exe" and
process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*"))
) and
/* FP - chocolatey installs and runs Autohotkey from programdata */
not (process.pe.original_file_name : "AutoHotkey*.exe" and
process.executable : ("?:\\ProgramData\\chocolatey\\*",
"?:\\Program Files\\AutoHotkey\\AutoHotkey*.exe",
"?:\\Program Files (x86)\\AutoHotkey\\AutoHotkey*.exe")) and
not (process.executable : "?:\\ProgramData\\chocolatey\\lib\\autohotkey.install\\tools\\AutoHotkey_*setup.exe" and
process.parent.executable : "?:\\ProgramData\\chocolatey\\choco.exe") and
not (process.pe.original_file_name == "KIX32.EXE" and process.command_line : "*\\NETLOGON\\*") and
not (process.pe.original_file_name == "KIX32.EXE" and process.parent.command_line : "*\\netlogon\\*") and
not (process.pe.original_file_name == "KIX32.EXE" and
process.executable : ("C:\\kworking\\Bin\\RMMKSE.EXE", "C:\\kworking\\Bin\\RMMSSE.EXE", "?:\\ProgramData\\MSPB\\Bin\\RMMSSE.EXE")) and
not (process.pe.original_file_name == "AutoHotkey.exe" and process.executable : "C:\\TCPU73\\Programm\\ClockTC\\ClockTC.exe" and
process.parent.executable : "C:\\TCPU73\\TOTALCMD.EXE") and
not process.executable :
("?:\\Program Files\\AutoHotkey\\SciTE\\InternalAHK.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\AutoHotkey\\UX\\AutoHotkeyUX.exe",
"C:\\Windows\\ccmcache\\*.exe",
"C:\\Windows\\IMECache\\*.exe",
"\\Device\\Mup\\*\\kix32.exe") and
not process.parent.executable :
("?:\\Program Files\\KeePass Password Safe ?\\KeePass.exe",
"?:\\Program Files (x86)\\AutoIt3\\AutoIt3.exe",
"?:\\Program Files\\Far Manager\\Far.exe",
"?:\\Users\\*\\Stepwise\\Stepwise.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\AutoHotkey\\UX\\AutoHotkeyUX.exe",
"C:\\Program Files (x86)\\SofttechLLC\\FlightVector\\FlightVector.exe",
"C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe")
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.003"
name = "Rename Legitimate Utilities"
reference = "https://attack.mitre.org/techniques/T1036/003/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
(
(process.pe.original_file_name : "AutoHotkey.exe" and not process.name : ("AutoHotkey*.exe", "InternalAHK.exe")) or
(process.pe.original_file_name : "KIX32.EXE" and not process.name : "KIX*.EXE") or
(process.name : "rebol-view*.exe" and process.parent.name : "msiexec.exe") or
(process.name : ("KIX32.EXE", "rebol-view*.exe", "AutoIt*.exe") and
process.args : ("?:\\Users\\Public\\*",
"?:\\ProgramData\\*",
"?:\\Users\\*\\AppData\\*",
"?:\\Windows\\Temp\\*",
"?:\\Windows\\Tasks\\*")) or
process.hash.sha256 : "215e28f9660472b6271a9902573c9d190e4d7ccca33fcf8d6054941d52a3ab85" or
(process.name : ("rebol-view*.exe", "AutoHotkey*.exe", "KIX*.EXE") and process.args_count == 2 and
not process.command_line : ("*.ahk*", "*.rb*", "*.kix*", "*.scr*", "*.bms")) or
(process.Ext.relative_file_creation_time <= 300 and process.pe.original_file_name : "node.exe" and
process.code_signature.subject_name : "Node.js Foundation" and not process.name : "node*.exe" and
process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*"))
) and
not (process.pe.original_file_name : "AutoHotkey*.exe" and
process.executable : ("?:\\ProgramData\\chocolatey\\*",
"?:\\Program Files\\AutoHotkey\\AutoHotkey*.exe",
"?:\\Program Files (x86)\\AutoHotkey\\AutoHotkey*.exe")) and
not (process.executable : "?:\\ProgramData\\chocolatey\\lib\\autohotkey.install\\tools\\AutoHotkey_*setup.exe" and
process.parent.executable : "?:\\ProgramData\\chocolatey\\choco.exe") and
not (process.pe.original_file_name == "KIX32.EXE" and process.command_line : "*\\NETLOGON\\*") and
not (process.pe.original_file_name == "KIX32.EXE" and process.parent.command_line : "*\\netlogon\\*") and
not (process.pe.original_file_name == "KIX32.EXE" and
process.executable : ("C:\\kworking\\Bin\\RMMKSE.EXE", "C:\\kworking\\Bin\\RMMSSE.EXE", "?:\\ProgramData\\MSPB\\Bin\\RMMSSE.EXE")) and
not (process.pe.original_file_name == "AutoHotkey.exe" and process.executable : "C:\\TCPU73\\Programm\\ClockTC\\ClockTC.exe" and
process.parent.executable : "C:\\TCPU73\\TOTALCMD.EXE") and
not process.executable :
("?:\\Program Files\\AutoHotkey\\SciTE\\InternalAHK.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\AutoHotkey\\UX\\AutoHotkeyUX.exe",
"C:\\Windows\\ccmcache\\*.exe",
"C:\\Windows\\IMECache\\*.exe",
"\\Device\\Mup\\*\\kix32.exe") and
not process.parent.executable :
("?:\\Program Files\\KeePass Password Safe ?\\KeePass.exe",
"?:\\Program Files (x86)\\AutoIt3\\AutoIt3.exe",
"?:\\Program Files\\Far Manager\\Far.exe",
"?:\\Users\\*\\Stepwise\\Stepwise.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\AutoHotkey\\UX\\AutoHotkeyUX.exe",
"C:\\Program Files (x86)\\SofttechLLC\\FlightVector\\FlightVector.exe",
"C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_*\\winget.exe")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
Script Executed Through Unusual Parent Process
#This rule detects the execution of scripts by interpreters like Perl, Python, PHP, Ruby, and Lua, when the parent process is located in an unusual location, or the parent process is hidden. This behavior is often seen in malware that is trying to evade detection by executing scripts from temporary directories or hidden locations.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects the execution of scripts by interpreters like Perl, Python, PHP, Ruby, and Lua, when the parent
process is located in an unusual location, or the parent process is hidden. This behavior is often seen in malware that
is trying to evade detection by executing scripts from temporary directories or hidden locations.
"""
id = "133102a7-f906-4725-b382-09257a0209c2"
license = "Elastic License v2"
name = "Script Executed Through Unusual Parent Process"
os_list = ["linux"]
version = "1.0.10"
query = '''
process where event.type == "start" and event.action == "exec" and process.args_count == 1 and process.executable like (
"/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
"/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
"/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
"/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
"/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*"
) and
(process.parent.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/boot/*") or process.parent.name like ".*") and
not (
process.parent.executable like~ (
"/tmp/newroot/*", "./merged/*", "/var/tmp/.mount_*/AppRun", "/tmp/.mount_cursor*/usr/bin//cursor",
"/tmp/baum/easybuild/*/perl", "/var/tmp/buildah*", "/tmp/taddm/fileinfo*", "/tmp/wbrashear/easybuild/*",
"/tmp/.mount_cursor*/usr/share/cursor/cursor"
) or
process.parent.name in ("gogo", "nvim", "build-script-build", "jetbrains-toolbox", "runner") or
process.parent.command_line in ("runc init", "/usr/local/bin/runc init") or
(process.parent.args == "/usr/bin/crun" and process.working_directory == "/ansible")
)
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.args_count == 1 and process.executable like (
"/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
"/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
"/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
"/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
"/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*"
) and
(process.parent.executable like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/boot/*") or process.parent.name like ".*") and
not (
process.parent.executable like~ (
"/tmp/newroot/*", "./merged/*", "/var/tmp/.mount_*/AppRun", "/tmp/.mount_cursor*/usr/bin//cursor",
"/tmp/baum/easybuild/*/perl", "/var/tmp/buildah*", "/tmp/taddm/fileinfo*", "/tmp/wbrashear/easybuild/*",
"/tmp/.mount_cursor*/usr/share/cursor/cursor"
) or
process.parent.name in ("gogo", "nvim", "build-script-build", "jetbrains-toolbox", "runner") or
process.parent.command_line in ("runc init", "/usr/local/bin/runc init") or
(process.parent.args == "/usr/bin/crun" and process.working_directory == "/ansible")
)
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_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:".*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | eq | /usr/bin/crun | excludes:process.parent.args field:"process.parent.args" value:"/usr/bin/crun" |
process.working_directory | eq | /ansible | excludes:process.working_directory field:"process.working_directory" value:"/ansible" |
process.parent.command_line | in | /usr/local/bin/runc init, runc init | excludes:process.parent.command_line field:"process.parent.command_line" value:"/usr/local/bin/runc init" field:"process.parent.command_line" value:"runc init" |
process.parent.executable | wildcard | /tmp/newroot/*, ./merged/*, /var/tmp/.mount_*/AppRun, /tmp/.mount_cursor*/usr/bin//cursor, /tmp/baum/easybuild/*/perl, /var/tmp/buildah*, /tmp/taddm/fileinfo*, /tmp/wbrashear/easybuild/*, /tmp/.mount_cursor*/usr/share/cursor/cursor | excludes:process.parent.executable |
process.parent.name | in | build-script-build, gogo, jetbrains-toolbox, nvim, runner | excludes:process.parent.name |
Suspicious ImageLoad via Windows Update Auto Update Client
#Identifies abuse of the Windows Update Auto Update Client (wuauclt.exe) to load an arbitrary DLL. This behavior is used as a defense evasion technique to blend-in malicious activity with legitimate Windows software.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies abuse of the Windows Update Auto Update Client (wuauclt.exe) to load an arbitrary DLL. This behavior is used
as a defense evasion technique to blend-in malicious activity with legitimate Windows software.
"""
id = "3788c03d-28a5-4466-b157-d6dd4dc449bb"
license = "Elastic License v2"
name = "Suspicious ImageLoad via Windows Update Auto Update Client"
os_list = ["windows"]
reference = [
"https://dtm.uk/wuauclt/",
"https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.31"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
(process.pe.original_file_name == "wuauclt.exe" or process.name : "wuauclt.exe") and
process.parent.executable != null and
process.args : "/RunHandlerComServer" and process.args : "/UpdateDeploymentProvider" and
not process.parent.executable :
("?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\System32\\MoUsoCoreWorker.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\MoUsoCoreWorker.exe")]
[library where
not (dll.code_signature.subject_name : ("Microsoft Windows", "Microsoft Corporation") and dll.code_signature.trusted == true) and
not (dll.code_signature.trusted == true and
dll.path : ("?:\\Program Files\\*.dll",
"?:\\Program Files (x86)\\*.dll",
"?:\\Windows\\System32\\*.dll",
"?:\\Windows\\SysWOW64\\*.dll",
"?:\\ProgramData\\Symantec\\Symantec Endpoint Protection\\*.dll")) and
not dll.hash.sha256 : "dde77d27a7cb0189a9a3314e42f10666a2f69ca2b81ad03ae0cc9035a97a55ad"]
'''
min_endpoint_version = "7.16.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
(process.pe.original_file_name == "wuauclt.exe" or process.name : "wuauclt.exe") and
process.parent.executable != null and
process.args : "/RunHandlerComServer" and process.args : "/UpdateDeploymentProvider" and
not process.parent.executable :
("?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\System32\\MoUsoCoreWorker.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\MoUsoCoreWorker.exe")]
Stage 2: library
[library where
not (dll.code_signature.subject_name : ("Microsoft Windows", "Microsoft Corporation") and dll.code_signature.trusted == true) and
not (dll.code_signature.trusted == true and
dll.path : ("?:\\Program Files\\*.dll",
"?:\\Program Files (x86)\\*.dll",
"?:\\Windows\\System32\\*.dll",
"?:\\Windows\\SysWOW64\\*.dll",
"?:\\ProgramData\\Symantec\\Symantec Endpoint Protection\\*.dll")) and
not dll.hash.sha256 : "dde77d27a7cb0189a9a3314e42f10666a2f69ca2b81ad03ae0cc9035a97a55ad"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"wuauclt.exe" |
process.parent.executable | is_not_null | field:"ParentImage" kind:is_not_null | |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"wuauclt.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | wildcard | ?:\Windows\System32\svchost.exe, ?:\Windows\System32\MoUsoCoreWorker.exe, \Device\HarddiskVolume*\Windows\System32\svchost.exe, \Device\HarddiskVolume*\Windows\System32\MoUsoCoreWorker.exe | excludes:process.parent.executable |
dll.code_signature.subject_name | eq | Microsoft Windows, Microsoft Corporation | excludes:dll.code_signature.subject_name field:"dll.code_signature.subject_name" value:"Microsoft Windows" field:"dll.code_signature.subject_name" value:"Microsoft Corporation" |
dll.code_signature.trusted | eq | true | excludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true" |
dll.path | wildcard | ?:\Program Files\*.dll, ?:\Program Files (x86)\*.dll, ?:\Windows\System32\*.dll, ?:\Windows\SysWOW64\*.dll, ?:\ProgramData\Symantec\Symantec Endpoint Protection\*.dll | excludes:dll.path |
dll.hash.sha256 | eq | dde77d27a7cb0189a9a3314e42f10666a2f69ca2b81ad03ae0cc9035a97a55ad | excludes:dll.hash.sha256 field:"dll.hash.sha256" value:"dde77d27a7cb0189a9a3314e42f10666a2f69ca2b81ad03ae0cc9035a97a55ad" |
Suspicious XPC Service Child Process
#Detects an abnormal child process of a XPC service running from a suspicious location.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = "Detects an abnormal child process of a XPC service running from a suspicious location."
id = "fdb36c69-9a1d-4ab3-863d-91b3301b6c6d"
license = "Elastic License v2"
name = "Suspicious XPC Service Child Process"
os_list = ["macos"]
reference = [
"https://attack.mitre.org/techniques/T1559/003/",
"https://attack.mitre.org/techniques/T1059/004/",
"https://objective-see.org/blog/blog_0x59.html",
]
version = "1.0.27"
query = '''
process where event.type == "start" and process.parent.name : "com.*" and
((process.name in ("bash", "sh", "zsh") and process.args == "-c") or
process.name like~ ("curl", "nscurl", "osascript", "python*", "tclsh*")) and not
process.executable like "/Applications/*" and not
process.parent.executable like~
("/Applications/*",
"/Library/PrivilegedHelperTools/*",
"/System/*",
"/private/var/db/com.apple.xpc.*",
"/private/var/folders/*/*/*/AppTranslocation/*",
"/Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker",
"/Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent",
"/Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper",
"/usr/libexec/*",
"/Library/SystemExtensions/*") and not
process.parent.name like~ ("com.docker.*", "com.todyl.SGNWatchDog") and not
process.command_line like~ ("sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old",
"/bin/sh -c git-upload-pack*", "*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*") and
not process.Ext.effective_parent.executable == "/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" and
not (process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true) and
not (
process.parent.executable == "/Library/AppQuest/com.apple.questd" and
process.Ext.effective_parent.executable == "/usr/bin/sudo"
)
'''
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.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[threat.technique.subtechnique]]
id = "T1559.003"
name = "XPC Services"
reference = "https://attack.mitre.org/techniques/T1559/003/"
[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 process.parent.name : "com.*" and
((process.name in ("bash", "sh", "zsh") and process.args == "-c") or
process.name like~ ("curl", "nscurl", "osascript", "python*", "tclsh*")) and not
process.executable like "/Applications/*" and not
process.parent.executable like~
("/Applications/*",
"/Library/PrivilegedHelperTools/*",
"/System/*",
"/private/var/db/com.apple.xpc.*",
"/private/var/folders/*/*/*/AppTranslocation/*",
"/Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker",
"/Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent",
"/Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper",
"/usr/libexec/*",
"/Library/SystemExtensions/*") and not
process.parent.name like~ ("com.docker.*", "com.todyl.SGNWatchDog") and not
process.command_line like~ ("sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old",
"/bin/sh -c git-upload-pack*", "*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*") and
not process.Ext.effective_parent.executable == "/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" and
not (process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true) and
not (
process.parent.executable == "/Library/AppQuest/com.apple.questd" and
process.Ext.effective_parent.executable == "/usr/bin/sudo"
)
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 | eq |
| field:"process.args" kind:eq value:"-c" |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"com.*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | eq | /usr/bin/sudo | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/usr/bin/sudo" |
process.parent.executable | eq | /Library/AppQuest/com.apple.questd | excludes:process.parent.executable field:"process.parent.executable" value:"/Library/AppQuest/com.apple.questd" |
process.parent.code_signature.exists | eq | true | excludes:process.parent.code_signature.exists field:"process.parent.code_signature.exists" value:"true" |
process.parent.code_signature.trusted | eq | true | excludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true" |
process.Ext.effective_parent.executable | eq | /Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" |
process.command_line | wildcard | sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old, /bin/sh -c git-upload-pack*, *sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh* | excludes:process.command_line field:"process.command_line" value:"sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old" field:"process.command_line" value:"/bin/sh -c git-upload-pack*" field:"process.command_line" value:"*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*" |
process.executable | starts_with | /Applications/ | excludes:process.executable field:"process.executable" value:"/Applications/" |
process.parent.executable | wildcard | /Applications/*, /Library/PrivilegedHelperTools/*, /System/*, /private/var/db/com.apple.xpc.*, /private/var/folders/*/*/*/AppTranslocation/*, /Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker, /Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper, /Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper, /Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent, /Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper, /usr/libexec/*, /Library/SystemExtensions/* | excludes:process.parent.executable |
process.parent.name | wildcard | com.docker.*, com.todyl.SGNWatchDog | excludes:process.parent.name field:"process.parent.name" value:"com.docker.*" field:"process.parent.name" value:"com.todyl.SGNWatchDog" |
Unusual Country for an Azure Activity Logs Event
#A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from a geolocation (country) that is unusual for the event action. This can be the result of compromised credentials or keys being used by a threat actor in a different geography than the authorized user(s).
Known False Positives
- New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration; changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased adoption of work from home policies; or users who travel frequently.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Stealth |
Rule Body
[metadata]
creation_date = "2025/10/06"
integration = ["azure"]
maturity = "production"
min_stack_comments = "New job added"
min_stack_version = "9.4.0"
updated_date = "2026/04/01"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from
a geolocation (country) that is unusual for the event action. This can be the result of compromised credentials or keys being
used by a threat actor in a different geography than the authorized user(s).
"""
false_positives = [
"""
New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration;
changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased
adoption of work from home policies; or users who travel frequently.
""",
]
from = "now-2h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "azure_activitylogs_rare_event_action_for_a_country_ea"
name = "Unusual Country for an Azure Activity Logs Event"
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 Country for an Azure Activity Logs Event
This alert flags management operations originating from a country not normally associated with that activity in your environment, signaling credential or key misuse from remote infrastructure. A common pattern is an attacker authenticating from a new region, then automating creation of a service principal, granting it elevated role assignments, and modifying access policies or spinning up compute to persist, escalate privileges, and stage data exfiltration.
### Possible investigation steps
- Enrich the source IP with ASN, hosting provider, and threat intel, distinguishing corporate VPN exit nodes from cloud-hosting or anonymizer infrastructure.
- Correlate the actor (user, service principal, or managed identity) with Microsoft Entra ID sign-in logs to confirm authentication method, MFA and Conditional Access outcomes, application context, and device compliance.
- Build a 24–48 hour timeline of the actor’s management operations to spot follow-on actions indicative of persistence or escalation such as app/service principal creation, role assignment changes, Key Vault policy edits, SAS or key issuance, and VM/automation deployment.
- Validate business legitimacy by checking travel records, change tickets, and approved maintenance windows, and if interactive access, contact the user to verify intent and location.
- If compromise is suspected, revoke sessions and refresh tokens, rotate secrets and credentials, remove newly added privileges, and enable stricter geo or Conditional Access controls while monitoring for reattempts from the same country.
### False positive analysis
- A legitimate user traveling or working remotely connects via mobile, hotel, or corporate VPN egress whose public IP geolocates to a country outside the baseline, triggering the unusual country alert.
- Routine automation or a service principal executes from Azure compute in a different region due to scaling or failover, making management operations appear to originate from IP ranges mapped to another country.
### Response and remediation
- Immediately disable the involved user or service principal, revoke active sessions and refresh tokens, and block the public IP/CIDR at Azure Firewall or NSGs while applying Conditional Access to deny management actions from that country.
- Remove any newly added role assignments or RBAC changes linked to the actor, delete unauthorized service principals or managed identities, invalidate issued SAS tokens or storage account keys, and rotate affected secrets, app passwords, and credentials.
- Restore access only after user/business validation, reapply baseline Key Vault access policies and RBAC from infrastructure-as-code, and roll forward patched images or automation to replace any VMs or runbooks created during the incident.
- Escalate to Security Incident Response if a service principal was created and granted Owner/Contributor or Key Vault Admin, if access policies were modified, if compute/automation was deployed from the unusual country, or if interactive management access succeeded without MFA.
- Harden by enforcing country-aware Conditional Access for management apps, requiring phishing-resistant MFA for privileged actions, enabling PIM with approval and just-in-time for role changes, restricting SAS with IP/time scopes, and disabling legacy authentication.
"""
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs.
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Azure Activity Logs Integration Setup
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent.
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it.
- Click “Add Azure Activity Logs”.
- Configure the integration.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "76de17b9-af25-49a0-9378-02888b6bb3a2"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: Azure",
"Data Source: Azure Activity Logs",
"Rule Type: ML",
"Rule Type: Machine Learning",
"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.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Unusual Process Modifying GenAI Configuration File
#Detects unusual modification of GenAI tool configuration files. Adversaries may inject malicious MCP server configurations to hijack AI agents for persistence, C2, or data exfiltration. Attack vectors include malware or scripts directly poisoning config files, supply chain attacks via compromised dependencies, and prompt injection attacks that abuse the GenAI tool itself to modify its own configuration. Unauthorized MCP servers added to these configs execute arbitrary commands when the AI tool is next invoked.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Stealth |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| macOS | ESF event write (NOTIFY): Fires after a process writes data to a file. |
Rule Body
[metadata]
creation_date = "2025/12/04"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/07/06"
[rule]
author = ["Elastic"]
description = """
Detects unusual modification of GenAI tool configuration files. Adversaries may inject malicious MCP server
configurations to hijack AI agents for persistence, C2, or data exfiltration. Attack vectors include malware or scripts
directly poisoning config files, supply chain attacks via compromised dependencies, and prompt injection attacks that
abuse the GenAI tool itself to modify its own configuration. Unauthorized MCP servers added to these configs execute
arbitrary commands when the AI tool is next invoked.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "kuery"
license = "Elastic License v2"
name = "Unusual Process Modifying GenAI Configuration File"
note = """## Triage and analysis
### Investigating Unusual Process Modifying GenAI Configuration File
Configuration files for GenAI tools like Cursor, Claude, Copilot, and Ollama control which MCP servers, plugins, and extensions are loaded. Attackers target these files to inject malicious MCP servers that execute arbitrary commands, exfiltrate data, or establish persistence. Threats include external processes (malware, compromised scripts, supply chain attacks) directly modifying configs, as well as prompt injection attacks that abuse the AI tool's own file access capabilities.
### Possible investigation steps
- Identify the process that modified the configuration file and determine if it's expected (GenAI tool, installer, user action) or suspicious (unknown script, malware).
- If the modifying process is NOT a GenAI tool, investigate its origin, parent process tree, and whether it was downloaded or executed from a suspicious location.
- If a GenAI tool made the modification, check recent user prompts or agent activity that may have triggered the config change via prompt injection.
- Review the contents of the modified configuration file for suspicious MCP server URLs, unauthorized plugins, or unusual agent permissions.
- Examine the process command line and parent process tree to identify how the modifying process was invoked.
- Check for other file modifications by the same process around the same time, particularly to other GenAI configs or startup scripts.
- Investigate whether the GenAI tool subsequently connected to unknown domains or spawned unusual child processes after the config change.
### False positive analysis
- Novel but legitimate configuration changes will trigger this rule when the process hasn't been seen modifying these files within the configured history window. Review the modified file content to determine legitimacy.
- GenAI tool updates may modify config files in new ways; correlate with recent software updates.
- IDE extensions integrating with GenAI tools may modify configs as part of initial setup.
- Developer tools (git, go, npm) checking out or downloading projects containing `.gemini/` or `.claude/` directories may trigger alerts. These are project-level configs, not user configs - verify by checking if the path is within a project directory.
### Response and remediation
- Review the modified configuration file and revert any unauthorized changes to MCP servers, plugins, or agent settings.
- If malicious MCP servers were added, block the associated domains at the network level.
- Review and rotate any API keys or credentials that may have been exposed through the compromised GenAI configuration.
"""
references = [
"https://modelcontextprotocol.io/",
"https://www.cybereason.com/blog/security-research/weaponized-ai-how-cybercriminals-exploit-mcp-for-account-takeover",
"https://glama.ai/blog/2025-11-11-the-lethal-trifecta-securing-model-context-protocol-against-data-flow-attacks",
"https://www.elastic.co/security-labs/elastic-advances-llm-security",
]
risk_score = 47
rule_id = "590fc62d-7386-4c75-92b0-af4517018da1"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
"Domain: LLM",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category : "file" and event.action : ("modification" or "overwrite") and
file.path : (
*/.cursor/mcp.json or */.cursor/settings.json or */AppData/Roaming/Cursor/*mcp* or
*/.claude/* or */claude_desktop_config.json or */AppData/Roaming/Claude/* or
*/.config/github-copilot/* or */AppData/Local/GitHub?Copilot/* or
*/.ollama/config* or */AppData/Local/Ollama/* or
*/.codex/* or */AppData/Roaming/Codex/* or
*/.gemini/* or */AppData/Roaming/gemini-cli/* or
*/.grok/* or */AppData/Roaming/Grok/* or
*/.windsurf/* or */AppData/Roaming/Windsurf/* or
*/.vscode/extensions/*mcp* or
*/.openclaw/* or */AppData/Roaming/OpenClaw/* or
*/.moltbot/* or */AppData/Roaming/Moltbot/* or
*/.config/openclaw/*
) and not (
file.extension : (lck or lock or log or png or marker or shm or wal or sqlite or sqlite-shm or sqlite-wal or jsonl or journal or xcuserstate) or
file.name : (
.DS_Store or .last-cleanup or mcp-needs-auth-cache.json or policy-limits.json or
.claude.json.backup* or
*.tmp*
) or
file.path : (
*/.claude/cache/* or
*/.claude/statsig/* or
*/.claude/sessions/* or
*/.claude/shell-snapshots/* or
*/.claude/plugins/* or
*/.claude/worktrees/* or
*/.gemini/antigravity-browser-profile/* or
*/.gemini/tmp/* or
*/.codex/.tmp/* or
*/.codex/tmp/* or
*/.codex/log/* or
*/.codex/sessions/* or
*/.cursor/extensions/* or
*/.vscode/extensions/* or
*/.vscode-oss/extensions/* or
*/opt/homebrew/.claude/* or
*/opt/homebrew/.cursor/* or
*/opt/homebrew/.codex/* or
*/node_modules/* or
*/cargo/registry/* or
*/go/pkg/mod/*
) or
(
file.path : (*/.codex/* or */.claude/* or */.gemini/*) and
file.extension : sqlite
) or
(
file.path : */.config/github-copilot/* and
file.name : (apps.json or versions.json or copilot*nitrite.db)
) or
process.name : build-script-build or
(
file.path : (*/.codex/.tmp/* or */.claude/plugins/* or */.claude/worktrees/* or */node_modules/* or */cargo/registry/* or */go/pkg/mod/*) and
file.extension : (h or out or part or rs or toml)
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[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]]
id = "T1554"
name = "Compromise Host Software Binary"
reference = "https://attack.mitre.org/techniques/T1554/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.executable"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
Stages and Predicates
Stage 1: new_terms
event.category : "file" and event.action : ("modification" or "overwrite") and
file.path : (
*/.cursor/mcp.json or */.cursor/settings.json or */AppData/Roaming/Cursor/*mcp* or
*/.claudeclaude_desktop_config.json or */AppData/Roaming/Claude/* or
*/.config/github-copilotAppData/Local/GitHub?Copilot/* or
*/.ollama/config* or */AppData/Local/Ollama/* or
*/.codexAppData/Roaming/Codex/* or
*/.geminiAppData/Roaming/gemini-cli/* or
*/.grokAppData/Roaming/Grok/* or
*/.windsurfAppData/Roaming/Windsurf/* or
*/.vscode/extensions/*mcp* or
*/.openclawAppData/Roaming/OpenClaw/* or
*/.moltbotAppData/Roaming/Moltbot/* or
*/.config/openclaw/*
) and not (
file.extension : (lck or lock or log or png or marker or shm or wal or sqlite or sqlite-shm or sqlite-wal or jsonl or journal or xcuserstate) or
file.name : (
.DS_Store or .last-cleanup or mcp-needs-auth-cache.json or policy-limits.json or
.claude.json.backup* or
*.tmp*
) or
file.path : (
*/.claude/cache/* or
*/.claude/statsig/* or
*/.claude/sessions/* or
*/.claude/shell-snapshots/* or
*/.claude/plugins/* or
*/.claude/worktrees/* or
*/.gemini/antigravity-browser-profile/* or
*/.gemini/tmp/* or
*/.codex/.tmp/* or
*/.codex/tmp/* or
*/.codex/log/* or
*/.codex/sessions/* or
*/.cursor/extensions/* or
*/.vscode/extensions/* or
*/.vscode-oss/extensions/* or
*/opt/homebrew/.claude/* or
*/opt/homebrew/.cursor/* or
*/opt/homebrew/.codex/* or
*/node_modules/* or
*/cargo/registry/* or
*/go/pkg/mod/*
) or
(
file.path : (*/.codex.claude.gemini/*) and
file.extension : sqlite
) or
(
file.path : */.config/github-copilot/* and
file.name : (apps.json or versions.json or copilot*nitrite.db)
) or
process.name : build-script-build or
(
file.path : (*/.codex/.tmp.claude/plugins.claude/worktreesnode_modulescargo/registrygo/pkg/mod/*) and
file.extension : (h or out or part or rs or toml)
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.category | eq |
| field:"event.category" kind:eq value:"file" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
Unusual Web User Agent
#A machine learning job detected a rare and unusual user agent indicating web browsing activity by an unusual process other than a web browser. This can be due to persistence, command-and-control, or exfiltration activity. Uncommon user agents coming from remote sources to local destinations are often the result of scanners, bots, and web scrapers, which are part of common Internet background traffic. Much of this is noise, but more targeted attacks on websites using tools like Burp or SQLmap can sometimes be discovered by spotting uncommon user agents. Uncommon user agents in traffic from local sources to remote destinations can be any number of things, including harmless programs like weather monitoring or stock-trading programs. However, uncommon user agents from local sources can also be due to malware or scanning activity.
Known False Positives
- Web activity that is uncommon, like security scans, may trigger this alert and may need to be excluded. A new or rarely used program that calls web services may trigger this alert.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[metadata]
creation_date = "2020/03/25"
integration = ["endpoint", "network_traffic"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected a rare and unusual user agent indicating web browsing activity by an unusual process
other than a web browser. This can be due to persistence, command-and-control, or exfiltration activity. Uncommon user
agents coming from remote sources to local destinations are often the result of scanners, bots, and web scrapers, which
are part of common Internet background traffic. Much of this is noise, but more targeted attacks on websites using tools
like Burp or SQLmap can sometimes be discovered by spotting uncommon user agents. Uncommon user agents in traffic from
local sources to remote destinations can be any number of things, including harmless programs like weather monitoring or
stock-trading programs. However, uncommon user agents from local sources can also be due to malware or scanning
activity.
"""
false_positives = [
"""
Web activity that is uncommon, like security scans, may trigger this alert and may need to be excluded. A new or
rarely used program that calls web services may trigger this alert.
""",
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "packetbeat_rare_user_agent_ea"
name = "Unusual Web User Agent"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Network Packet Capture
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### 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 to your 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/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).
### Network Packet Capture Integration Setup
The Network Packet Capture integration sniffs network packets on a host and dissects known protocols. Monitoring the network traffic is critical to gaining observability and securing your environment — ensuring high levels of performance and security. The Network Packet Capture integration captures the network traffic between your application servers, decodes common application layer protocols and records the interesting fields for each transaction.
#### The following steps should be executed in order to add the Elastic Agent System integration "network_traffic" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Network Packet Capture” and select the integration to see more details about it.
- Click “Add Network Packet Capture”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “network_traffic” to an existing or a new agent policy, and deploy the agent on your system from which network log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/network_traffic).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "91f02f01-969f-4167-8d77-07827ac4cee0"
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Data Source: Network Packet Capture",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Command and Control",
"Resources: Investigation Guide",
]
type = "machine_learning"
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 Web User Agent
User agents identify applications interacting with web servers, typically browsers. Adversaries exploit this by using non-standard user agents for malicious activities like data exfiltration or command-and-control. The 'Unusual Web User Agent' detection rule leverages machine learning to identify rare user agents, flagging potential threats from atypical processes, thus aiding in early threat detection.
### Possible investigation steps
- Review the specific user agent string that triggered the alert to determine if it matches known malicious patterns or tools like Burp or SQLmap.
- Identify the source and destination IP addresses involved in the alert to assess whether they are associated with known malicious activity or unusual geographic locations.
- Check the process that generated the unusual user agent to determine if it is a legitimate application or potentially malicious software.
- Analyze network traffic logs for additional context around the time of the alert to identify any related suspicious activities or patterns.
- Investigate any recent changes or installations on the system that could explain the presence of the unusual user agent, such as new software or updates.
- Correlate the alert with other security events or logs to see if there are any related indicators of compromise or ongoing threats.
### False positive analysis
- Non-malicious applications like weather monitoring or stock-trading programs may use uncommon user agents. Regularly review and whitelist these applications to prevent them from triggering false positives.
- Automated tools such as web scrapers or bots can generate unusual user agents. Identify and document these tools if they are part of legitimate business operations, and create exceptions for them in the detection rule.
- Internal scanners or monitoring tools might use non-standard user agents. Ensure these tools are recognized and excluded from alerts by updating the rule's exception list.
- Regularly update the list of known benign user agents to reflect changes in legitimate software and tools used within the organization, reducing unnecessary alerts.
- Collaborate with IT and security teams to maintain an up-to-date inventory of authorized applications and their user agents, ensuring that only truly suspicious activities are flagged.
### Response and remediation
- Isolate the affected system from the network to prevent further data exfiltration or command-and-control communication.
- Conduct a thorough scan of the isolated system using updated antivirus and anti-malware tools to identify and remove any malicious software.
- Review and analyze the logs of the affected system and network traffic to identify the source and scope of the unusual user agent activity.
- Block the identified malicious IP addresses or domains associated with the unusual user agent in the firewall and intrusion prevention systems.
- Update and patch all software and systems to close any vulnerabilities that may have been exploited by the adversary.
- Restore the affected system from a clean backup if malware removal is not feasible or if the system integrity is compromised.
- Report the incident to the appropriate internal teams and, if necessary, escalate to external cybersecurity authorities or partners for further investigation and support."""
[[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.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
Virtual Machine Fingerprinting
#An adversary may attempt to get detailed information about the operating system and hardware. This rule identifies common locations used to discover virtual machine hardware by a non-root user. This technique has been used by the Pupy RAT and other malware.
Known False Positives
- Certain tools or automated software may enumerate hardware information. These tools can be exempted via user name or process arguments to eliminate potential noise.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2020/04/27"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
An adversary may attempt to get detailed information about the operating system and hardware. This rule identifies
common locations used to discover virtual machine hardware by a non-root user. This technique has been used by the Pupy
RAT and other malware.
"""
false_positives = [
"""
Certain tools or automated software may enumerate hardware information. These tools can be exempted via user name or
process arguments to eliminate potential noise.
""",
]
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-endpoint.events.*",
"logs-crowdstrike.fdr*",
"logs-sentinel_one_cloud_funnel.*",
"logs-auditd_manager.auditd-*",
]
language = "eql"
license = "Elastic License v2"
name = "Virtual Machine Fingerprinting"
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 Virtual Machine Fingerprinting
Virtual Machine Fingerprinting involves identifying characteristics of a virtual environment, often to tailor attacks or evade detection. Adversaries exploit this by querying system files for hardware details, a tactic seen in malware like Pupy RAT. The detection rule flags non-root users accessing specific Linux paths indicative of VM queries, signaling potential reconnaissance activities.
### Possible investigation steps
- Review the process execution details to identify the non-root user involved in accessing the specified paths, focusing on the user.name field.
- Examine the process.args field to determine which specific file paths were accessed, as this can indicate the type of virtual machine information being targeted.
- Investigate the parent process and command line arguments to understand the context of the process initiation and whether it aligns with legitimate user activity.
- Check for any related alerts or logs around the same timeframe to identify potential patterns or repeated attempts at virtual machine fingerprinting.
- Assess the system for any signs of compromise or unauthorized access, particularly focusing on the presence of known malware like Pupy RAT or similar threats.
- Correlate the findings with MITRE ATT&CK framework references (TA0007, T1082) to understand the broader tactics and techniques potentially in use by the adversary.
### False positive analysis
- Non-root users running legitimate scripts or applications that query system files for hardware information may trigger the rule. Review the context of the process and user activity to determine if it aligns with expected behavior.
- System administrators or developers using automated tools for inventory or monitoring purposes might access these paths. Consider creating exceptions for known tools or scripts that are verified as safe.
- Security or compliance audits conducted by non-root users could inadvertently match the rule's criteria. Document and whitelist these activities if they are part of regular operations.
- Development environments where virtual machine detection is part of testing processes may cause false positives. Identify and exclude these environments from the rule's scope if they are consistently flagged.
- Regularly review and update the list of exceptions to ensure that only verified and necessary exclusions are maintained, minimizing the risk of overlooking genuine threats.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further reconnaissance or potential lateral movement by the adversary.
- Terminate any suspicious processes identified in the alert that are attempting to access the specified system files, especially those not initiated by the root user.
- Conduct a thorough review of recent user activity and process logs to identify any unauthorized access or anomalies that may indicate further compromise.
- Reset credentials for any non-root users involved in the alert to prevent unauthorized access, and review user permissions to ensure least privilege principles are enforced.
- Deploy endpoint detection and response (EDR) tools to monitor for similar suspicious activities and enhance visibility into system processes and user actions.
- 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 the specific file paths and processes identified in the query to detect and respond to future attempts at virtual machine fingerprinting."""
risk_score = 73
rule_id = "5b03c9fb-9945-4d2f-9568-fd690fee3fba"
setup = """## Setup
This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "process_started") and
process.args in (
"/sys/class/dmi/id/bios_version", "/sys/class/dmi/id/product_name", "/sys/class/dmi/id/chassis_vendor",
"/proc/scsi/scsi", "/proc/ide/hd0/model"
) and not (
user.name == "root" or
?process.parent.name in ("LinkManager.exe", "saposcol", "svc_snow_discovery") or
?process.working_directory == "/home/qualys" or
?process.parent.executable in (
"/usr/sara/sbin/sys2prometheus", "/usr/sara/sbin/sys2ganglia", "/usr/libexec/valgrind/memcheck-amd64-linux",
"/var/lib/cfengine3/modules/init_node", "/opt/emby-server/system/EmbyServer"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1082"
name = "System Information Discovery"
reference = "https://attack.mitre.org/techniques/T1082/"
[[rule.threat.technique]]
id = "T1497"
name = "Virtualization/Sandbox Evasion"
reference = "https://attack.mitre.org/techniques/T1497/"
[[rule.threat.technique.subtechnique]]
id = "T1497.001"
name = "System Checks"
reference = "https://attack.mitre.org/techniques/T1497/001/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1497"
name = "Virtualization/Sandbox Evasion"
reference = "https://attack.mitre.org/techniques/T1497/"
[[rule.threat.technique.subtechnique]]
id = "T1497.001"
name = "System Checks"
reference = "https://attack.mitre.org/techniques/T1497/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "process_started") and
process.args in (
"/sys/class/dmi/id/bios_version", "/sys/class/dmi/id/product_name", "/sys/class/dmi/id/chassis_vendor",
"/proc/scsi/scsi", "/proc/ide/hd0/model"
) and not (
user.name == "root" or
?process.parent.name in ("LinkManager.exe", "saposcol", "svc_snow_discovery") or
?process.working_directory == "/home/qualys" or
?process.parent.executable in (
"/usr/sara/sbin/sys2prometheus", "/usr/sara/sbin/sys2ganglia", "/usr/libexec/valgrind/memcheck-amd64-linux",
"/var/lib/cfengine3/modules/init_node", "/opt/emby-server/system/EmbyServer"
)
)
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 | in |
| field:"process.args" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | in | /opt/emby-server/system/EmbyServer, /usr/libexec/valgrind/memcheck-amd64-linux, /usr/sara/sbin/sys2ganglia, /usr/sara/sbin/sys2prometheus, /var/lib/cfengine3/modules/init_node | excludes:process.parent.executable |
process.parent.name | in | LinkManager.exe, saposcol, svc_snow_discovery | excludes:process.parent.name field:"process.parent.name" value:"LinkManager.exe" field:"process.parent.name" value:"saposcol" field:"process.parent.name" value:"svc_snow_discovery" |
process.working_directory | eq | /home/qualys | excludes:process.working_directory field:"process.working_directory" value:"/home/qualys" |
user.name | eq | root | excludes:user.name field:"user.name" value:"root" |