Detection rules › Elastic
Elastic rules: 01
Asynchronous Procedure Call from Unusual Module
#Identifies attempts to queue an Asynchronous Procedure Call (APC) to a remote process. This may indicate a remote code injection attack.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to queue an Asynchronous Procedure Call (APC) to a remote process. This may indicate a remote code
injection attack.
"""
id = "300195cb-5d38-4375-ab59-0110c8a486d9"
license = "Elastic License v2"
name = "Asynchronous Procedure Call from Unusual Module"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
"https://www.ired.team/offensive-security/code-injection-process-injection/apc-queue-code-injection",
]
version = "1.0.4"
query = '''
api where process.pid != 4 and process.Ext.api.name in ("NtQueueApcThread", "QueueUserAPC") and
process.Ext.api.behaviors == "cross-process" and
process.thread.Ext.call_stack_final_user_module.name != null and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Kernel", "Unknown") and
(
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) or
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation")) or
(process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
(process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\microsoft.net\\framework*\\clr.dll" or process.thread.Ext.call_stack_final_user_module.protection_provenance == "clr.dll"))
) and
process.Ext.api.summary != "NtQueueApcThread( csrss.exe, basesrv.dll!BaseSrvNlsUpdateRegistryCache, NULL, Data, Data )" and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"Mozilla Corporation", "Beijing Qihu Technology Co., Ltd.",
"Symantec Corporation", "Deep Instinct Ltd",
"TPZ SOLUCOES DIGITAIS LTDA",
"Carbon Black, Inc.",
"MUSARUBRA US LLC")) and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!NtCreateUserProcess+*",
"c:\\windows\\sys?????\\ntdll.dll!ZwCreateUserProcess*")) and
not (process.thread.Ext.call_stack_final_user_module.hash.sha256 == "d7d35019ce0c03d97c32ab25a145371806ca2d1572af1e5146ea886d41818850" and
Target.process.executable : "?:\\Windows\\SysWOW64\\rserver30\\FamItrfc.Exe")
'''
min_endpoint_version = "8.14.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique.subtechnique]]
id = "T1055.004"
name = "Asynchronous Procedure Call"
reference = "https://attack.mitre.org/techniques/T1055/004/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.2"
Stages and Predicates
Stage 1: api
api where process.pid != 4 and process.Ext.api.name in ("NtQueueApcThread", "QueueUserAPC") and
process.Ext.api.behaviors == "cross-process" and
process.thread.Ext.call_stack_final_user_module.name != null and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Kernel", "Unknown") and
(
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) or
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation")) or
(process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
(process.thread.Ext.call_stack_final_user_module.protection_provenance_path like "c:\\windows\\microsoft.net\\framework*\\clr.dll" or process.thread.Ext.call_stack_final_user_module.protection_provenance == "clr.dll"))
) and
process.Ext.api.summary != "NtQueueApcThread( csrss.exe, basesrv.dll!BaseSrvNlsUpdateRegistryCache, NULL, Data, Data )" and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"Mozilla Corporation", "Beijing Qihu Technology Co., Ltd.",
"Symantec Corporation", "Deep Instinct Ltd",
"TPZ SOLUCOES DIGITAIS LTDA",
"Carbon Black, Inc.",
"MUSARUBRA US LLC")) and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info like ("c:\\windows\\sys?????\\ntdll.dll!NtCreateUserProcess+*",
"c:\\windows\\sys?????\\ntdll.dll!ZwCreateUserProcess*")) and
not (process.thread.Ext.call_stack_final_user_module.hash.sha256 == "d7d35019ce0c03d97c32ab25a145371806ca2d1572af1e5146ea886d41818850" and
Target.process.executable : "?:\\Windows\\SysWOW64\\rserver30\\FamItrfc.Exe")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
Attempt to Disable Auditd Service
#Adversaries may attempt to disable the Auditd service to evade detection. Auditd is a Linux service that provides system auditing and logging. Disabling the Auditd service can prevent the system from logging important security events, which can be used to detect malicious activity.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule Body
[rule]
description = """
Adversaries may attempt to disable the Auditd service to evade detection. Auditd is a Linux service that provides system
auditing and logging. Disabling the Auditd service can prevent the system from logging important security events, which
can be used to detect malicious activity.
"""
id = "bf76a9f8-42dd-44cc-9e2f-d8693df31d59"
license = "Elastic License v2"
name = "Attempt to Disable Auditd Service"
os_list = ["linux"]
version = "1.0.1"
query = '''
process where event.type == "start" and event.action == "exec" and (
(process.name == "service" and process.args == "stop") or
(process.name == "chkconfig" and process.args == "off") or
(process.name == "update-rc.d" and process.args in ("remove", "disable")) or
(process.name == "systemctl" and process.args in ("disable", "stop", "kill", "mask"))
) and
process.args in ("auditd", "auditd.service") and
not (
process.parent.executable like (
"/var/lib/dpkg/info/auditd.prerm", "/usr/libexec/platform-python*"
) or
(process.name == "systemctl" and process.parent.args == "/usr/lib/systemd/systemd-update-helper") or
process.parent.args like (
"/home/*/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py", "/var/lib/dpkg/info/auditd.prerm", "/var/tmp/rpm-tmp*"
) or
process.parent.executable == "/opt/kaspersky/kesl/libexec/kesl" or
process.parent.command_line like "*logrotate_script*"
)
'''
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 = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[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: process
process where event.type == "start" and event.action == "exec" and (
(process.name == "service" and process.args == "stop") or
(process.name == "chkconfig" and process.args == "off") or
(process.name == "update-rc.d" and process.args in ("remove", "disable")) or
(process.name == "systemctl" and process.args in ("disable", "stop", "kill", "mask"))
) and
process.args in ("auditd", "auditd.service") and
not (
process.parent.executable like (
"/var/lib/dpkg/info/auditd.prerm", "/usr/libexec/platform-python*"
) or
(process.name == "systemctl" and process.parent.args == "/usr/lib/systemd/systemd-update-helper") or
process.parent.args like (
"/home/*/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py", "/var/lib/dpkg/info/auditd.prerm", "/var/tmp/rpm-tmp*"
) or
process.parent.executable == "/opt/kaspersky/kesl/libexec/kesl" or
process.parent.command_line like "*logrotate_script*"
)
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.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_basename" kind:eq |
Exclusions
The rule actively suppresses these predicates.
AWS IAM Roles Anywhere Profile Creation
#Detects the creation of a new AWS IAM Roles Anywhere profile. Roles Anywhere allows workloads or external systems to assume IAM roles from outside AWS by authenticating via trusted certificate authorities (trust anchors). Adversaries who have established persistence through a rogue trust anchor may create or modify profiles to link them with highly privileged roles, enabling long-term external access to the AWS environment. This rule identifies successful "CreateProfile" API calls and helps detect potentially unauthorized or risky external access configurations.
Known False Positives
- AWS Roles Anywhere profiles are legitimate profiles that can be created by administrators to allow access from any location. Ensure that the profile created is expected and that the trust policy is configured securely.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2024/04/20"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Detects the creation of a new AWS IAM Roles Anywhere profile. Roles Anywhere allows workloads or external systems to
assume IAM roles from outside AWS by authenticating via trusted certificate authorities (trust anchors). Adversaries who
have established persistence through a rogue trust anchor may create or modify profiles to link them with highly
privileged roles, enabling long-term external access to the AWS environment. This rule identifies successful
"CreateProfile" API calls and helps detect potentially unauthorized or risky external access configurations.
"""
false_positives = [
"""
AWS Roles Anywhere profiles are legitimate profiles that can be created by administrators to allow access from any
location. Ensure that the profile created is expected and that the trust policy is configured securely.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "AWS IAM Roles Anywhere Profile Creation"
note = """## Triage and analysis
### Investigating AWS IAM Roles Anywhere Profile Creation
AWS IAM Roles Anywhere allows external workloads — such as CI/CD runners, on-premises systems, or third-party services —
to assume IAM roles securely by presenting a certificate from a trusted anchor. A profile defines the IAM roles that
can be assumed, the trust anchor they are associated with, and session duration limits.
This rule detects when a new Roles Anywhere profile is created using the `CreateProfile` API call. Unauthorized profile
creation can enable persistent external access if tied to over-privileged roles or to trust anchors associated with
unauthorized certificate authorities (CAs). Monitoring profile creation is crucial to ensuring that only approved roles
and anchors are in use.
#### Possible investigation steps
- **Identify the actor**
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to determine
which IAM user, role, or principal created the profile.
- Check whether this identity normally manages Roles Anywhere configurations.
- **Review profile configuration**
- Inspect `aws.cloudtrail.request_parameters` for key values such as:
- `profileName`
- `roleArns` – confirm that the listed IAM roles are expected and not overly permissive.
- `trustAnchorArn` – verify the trust anchor is valid and authorized.
- `durationSeconds` – check for unusually long session durations.
- Determine if multiple roles were attached, which may indicate excessive privilege aggregation.
- **Correlate related activity**
- Check for prior or concurrent events by the same actor, including:
- `CreateTrustAnchor` with external or unauthorized certificate authorities.
- `CreateRole`, `PutRolePolicy`, or `AttachRolePolicy` for privilege escalation paths.
- Review whether subsequent `AssumeRoleWithCertificate` events occurred, indicating use of the new profile.
- **Assess the source context**
- Investigate `source.ip`, `user_agent.original`, and `source.geo` fields to identify if this request originated from an unfamiliar host, region, or automation client (e.g., `boto3`, `curl`, custom SDKs).
- Compare to baseline patterns of legitimate IAM or infrastructure automation.
- **Validate legitimacy**
- Contact the responsible team (e.g., platform, PKI, or IAM administration) to confirm whether this profile creation
aligns with approved change management or onboarding activities.
### False positive analysis:
- **Legitimate administrative actions**
- IAM or PKI engineers may legitimately create profiles during setup of new external integrations or workloads.
Validate against change control records and deployment logs.
- **Authorized automation**
- Infrastructure-as-code (IaC) pipelines (Terraform, CloudFormation, etc.) may automatically create profiles.
Confirm these operations are sourced from known automation accounts or IP ranges.
- **Development and testing**
- Lab or sandbox accounts may test Roles Anywhere configurations with less restrictive controls.
Ensure alerts from non-production accounts are tuned accordingly.
### Response and remediation:
- **Immediate review and containment**
- If unauthorized, disable or delete the created profile (`aws rolesanywhere delete-profile`) and review all
associated IAM roles for misuse.
- Rotate any credentials or revoke certificates issued from unapproved trust anchors.
- **Investigation**
- Search CloudTrail for additional related actions by the same identity, such as
`CreateTrustAnchor`, `AssumeRoleWithCertificate`, or cross-account access attempts.
- Verify whether any sessions have been initiated using the new profile and identify
which roles were assumed.
- **Recovery and hardening**
- Restrict `rolesanywhere:CreateProfile` to a small set of administrative roles.
- Implement AWS Config or Security Hub controls to alert on unauthorized or overly
permissive Roles Anywhere profiles.
- Audit IAM role trust policies linked to external anchors and ensure adherence to the
principle of least privilege.
- Review and document all approved Roles Anywhere profiles and their corresponding trust anchors.
### 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)**
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
"""
references = [
"https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html",
"https://docs.datadoghq.com/security/default_rules/cloudtrail-aws-iam-roles-anywhere-trust-anchor-created/",
"https://ermetic.com/blog/aws/keep-your-iam-users-close-keep-your-third-parties-even-closer-part-1/",
"https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateProfile.html",
]
risk_score = 73
rule_id = "1d4ca9c0-ff1e-11ee-91cc-f661ea17fbce"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS IAM",
"Use Case: Identity and Access Audit",
"Tactic: Persistence",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: aws.cloudtrail
and event.provider: rolesanywhere.amazonaws.com
and event.action: CreateProfile
and event.outcome: success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.003"
name = "Additional Cloud Roles"
reference = "https://attack.mitre.org/techniques/T1098/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 = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.003"
name = "Additional Cloud Roles"
reference = "https://attack.mitre.org/techniques/T1098/003/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[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: rolesanywhere.amazonaws.com
and event.action: CreateProfile
and event.outcome: success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"aws.cloudtrail" |
event.action | eq |
| field:"EventType" kind:eq value:"CreateProfile" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"rolesanywhere.amazonaws.com" |
Discovery of GitHub Actions Runner Process PID
#This rule detects the discovery of the GitHub Actions Runner process PID using the pgrep command. Adversaries may use this technique to identify the PID of the GitHub Actions Runner process, which can be used to execute commands on the runner host. This behavior may indicate malicious or unexpected workflow activity, including code execution, file manipulation, or network exfiltration initiated through a compromised repository or unauthorized workflow.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Discovery |
Telemetry Coverage
Rule Body
[rule]
description = """
This rule detects the discovery of the GitHub Actions Runner process PID using the pgrep command. Adversaries may use
this technique to identify the PID of the GitHub Actions Runner process, which can be used to execute commands on the
runner host. This behavior may indicate malicious or unexpected workflow activity, including code execution, file
manipulation, or network exfiltration initiated through a compromised repository or unauthorized workflow.
"""
id = "d908caa5-2d4c-4ba7-9ce8-5f1ff4315397"
license = "Elastic License v2"
name = "Discovery of GitHub Actions Runner Process PID"
os_list = ["linux", "macos"]
reference = [
"https://socket.dev/blog/trivy-under-attack-again-github-actions-compromise",
"https://www.stepsecurity.io/blog/trivy-compromised-a-second-time---malicious-v0-69-4-release",
"https://www.crowdstrike.com/en-us/blog/from-scanner-to-stealer-inside-the-trivy-action-supply-chain-compromise/",
]
version = "1.0.2"
query = '''
sequence by process.parent.entity_id with maxspan=3s
[process where event.type == "start" and event.action == "exec" and process.name == "pgrep" and
process.args in ("Runner.Listener", "Runner.Worker", "Runner.PluginHost", "run.sh", "svc.sh", "runsvc.sh")] as event0
[process where event.type == "start" and event.action == "exec" and process.name == "pgrep" and
not startswith~(process.command_line, event0.process.command_line) and
process.args in ("Runner.Listener", "Runner.Worker", "Runner.PluginHost", "run.sh", "svc.sh", "runsvc.sh")]
'''
min_endpoint_version = "8.4.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1195"
name = "Supply Chain Compromise"
reference = "https://attack.mitre.org/techniques/T1195/"
[[threat.technique.subtechnique]]
id = "T1195.001"
name = "Compromise Software Dependencies and Development Tools"
reference = "https://attack.mitre.org/techniques/T1195/001/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1057"
name = "Process Discovery"
reference = "https://attack.mitre.org/techniques/T1057/"
[threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3s, correlated by process.parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.name == "pgrep" and
process.args in ("Runner.Listener", "Runner.Worker", "Runner.PluginHost", "run.sh", "svc.sh", "runsvc.sh")] as event0
Stage 2: process
[process where event.type == "start" and event.action == "exec" and process.name == "pgrep" and
not startswith~(process.command_line, event0.process.command_line) and
process.args in ("Runner.Listener", "Runner.Worker", "Runner.PluginHost", "run.sh", "svc.sh", "runsvc.sh")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_basename" kind:eq value:"pgrep" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | starts_with | event0.process.command_line | excludes:process.command_line field:"process.command_line" value:"event0.process.command_line" |
Entra ID Deviceless Windows Hello Sign-in Followed by Device Registration
#Identifies a Microsoft Entra ID device registration by the same user within 15 minutes of a phishing-resistant, device-bound credential (Windows Hello for Business, FIDO2 security key, or passkey) signing in with no device identifier. In the "borrowing Windows Hello keys" technique, an adversary reuses a WHfB/NGC key or passkey away from its bound device to mint device-agnostic tokens, then uses those tokens to register an attacker-controlled device and obtain a Primary Refresh Token (PRT) for long-lived persistence. Timing is taken from the authentication step on the sign-in, not the sign-in document timestamp, because Entra can emit the sign-in record after the Register device audit event. This chain is distinct from device-code-flow phishing kits.
Known False Positives
- A user completing initial passwordless enrollment and registering their first device in the same session can match. Validate against expected onboarding and the device's provenance (managed/compliant, expected name, expected source).
- Authorized red team or research engagements that borrow a WHfB/passkey and register a device will match. Document the engagement and add scoped exceptions for the involved principals or source addresses.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Lateral Movement |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Azure Device No Longer Managed or Compliant (Sigma)
- Azure Device or Configuration Modified or Deleted (Sigma)
- Entra ID AiTM Phishing-Kit Chain Detected (Elastic)
- Entra ID Device Registration with Phishing Kit Default OS Build (Elastic)
- Entra ID Device Registration with ROADtools Default OS Build (Elastic)
- Entra ID Multiple Device Registrations by a Single User (Elastic)
- Entra ID Protection User Alert and Device Registration (Elastic)
- Entra ID Register Device with Unusual User Agent (Azure AD Join) (Elastic)
Rule Body
[metadata]
creation_date = "2026/08/07"
integration = ["azure"]
maturity = "production"
min_stack_comments = "FIELD_EXTRACT for flattened fields requires 9.5.0"
min_stack_version = "9.5.0"
updated_date = "2026/08/07"
[rule]
author = ["Elastic"]
description = """
Identifies a Microsoft Entra ID device registration by the same user within 15 minutes of a phishing-resistant,
device-bound credential (Windows Hello for Business, FIDO2 security key, or passkey) signing in with no device
identifier. In the "borrowing Windows Hello keys" technique, an adversary reuses a WHfB/NGC key or passkey away from its
bound device to mint device-agnostic tokens, then uses those tokens to register an attacker-controlled device and obtain
a Primary Refresh Token (PRT) for long-lived persistence. Timing is taken from the authentication step on the sign-in,
not the sign-in document timestamp, because Entra can emit the sign-in record after the Register device audit event.
This chain is distinct from device-code-flow phishing kits.
"""
false_positives = [
"""
A user completing initial passwordless enrollment and registering their first device in the same session can match.
Validate against expected onboarding and the device's provenance (managed/compliant, expected name, expected
source).
""",
"""
Authorized red team or research engagements that borrow a WHfB/passkey and register a device will match. Document
the engagement and add scoped exceptions for the involved principals or source addresses.
""",
]
from = "now-30m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Entra ID Deviceless Windows Hello Sign-in Followed by Device Registration"
note = """## Triage and analysis
### Investigating Entra ID Deviceless Windows Hello Sign-in Followed by Device Registration
This rule correlates, within 15 minutes for the same user: (1) a successful member sign-in satisfied by a device-bound credential (WHfB, FIDO2, or passkey) with an empty `device_detail.device_id`, and (2) a successful device registration (`Register device`, `Add registered owner to device`, or `Add device`). The alert is the sign-in document enriched with the matching registration. `Esql.signin_time` is the authentication step time from flattened `authentication_details` (falling back to `@timestamp`); use it and `Esql.signin_to_register_s` for sequencing, since Entra can write the sign-in record after the `Register device` audit event, making `@timestamp` unreliable for ordering.
This is the escalation step of the "borrowing Windows Hello keys" technique: an adversary mints a device-agnostic token from a deviceless WHfB/passkey assertion, then immediately registers an attacker-controlled device to obtain a Primary Refresh Token that survives `revokeSignInSessions` and password resets.
### Possible investigation steps
- Identify the user (`user_principal_name` / `Esql.actor_user_id`) and confirm `Esql.auth_method` is WHfB/FIDO2/passkey with an empty `device_detail.device_id` and `cross_tenant_access_type` of `none` - a device-bound method presenting without its device is the first-stage signal.
- Compare `Esql.signin_time` to `Esql.register_time` via `Esql.signin_to_register_s`; a gap of seconds to minutes is the expected attacker cadence. `Esql.registered_device_name`/`Esql.register_operation` for tooling-registered devices are often generic (`DESKTOP-*`) and absent from inventory/unmanaged.
- Check `app_display_name`/`resource_display_name` for non-interactive clients (Azure CLI, ROADtools/roadtx) against Graph or the Device Registration Service, `source.address`/`source.geo.country_name`/`user_agent.original` for hosting/VPS or automation, and pivot on `Esql.actor_user_id` for a follow-on `primaryRefreshToken` `incoming_token_type` from the new device or an `Add Windows Hello for Business credential` event (backdoor enrollment).
### False positive analysis
- Initial passwordless onboarding can produce a sign-in and first device registration in the same session; validate the device against inventory and confirm it is managed/compliant and named as expected.
- Authorized security assessments that replay a key and register a device will also match; document the engagement and add scoped exceptions.
### Response and remediation
- Remove the rogue device BEFORE revoking sessions (`GET /v1.0/users/{id}/registeredDevices` and `/ownedDevices`, then `DELETE /v1.0/devices/{deviceObjectId}` for unrecognized devices) - a device-bound PRT survives `revokeSignInSessions`, and a device left in place re-establishes access.
- Treat the key/passkey as compromised: delete the affected authentication methods, revoke refresh tokens and sessions (`POST /v1.0/users/{id}/revokeSignInSessions`), reset credentials, and re-enroll from a trusted device.
- Hunt for additional persistence in the same window (attacker-registered MFA methods, extra device registrations, PRT use from the new device), and restrict device registration/join via Conditional Access requiring a compliant device.
"""
references = [
"https://dirkjanm.io/borrowing-windows-hello-keys/",
"https://dirkjanm.io/phishing-for-microsoft-entra-primary-refresh-tokens/",
]
risk_score = 73
rule_id = "62848597-595c-4cc3-8d24-6c47a5fee9a9"
setup = """#### Required Microsoft Entra ID Sign-In and Audit Logs
This rule requires the Azure integration with Microsoft Entra ID Sign-In logs and Audit logs enabled and collected via Azure Event Hub. Both data streams are required: the sign-in supplies the deviceless WHfB/passkey assertion, and the audit log supplies the follow-on device registration.
"""
severity = "high"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Platform: Entra ID",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Defense Evasion",
"Rule Type: ESQL",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Sign-in Logs",
"Data Source: Microsoft Entra ID Audit Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
FROM logs-azure.signinlogs-*, logs-azure.auditlogs-* METADATA _id, _version, _index
| WHERE
(
azure.signinlogs.result_signature == "SUCCESS" AND
azure.signinlogs.properties.user_type == "Member" AND
azure.signinlogs.properties.user_id IS NOT NULL AND
azure.signinlogs.properties.cross_tenant_access_type == "none" AND
(
azure.signinlogs.properties.device_detail.device_id IS NULL OR
azure.signinlogs.properties.device_detail.device_id == ""
)
) OR
(
azure.auditlogs.operation_name IN ("Register device", "Add registered owner to device", "Add device") AND
event.outcome == "success" AND
azure.auditlogs.properties.initiated_by.user.id IS NOT NULL
)
| EVAL
Esql.sequence_stage = CASE(data_stream.dataset == "azure.signinlogs", "signin", "register"),
Esql.actor_user_id = COALESCE(azure.signinlogs.properties.user_id, azure.auditlogs.properties.initiated_by.user.id),
Esql.auth_method = FIELD_EXTRACT(azure.signinlogs.properties.authentication_details, "authentication_method"),
Esql.auth_step_time = MV_MIN(TO_DATETIME(FIELD_EXTRACT(azure.signinlogs.properties.authentication_details, "authentication_step_date_time"))),
Esql.register_candidate = CASE(
data_stream.dataset == "azure.auditlogs",
CONCAT(
TO_STRING(@timestamp),
"|",
COALESCE(`azure.auditlogs.properties.target_resources.0.display_name`, ""),
"|",
azure.auditlogs.operation_name
),
null
)
| EVAL Esql.signin_time = COALESCE(Esql.auth_step_time, @timestamp)
| WHERE
Esql.sequence_stage == "register" OR
(
MV_COUNT(Esql.auth_method) == 1 AND
(
Esql.auth_method == "Windows Hello for Business" OR
TO_LOWER(Esql.auth_method) LIKE "fido2*" OR
TO_LOWER(Esql.auth_method) LIKE "*passkey*"
)
)
| KEEP
@timestamp,
Esql.signin_time,
Esql.actor_user_id,
Esql.sequence_stage,
Esql.auth_method,
Esql.register_candidate,
azure.signinlogs.properties.user_id,
azure.signinlogs.properties.user_principal_name,
azure.signinlogs.properties.device_detail.device_id,
azure.signinlogs.properties.device_detail.is_managed,
azure.signinlogs.properties.cross_tenant_access_type,
azure.signinlogs.properties.app_id,
azure.signinlogs.properties.app_display_name,
azure.signinlogs.properties.resource_display_name,
azure.signinlogs.properties.incoming_token_type,
source.address,
source.geo.country_name,
user_agent.original,
_id,
_version,
_index
| WHERE Esql.actor_user_id IS NOT NULL
| INLINE STATS
Esql.register_count = COUNT(*) WHERE Esql.sequence_stage == "register",
Esql.register_candidates = VALUES(Esql.register_candidate) WHERE Esql.sequence_stage == "register"
BY Esql.actor_user_id
| DROP Esql.register_candidate
| WHERE Esql.sequence_stage == "signin" AND Esql.register_count > 0
| MV_EXPAND Esql.register_candidates
| EVAL
Esql.register_time = TO_DATETIME(MV_FIRST(SPLIT(Esql.register_candidates, "|"))),
Esql.registered_device_name = MV_SLICE(SPLIT(Esql.register_candidates, "|"), 1, 1),
Esql.register_operation = MV_LAST(SPLIT(Esql.register_candidates, "|")),
Esql.signin_to_register_s = DATE_DIFF("second", Esql.signin_time, Esql.register_time)
| DROP Esql.register_candidates, Esql.sequence_stage, Esql.register_count
| WHERE
Esql.signin_to_register_s >= 0 AND
Esql.signin_to_register_s <= 900
| SORT Esql.register_time ASC, Esql.signin_to_register_s ASC, _id ASC
| LIMIT 1 BY Esql.actor_user_id
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.005"
name = "Device Registration"
reference = "https://attack.mitre.org/techniques/T1098/005/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: from
FROM logs-azure.signinlogs-*, logs-azure.auditlogs-* METADATA _id, _version, _index
Stage 2: where
| WHERE
(
azure.signinlogs.result_signature == "SUCCESS" AND
azure.signinlogs.properties.user_type == "Member" AND
azure.signinlogs.properties.user_id IS NOT NULL AND
azure.signinlogs.properties.cross_tenant_access_type == "none" AND
(
azure.signinlogs.properties.device_detail.device_id IS NULL OR
azure.signinlogs.properties.device_detail.device_id == ""
)
) OR
(
azure.auditlogs.operation_name IN ("Register device", "Add registered owner to device", "Add device") AND
event.outcome == "success" AND
azure.auditlogs.properties.initiated_by.user.id IS NOT NULL
)
Stage 3: eval
| EVAL
Esql.sequence_stage = CASE(data_stream.dataset == "azure.signinlogs", "signin", "register"),
Esql.actor_user_id = COALESCE(azure.signinlogs.properties.user_id, azure.auditlogs.properties.initiated_by.user.id),
Esql.auth_method = FIELD_EXTRACT(azure.signinlogs.properties.authentication_details, "authentication_method"),
Esql.auth_step_time = MV_MIN(TO_DATETIME(FIELD_EXTRACT(azure.signinlogs.properties.authentication_details, "authentication_step_date_time"))),
Esql.register_candidate = CASE(
data_stream.dataset == "azure.auditlogs",
CONCAT(
TO_STRING(@timestamp),
"|",
COALESCE(`azure.auditlogs.properties.target_resources.0.display_name`, ""),
"|",
azure.auditlogs.operation_name
),
null
)
Esql.register_candidate =data_stream.dataset == "azure.auditlogs"CONCAT(
TO_STRING(@timestamp),
"|",
COALESCE(`azure.auditlogs.properties.target_resources.0.display_name`, ""),
"|",
azure.auditlogs.operation_name
)nullEsql.sequence_stage =data_stream.dataset == "azure.signinlogs""signin""register"Stage 4: eval
| EVAL Esql.signin_time = COALESCE(Esql.auth_step_time, @timestamp)
Stage 5: where
| WHERE
Esql.sequence_stage == "register" OR
(
MV_COUNT(Esql.auth_method) == 1 AND
(
Esql.auth_method == "Windows Hello for Business" OR
TO_LOWER(Esql.auth_method) LIKE "fido2*" OR
TO_LOWER(Esql.auth_method) LIKE "*passkey*"
)
)
Stage 6: keep
| KEEP
@timestamp,
Esql.signin_time,
Esql.actor_user_id,
Esql.sequence_stage,
Esql.auth_method,
Esql.register_candidate,
azure.signinlogs.properties.user_id,
azure.signinlogs.properties.user_principal_name,
azure.signinlogs.properties.device_detail.device_id,
azure.signinlogs.properties.device_detail.is_managed,
azure.signinlogs.properties.cross_tenant_access_type,
azure.signinlogs.properties.app_id,
azure.signinlogs.properties.app_display_name,
azure.signinlogs.properties.resource_display_name,
azure.signinlogs.properties.incoming_token_type,
source.address,
source.geo.country_name,
user_agent.original,
_id,
_version,
_index
Stage 7: where
| WHERE Esql.actor_user_id IS NOT NULL
Stage 8: inline_stats
| INLINE STATS
Esql.register_count = COUNT(*) WHERE Esql.sequence_stage == "register",
Esql.register_candidates = VALUES(Esql.register_candidate) WHERE Esql.sequence_stage == "register"
BY Esql.actor_user_id
Stage 9: drop
| DROP Esql.register_candidate
Stage 10: where
| WHERE Esql.sequence_stage == "signin" AND Esql.register_count > 0
Stage 11: mv_expand
| MV_EXPAND Esql.register_candidates
Stage 12: eval
| EVAL
Esql.register_time = TO_DATETIME(MV_FIRST(SPLIT(Esql.register_candidates, "|"))),
Esql.registered_device_name = MV_SLICE(SPLIT(Esql.register_candidates, "|"), 1, 1),
Esql.register_operation = MV_LAST(SPLIT(Esql.register_candidates, "|")),
Esql.signin_to_register_s = DATE_DIFF("second", Esql.signin_time, Esql.register_time)
Stage 13: drop
| DROP Esql.register_candidates, Esql.sequence_stage, Esql.register_count
Stage 14: where
| WHERE
Esql.signin_to_register_s >= 0 AND
Esql.signin_to_register_s <= 900
Stage 15: sort
| SORT Esql.register_time ASC, Esql.signin_to_register_s ASC, _id ASC
Stage 16: limit
| LIMIT 1 BY Esql.actor_user_id
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.actor_user_id | STATS BY |
Esql.register_time | EVAL TO_DATETIME(MV_FIRST(SPLIT(Esql.register_candidates, "|"))) |
Esql.registered_device_name | EVAL MV_SLICE(SPLIT(Esql.register_candidates, "|"), 1, 1) |
Esql.register_operation | EVAL MV_LAST(SPLIT(Esql.register_candidates, "|")) |
Esql.signin_to_register_s | EVAL DATE_DIFF("second", Esql.signin_time, Esql.register_time) |
Execution of Persistent Suspicious Program
#Identifies execution of suspicious persistent programs (scripts, rundll32, etc.) by looking at process lineage and command line usage.
MITRE ATT&CK Coverage
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/11/19"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies execution of suspicious persistent programs (scripts, rundll32, etc.) by looking at process lineage and
command line usage.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Execution of Persistent Suspicious Program"
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 Execution of Persistent Suspicious Program
Persistent programs, like scripts or rundll32, are often used by adversaries to maintain access to a system. These programs can be executed at startup, leveraging process lineage and command line arguments to evade detection. The detection rule identifies suspicious executions by monitoring the sequence of processes initiated after user logon, focusing on known malicious executables and unusual file paths, thus highlighting potential abuse of persistence mechanisms.
### Possible investigation steps
- Review the process lineage to confirm the sequence of userinit.exe, explorer.exe, and the suspicious child process. Verify if the child process was indeed launched shortly after user logon.
- Examine the command line arguments of the suspicious process to identify any unusual or malicious patterns, especially those involving known suspicious paths like C:\\Users\\*, C:\\ProgramData\\*, or C:\\Windows\\Temp\\*.
- Check the original file name of the suspicious process against known malicious executables such as cscript.exe, wscript.exe, or PowerShell.EXE to determine if it matches any of these.
- Investigate the parent process explorer.exe to ensure it was not compromised or manipulated to launch the suspicious child process.
- Analyze the user account associated with the suspicious process to determine if it has been involved in any other suspicious activities or if it has elevated privileges that could be exploited.
- Review recent system changes or installations that might have introduced the suspicious executable or altered startup configurations.
### False positive analysis
- Legitimate administrative scripts or tools may trigger alerts if they are executed from common directories like C:\\Users or C:\\ProgramData. To manage this, create exceptions for known administrative scripts that are regularly used in your environment.
- Software updates or installations might use processes like PowerShell or RUNDLL32, leading to false positives. Identify and exclude these processes when they are part of a verified update or installation routine.
- Custom scripts or automation tasks that run at startup could be flagged. Document these tasks and exclude them from the rule if they are part of normal operations.
- Security or monitoring tools that use similar execution patterns may be mistakenly identified. Verify these tools and add them to an exclusion list to prevent unnecessary alerts.
- User-initiated actions that mimic suspicious behavior, such as running scripts from the command line, can cause false positives. Educate users on safe practices and adjust the rule to exclude known benign user actions.
### Response and remediation
- Isolate the affected host from the network to prevent further spread or communication with potential command and control servers.
- Terminate any suspicious processes identified in the alert, such as those executed by cscript.exe, wscript.exe, PowerShell.EXE, MSHTA.EXE, RUNDLL32.EXE, REGSVR32.EXE, RegAsm.exe, MSBuild.exe, or InstallUtil.exe.
- Remove any unauthorized or suspicious startup entries or scheduled tasks that may have been created to ensure persistence.
- Conduct a thorough scan of the system using updated antivirus or endpoint detection and response (EDR) tools to identify and remove any additional malicious files or remnants.
- Review and restore any modified system configurations or registry settings to their default or secure state.
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for the affected host and similar systems to detect any recurrence or related suspicious activities."""
risk_score = 47
rule_id = "e7125cea-9fe1-42a5-9a05-b0792cf86f5a"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
/* userinit followed by explorer followed by early child process of explorer (unlikely to be launched interactively) within 1m */
sequence by host.id, user.name with maxspan=1m
[process where host.os.type == "windows" and event.type == "start" and process.name : "userinit.exe" and process.parent.name : "winlogon.exe"]
[process where host.os.type == "windows" and event.type == "start" and process.name : "explorer.exe"]
[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "explorer.exe" and
/* add suspicious programs here */
process.pe.original_file_name in ("cscript.exe",
"wscript.exe",
"PowerShell.EXE",
"MSHTA.EXE",
"RUNDLL32.EXE",
"REGSVR32.EXE",
"RegAsm.exe",
"MSBuild.exe",
"InstallUtil.exe") and
/* add potential suspicious paths here */
process.args : ("C:\\Users\\*", "C:\\ProgramData\\*", "C:\\Windows\\Temp\\*", "C:\\Windows\\Tasks\\*", "C:\\PerfLogs\\*", "C:\\Intel\\*")
]
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[rule.threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1127"
name = "Trusted Developer Utilities Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1127/"
[[rule.threat.technique.subtechnique]]
id = "T1127.001"
name = "MSBuild"
reference = "https://attack.mitre.org/techniques/T1127/001/"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.004"
name = "InstallUtil"
reference = "https://attack.mitre.org/techniques/T1218/004/"
[[rule.threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"
[[rule.threat.technique.subtechnique]]
id = "T1218.009"
name = "Regsvcs/Regasm"
reference = "https://attack.mitre.org/techniques/T1218/009/"
[[rule.threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"
[[rule.threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "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
Ordered sequence: each step below must occur in order within 1m, correlated by host.id, user.name.
Stage 1: process
[process where host.os.type == "windows" and event.type == "start" and process.name : "userinit.exe" and process.parent.name : "winlogon.exe"]
Stage 2: process
[process where host.os.type == "windows" and event.type == "start" and process.name : "explorer.exe"]
Stage 3: process
[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "explorer.exe" and
process.pe.original_file_name in ("cscript.exe",
"wscript.exe",
"PowerShell.EXE",
"MSHTA.EXE",
"RUNDLL32.EXE",
"REGSVR32.EXE",
"RegAsm.exe",
"MSBuild.exe",
"InstallUtil.exe") and
process.args : ("C:\\Users\\*", "C:\\ProgramData\\*", "C:\\Windows\\Temp\\*", "C:\\Windows\\Tasks\\*", "C:\\PerfLogs\\*", "C:\\Intel\\*")
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
process.pe.original_file_name | in |
| field:"OriginalFileName" kind:in |
Google Workspace Gmail Routing or Forwarding Rule Created or Modified
#Detects when a Gmail routing, mail-forwarding, or custom mail-host setting is created or modified in Google Workspace. Adversaries with administrative access can add Routing rules (also deliver to / change envelope recipient), recipient address map forwarding, or mail hosts and outbound gateways to copy or redirect sensitive email for collection.
Known False Positives
- Administrators may create or change Gmail routing, dual-delivery, address maps, or mail hosts for migrations, journaling, spam handling, or partner integrations.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- Application Removed from Blocklist in Google Workspace (Elastic)
- Google Workspace Bitlocker Setting Disabled (Elastic)
- Google Workspace Marketplace Allowlist Configuration (YARA-L)
- Google Workspace Password Policy Changed (YARA-L)
- Google Workspace Password Policy Modified (Elastic)
- Google Workspace Restrictions for Marketplace Modified to Allow Any App (Elastic)
- GSuite Workspace Gmail Pre-Delivery Message Scanning Disabled (Panther)
- GSuite Workspace Gmail Security Sandbox Disabled (Panther)
Rule Body
[metadata]
creation_date = "2022/09/13"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Detects when a Gmail routing, mail-forwarding, or custom mail-host setting is created or modified in Google Workspace.
Adversaries with administrative access can add Routing rules (also deliver to / change envelope recipient), recipient
address map forwarding, or mail hosts and outbound gateways to copy or redirect sensitive email for collection.
"""
false_positives = [
"""
Administrators may create or change Gmail routing, dual-delivery, address maps, or mail hosts for migrations,
journaling, spam handling, or partner integrations.
""",
]
from = "now-20m"
index = ["logs-google_workspace.admin-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "Google Workspace Gmail Routing or Forwarding Rule Created or Modified"
note = """## Triage and analysis
### Investigating Google Workspace Gmail Routing or Forwarding Rule Created or Modified
Gmail administrators can change where mail is delivered using several Admin console areas under Apps > Google Workspace > Gmail:
- Routing — specialized rules (modify message, change route, also deliver to, change envelope recipient). Audit: `UNIFIED_MAIL_ROUTING` or `MESSAGE_SECURITY_RULE` (legacy); `google_workspace.admin.setting.metadata.rule.type` may repeat the legacy type on `RuleState` rows.
- Email forwarding using recipient address map — rewrite or forward by address mapping. Audit: `ALIAS_TABLE`.
- Hosts / Outbound gateway — custom SMTP routes. Audit: `EMAIL_ROUTE`.
Google may emit multiple admin audit events per single save (legacy `CREATE_GMAIL_SETTING`, new `CREATE_APPLICATION_SETTING`, rule body, and rule enabled state). Expect duplicate documents at the same `@timestamp`; correlate on `user.name`, `google_workspace.admin.USER_DEFINED_SETTING_NAME` (rule id), and `event.id`.
### Possible investigation steps
- Identify the administrator (`user.name`, `user.email`) and confirm the change was authorized.
- In Admin console, review the rule matching `google_workspace.admin.USER_DEFINED_SETTING_NAME`:
- Routing (`UNIFIED_MAIL_ROUTING`, `MESSAGE_SECURITY_RULE`): Apps > Gmail > Routing
- Recipient address map (`ALIAS_TABLE`): Apps > Gmail > Default routing > Email forwarding using recipient address map
- Mail hosts / outbound gateway (`EMAIL_ROUTE`): Apps > Gmail > Hosts
- Map the alert to the admin area using `google_workspace.admin.setting.name` and `google_workspace.admin.setting.metadata.rule.type`
- Review whether the rule adds also deliver to, change envelope recipient, or routes to an external mail host or domain.
- Review related `event.action` values for the same administrator in the last 48 hours.
- If licensed for Gmail log events (BigQuery / Enterprise Plus), use Reporting > Audit and investigation > Gmail log events to confirm messages were delivered per the rule (`message_info.flattened_destinations`, `triggered_rule_info`).
- Submit suspicious URLs or attachments from affected mail to reputational services as needed.
### False positive analysis
- Legitimate mail migrations, journaling, compliance archiving, and internal dual-delivery are common.
- Tune with exceptions for known administrator accounts, rule ids (`USER_DEFINED_SETTING_NAME`), or approved external domains.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
- Identify the account role in the cloud environment.
- Assess the criticality of affected services and servers.
- Work with your IT team to identify and minimize the impact on users.
- Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
- Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
## Setup
The Google Workspace Fleet integration with the Admin data stream (`logs-google_workspace.admin-*`) is required for this rule.
### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
- This rule uses `timestamp_override = event.ingested` and is configured to run every 10 minutes with a lookback of 20 minutes, aligned with the integration's default Admin poll interval (`interval`: 15m) and lag time (`lag_time`: 3m).
- See the following references for further information:
- https://support.google.com/a/answer/7061566
- https://www.elastic.co/docs/reference/integrations/google_workspace"""
references = [
"https://support.google.com/a/answer/2685650?hl=en",
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
]
risk_score = 73
rule_id = "9510add4-3392-11ed-bd01-f661ea17fbce"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: Google Workspace",
"Tactic: Collection",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:"google_workspace.admin" and event.action:(
"CREATE_GMAIL_SETTING" or "CHANGE_GMAIL_SETTING"
or "CREATE_APPLICATION_SETTING" or "CHANGE_APPLICATION_SETTING"
)
and (
google_workspace.admin.setting.name:(
"UNIFIED_MAIL_ROUTING"
or "ALIAS_TABLE"
or "EMAIL_ROUTE"
or "MESSAGE_SECURITY_RULE"
)
or google_workspace.admin.setting.metadata.rule.type:(
"UNIFIED_MAIL_ROUTING"
or "ALIAS_TABLE"
or "EMAIL_ROUTE"
)
)
'''
[rule.investigation_fields]
field_names = [
"source.ip",
"user.name",
"user.email",
"event.action",
"google_workspace.admin.org_unit.name",
"google_workspace.admin.setting.name",
"google_workspace.admin.setting.metadata.rule.type",
"google_workspace.admin.USER_DEFINED_SETTING_NAME",
]
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"
[[rule.threat.technique.subtechnique]]
id = "T1114.003"
name = "Email Forwarding Rule"
reference = "https://attack.mitre.org/techniques/T1114/003/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: query
data_stream.dataset:"google_workspace.admin" and event.action:(
"CREATE_GMAIL_SETTING" or "CHANGE_GMAIL_SETTING"
or "CREATE_APPLICATION_SETTING" or "CHANGE_APPLICATION_SETTING"
)
and (
google_workspace.admin.setting.name:(
"UNIFIED_MAIL_ROUTING"
or "ALIAS_TABLE"
or "EMAIL_ROUTE"
or "MESSAGE_SECURITY_RULE"
)
or google_workspace.admin.setting.metadata.rule.type:(
"UNIFIED_MAIL_ROUTING"
or "ALIAS_TABLE"
or "EMAIL_ROUTE"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"google_workspace.admin" |
event.action | in |
| field:"EventType" kind:in |
google_workspace.admin.setting.metadata.rule.type | in |
| field:"google_workspace.admin.setting.metadata.rule.type" kind:in |
google_workspace.admin.setting.name | in |
| field:"gws::admin_setting_name" kind:in |
Ingress Transfer via Windows BITS
#Identifies downloads of executable and archive files via the Windows Background Intelligent Transfer Service (BITS). Adversaries could leverage Windows BITS transfer jobs to download remote payloads.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Command & Control |
Rule Body
[metadata]
creation_date = "2023/01/13"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"
[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""
[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""
[rule]
author = ["Elastic"]
description = """
Identifies downloads of executable and archive files via the Windows Background Intelligent Transfer Service (BITS).
Adversaries could leverage Windows BITS transfer jobs to download remote payloads.
"""
from = "now-9m"
index = ["logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Ingress Transfer via Windows BITS"
note = """## Triage and analysis
### Investigating Ingress Transfer via Windows BITS
Windows Background Intelligent Transfer Service (BITS) is a technology that allows the transfer of files between a client and a server, which makes it a dual-use mechanism, being used by both legitimate apps and attackers. When malicious applications create BITS jobs, files are downloaded or uploaded in the context of the service host process, which can bypass security protections, and it helps to obscure which application requested the transfer.
This rule identifies such abuse by monitoring for file renaming events involving "svchost.exe" and "BIT*.tmp" on Windows systems.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
### Possible investigation steps
- Gain context into the BITS transfer.
- Try to determine the process that initiated the BITS transfer.
- Search `bitsadmin.exe` processes and examine their command lines.
- Look for unusual processes loading `Bitsproxy.dll` and other BITS-related DLLs.
- Try to determine the origin of the file.
- Inspect network connections initiated by `svchost.exe`.
- Inspect `Microsoft-Windows-Bits-Client/Operational` Windows logs, specifically the event ID 59, for unusual events.
- Velociraptor can be used to extract these entries using the [bitsadmin artifact](https://docs.velociraptor.app/exchange/artifacts/pages/bitsadmin/).
- Check the reputation of the remote server involved in the BITS transfer, such as its IP address or domain, using threat intelligence platforms or online reputation services.
- Check if the domain is newly registered or unexpected.
- Use the identified domain as an indicator of compromise (IoCs) to scope other compromised hosts in the environment.
- [BitsParser](https://github.com/fireeye/BitsParser) can be used to parse BITS database files to extract BITS job information.
- Examine the details of the dropped file, and whether it was executed.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Examine the host for derived artifacts that indicate suspicious activities:
- Analyze the involved executables using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process's `process.entity_id`.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
### False positive analysis
- Known false positives for the rule include legitimate software and system updates that use BITS for downloading files.
### Related Rules
- Persistence via BITS Job Notify Cmdline - c3b915e0-22f3-4bf7-991d-b643513c722f
- Unsigned BITS Service Client Process - 9a3884d0-282d-45ea-86ce-b9c81100f026
- Bitsadmin Activity - 8eec4df1-4b4b-4502-b6c3-c788714604c9
### Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
- Isolate the involved hosts to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Restore the affected system to its operational state by applying any necessary patches, updates, or configuration changes.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
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
"""
references = ["https://attack.mitre.org/techniques/T1197/"]
risk_score = 21
rule_id = "f95972d3-c23b-463b-89a8-796b3f369b49"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Command and Control",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.action == "rename" and
process.name : "svchost.exe" and file.Ext.original.name : "BIT*.tmp" and
(file.extension : ("exe", "zip", "rar", "bat", "dll", "ps1", "vbs", "vbe", "wsh", "wsf", "sct", "js", "jse", "hta", "pif", "scr", "cmd", "cpl") or
file.Ext.header_bytes : "4d5a*") and
/* noisy paths, for hunting purposes you can use the same query without the following exclusions */
not file.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\*", "?:\\ProgramData\\*\\*") and
/* lot of third party SW use BITS to download executables with a long file name */
not length(file.name) > 30 and
not file.path : (
"?:\\Users\\*\\AppData\\Local\\Temp*\\wct*.tmp",
"?:\\Users\\*\\AppData\\Local\\Adobe\\ARM\\*\\RdrServicesUpdater*.exe",
"?:\\Users\\*\\AppData\\Local\\Adobe\\ARM\\*\\AcroServicesUpdater*.exe",
"?:\\Users\\*\\AppData\\Local\\Docker Desktop Installer\\update-*.exe"
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1197"
name = "BITS Jobs"
reference = "https://attack.mitre.org/techniques/T1197/"
[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 == "rename" and
process.name : "svchost.exe" and file.Ext.original.name : "BIT*.tmp" and
(file.extension : ("exe", "zip", "rar", "bat", "dll", "ps1", "vbs", "vbe", "wsh", "wsf", "sct", "js", "jse", "hta", "pif", "scr", "cmd", "cpl") or
file.Ext.header_bytes : "4d5a*") and
not file.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\*", "?:\\ProgramData\\*\\*") and
not length(file.name) > 30 and
not file.path : (
"?:\\Users\\*\\AppData\\Local\\Temp*\\wct*.tmp",
"?:\\Users\\*\\AppData\\Local\\Adobe\\ARM\\*\\RdrServicesUpdater*.exe",
"?:\\Users\\*\\AppData\\Local\\Adobe\\ARM\\*\\AcroServicesUpdater*.exe",
"?:\\Users\\*\\AppData\\Local\\Docker Desktop Installer\\update-*.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"rename" |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*" |
file.Ext.original.name | wildcard |
| field:"file.Ext.original.name" kind:wildcard value:"BIT*.tmp" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"svchost.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.name | length_compare | >, 30 | excludes:file.name field:"file.name" value:">" field:"file.name" value:"30" |
file.path | wildcard | ?:\Program Files\*, ?:\Program Files (x86)\*, ?:\Windows\*, ?:\ProgramData\*\* | excludes:file.path |
file.path | wildcard | ?:\Users\*\AppData\Local\Temp*\wct*.tmp, ?:\Users\*\AppData\Local\Adobe\ARM\*\RdrServicesUpdater*.exe, ?:\Users\*\AppData\Local\Adobe\ARM\*\AcroServicesUpdater*.exe, ?:\Users\*\AppData\Local\Docker Desktop Installer\update-*.exe | excludes:file.path |
Interactive Shell Launched via Unusual Parent Process in a Container
#This rule detects when an interactive shell process is launched via an unusual parent processes inside a container. Interactive processes are typically run in the foreground and require user input, which is unusual behavior for a containerized environment. This activity could indicate an attacker attempting to gain access to the container environment or perform malicious actions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule Body
[metadata]
creation_date = "2025/03/12"
integration = ["endpoint"]
maturity = "production"
updated_date = "2025/12/19"
[rule]
author = ["Elastic"]
description = """
This rule detects when an interactive shell process is launched via an unusual parent processes inside a container.
Interactive processes are typically run in the foreground and require user input, which is unusual behavior for a
containerized environment. This activity could indicate an attacker attempting to gain access to the container
environment or perform malicious actions.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "kuery"
license = "Elastic License v2"
name = "Interactive Shell Launched via Unusual Parent Process in a Container"
risk_score = 47
rule_id = "7020ff25-76d7-4a7d-b95b-266cf27d70e8"
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: Container",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:process and host.os.type:linux and event.type:start and event.action:exec and
process.entry_leader.entry_meta.type:container and process.interactive:true and
process.name:(sh or bash or dash or tcsh or csh or zsh or ksh or fish) and
not (
process.parent.name:(dpkg or runc or tini or frontend or elastic-agent or agentbeat or dpkg-query or ansible-playbook or gpgv or apt or apt-get) or
process.parent.command_line:"runc init"
)
'''
[[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"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"
Stages and Predicates
Stage 1: new_terms
event.category:process and host.os.type:linux and event.type:start and event.action:exec and
process.entry_leader.entry_meta.type:container and process.interactive:true and
process.name:(sh or bash or dash or tcsh or csh or zsh or ksh or fish) and
not (
process.parent.name:(dpkg or runc or tini or frontend or elastic-agent or agentbeat or dpkg-query or ansible-playbook or gpgv or apt or apt-get) or
process.parent.command_line:"runc init"
)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.command_line | eq | runc init | excludes:process.parent.command_line field:"process.parent.command_line" value:"runc init" |
process.parent.name | in | agentbeat, ansible-playbook, apt, apt-get, dpkg, dpkg-query, elastic-agent, frontend, gpgv, runc, tini | excludes:process.parent.name |
M365 Exchange Email Safe Attachment Rule Disabled
#Identifies when a safe attachment rule is disabled in Microsoft 365. Safe attachment rules can extend malware protections to include routing all messages and attachments without a known malware signature to a special hypervisor environment. An adversary or insider threat may disable a safe attachment rule to exfiltrate data or evade defenses.
Known False Positives
- A safe attachment rule may be disabled by a system or network administrator. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | Exchange audit operation Disable-SafeAttachmentRule: Federated domain added |
Rule Body
[metadata]
creation_date = "2020/11/19"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies when a safe attachment rule is disabled in Microsoft 365. Safe attachment rules can extend malware
protections to include routing all messages and attachments without a known malware signature to a special hypervisor
environment. An adversary or insider threat may disable a safe attachment rule to exfiltrate data or evade defenses.
"""
false_positives = [
"""
A safe attachment rule may be disabled by a system or network administrator. Verify that the configuration change
was expected. Exceptions can be added to this rule to filter expected behavior.
""",
]
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Email Safe Attachment Rule Disabled"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating M365 Exchange Email Safe Attachment Rule Disabled
Microsoft 365's Safe Attachment feature enhances security by analyzing email attachments in a secure environment to detect unknown malware. Disabling this rule can expose organizations to threats by allowing potentially harmful attachments to bypass scrutiny. Adversaries may exploit this to exfiltrate data or avoid detection. The detection rule monitors audit logs for successful attempts to disable this feature, signaling potential defense evasion activities.
### Possible investigation steps
- Review the audit logs for the specific event.action "Disable-SafeAttachmentRule" to identify the user or account responsible for the action.
- Check the event.outcome field to confirm the success of the rule being disabled and gather additional context from related logs around the same timestamp.
- Investigate the event.provider "Exchange" to determine if there are any other recent suspicious activities or changes made by the same user or account.
- Assess the event.category "web" to understand if there were any web-based interactions or anomalies that coincide with the disabling of the safe attachment rule.
- Evaluate the risk score and severity to prioritize the investigation and determine if immediate action is required to mitigate potential threats.
- Cross-reference the identified user or account with known insider threat indicators or previous security incidents to assess the likelihood of malicious intent.
### False positive analysis
- Routine administrative changes can trigger alerts when IT staff disable Safe Attachment rules for legitimate reasons, such as testing or maintenance. To manage this, create exceptions for known administrative accounts or scheduled maintenance windows.
- Automated scripts or third-party tools used for email management might disable Safe Attachment rules as part of their operations. Identify these tools and exclude their actions from triggering alerts by whitelisting their associated accounts or IP addresses.
- Changes in organizational policy or security configurations might necessitate temporary disabling of Safe Attachment rules. Document these policy changes and adjust the monitoring rules to account for these temporary exceptions.
- Training or onboarding sessions for new IT staff might involve disabling Safe Attachment rules as part of learning exercises. Ensure these activities are logged and excluded from alerts by setting up temporary exceptions for training periods.
### Response and remediation
- Immediately re-enable the Safe Attachment Rule in Microsoft 365 to restore the security posture and prevent further exposure to potentially harmful attachments.
- Conduct a thorough review of recent email logs and quarantine any suspicious attachments that were delivered during the period the rule was disabled.
- Isolate any systems or accounts that interacted with suspicious attachments to prevent potential malware spread or data exfiltration.
- Escalate the incident to the security operations team for further investigation and to determine if there was any unauthorized access or data compromise.
- Implement additional monitoring on the affected accounts and systems to detect any signs of ongoing or further malicious activity.
- Review and update access controls and permissions to ensure that only authorized personnel can modify security rules and configurations.
- Conduct a post-incident analysis to identify the root cause and implement measures to prevent similar incidents, such as enhancing alerting mechanisms for critical security rule changes.
## Setup
The Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
references = [
"https://docs.microsoft.com/en-us/powershell/module/exchange/disable-safeattachmentrule?view=exchange-ps",
]
risk_score = 21
rule_id = "03024bd9-d23f-4ec1-8674-3cf1a21e130b"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: Microsoft 365",
"Use Case: Configuration Audit",
"Tactic: Defense Evasion",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"Disable-SafeAttachmentRule" and event.outcome:success
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: query
data_stream.dataset:o365.audit and event.provider:Exchange and event.category:web and event.action:"Disable-SafeAttachmentRule" and event.outcome:success
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"o365.audit" |
event.action | eq |
| field:"EventType" kind:eq value:"Disable-SafeAttachmentRule" |
event.category | eq |
| field:"event.category" kind:eq value:"web" |
event.outcome | eq |
| field:"event.outcome" kind:eq value:"success" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"Exchange" |
M365 Identity Login from Atypical Region
#Detects successful Microsoft 365 portal logins from a country and region the user has not previously authenticated from in a specific time window. Atypical regions are identified by combining the user's country and region geolocation history; an authentication from a new country/region pair for that user may indicate an adversary attempting to access the account from an unusual location or behind a VPN.
Known False Positives
- False positives may occur when users are using a VPN or when users are traveling to different locations"
- Mobile access may also result in false positives, as users may log in from various locations while on the go.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Microsoft 365 | UserLoggedIn |
Rules Detecting the Same Action
These rules filter on the same operation.
Rule Body
[metadata]
creation_date = "2024/09/04"
integration = ["o365"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Detects successful Microsoft 365 portal logins from a country and region the user has not previously authenticated
from in a specific time window. Atypical regions are identified by combining the user's country and region geolocation history; an
authentication from a new country/region pair for that user may indicate an adversary attempting to access the
account from an unusual location or behind a VPN.
"""
false_positives = [
"""
False positives may occur when users are using a VPN or when users are traveling to different locations"
""",
"""
Mobile access may also result in false positives, as users may log in from various locations while on the go.
""",
]
from = "now-15m"
index = ["logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Identity Login from Atypical Region"
note = """## Triage and analysis
### Investigating M365 Identity Login from Atypical Region
Microsoft 365 is a cloud-based suite offering productivity tools accessible from anywhere, making it crucial for business operations. Adversaries may exploit this by logging in from uncommon regions, potentially using VPNs to mask their origin. The detection rule identifies successful logins from atypical country/region pairs for a given user, flagging potential unauthorized access attempts by analyzing login events and user location patterns at country and region granularity.
### Possible investigation steps
- Review the user associated with these sign-ins to determine if the login attempt was legitimate or if further investigation is needed.
- Analyze the geographic locations of the logins to identify any patterns or anomalies that may indicate malicious activity.
- Review the ISP information for the login attempts to identify any unusual or suspicious providers.
- Review the authorization request type to understand the context of the login attempts and whether they align with the user's typical behavior.
- Analyze the client application used for the login attempts to determine if it is consistent with the user's normal usage patterns (Teams, Office, etc.)
- Analyze the user-agent associated with the login attempts to identify any unusual or suspicious patterns. These could also indicate mobile and endpoint logins causing false-positives.
### False positive analysis
- Users traveling or using VPNs may trigger this alert. Verify with the user if they were traveling or using a VPN at the time of the login attempt.
- Mobile access may also result in false positives, as users may log in from various locations while on the go.
### Response and remediation
- Investigate the login attempt further by checking for any additional context or related events that may provide insight into the user's behavior.
- If the login attempt is deemed suspicious, consider implementing additional security measures, such as requiring multi-factor authentication (MFA) for logins from unusual locations.
- Educate users about the risks of accessing corporate resources from unfamiliar locations and the importance of using secure connections (e.g., VPNs) when doing so.
- Monitor for any subsequent login attempts from the same location or IP address to identify potential patterns of malicious activity.
- Consider adding exceptions to this rule for the user or source application ID if the login attempts are determined to be legitimate and not a security concern.
"""
references = ["https://www.huntress.com/blog/time-travelers-busted-how-to-detect-impossible-travel-"]
risk_score = 47
rule_id = "32d3ad0e-6add-11ef-8c7b-f661ea17fbcc"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Use Case: Threat Detection",
"Use Case: Identity and Access Audit",
"Tactic: Initial Access",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset:o365.audit and
event.provider:AzureActiveDirectory and
event.action:UserLoggedIn and event.outcome:success and
o365.audit.Target.Type:(0 or 2 or 3 or 5 or 6 or 10) and
o365.audit.UserId:(* and not "Not Available") and
source.geo.country_name:* and
source.geo.region_name:* and
o365.audit.ApplicationId:(* and not (
08e18876-6177-487e-b8b5-cf950c1e598c or
29d9ed98-a469-4536-ade2-f981bc1d605e or
38aa3b87-a06d-4817-b275-7a316988d93b or
3e62f81e-590b-425b-9531-cad6683656cf or
a809996b-059e-42e2-9866-db24b99a9782 or
d7b530a4-7680-4c23-a8bf-c52c121d2e87
)) and
o365.audit.ExtendedProperties.RequestType:(* and not (
"Consent:Set" or
"DeviceAuth:ReprocessTls" or
"Federation:oauth2claimsprovider" or
"Federation:oauth2msa" or
"Kmsi:kmsi" or
"Login:reprocess" or
"Login:resume" or
"MessagePrompt:MessagePrompt" or
"OrgIdWsFederation:federation" or
"PermitSso:PermitSso" or
"SAS:EndAuth" or
"SAS:ProcessAuth" or
"SSPR:end" or
"Saml2:processrequest" or
"WsFederation:wsfederation"
)) and
not user_agent.original:(*Android* or *PKeyAuth* or *WebView* or *iPad* or *iPhone*)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.investigation_fields]
field_names = [
"@timestamp",
"organization.id",
"o365.audit.UserId",
"o365.audit.ActorIpAddress",
"o365.audit.ApplicationId",
"o365.audit.ExtendedProperties.RequestType",
"o365.audit.Target.ID",
"source.geo.country_name",
"source.geo.region_name",
]
[rule.new_terms]
field = "new_terms_fields"
value = ["o365.audit.UserId", "source.geo.country_name", "source.geo.region_name"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"
Stages and Predicates
Stage 1: new_terms
data_stream.dataset:o365.audit and
event.provider:AzureActiveDirectory and
event.action:UserLoggedIn and event.outcome:success and
o365.audit.Target.Type:(0 or 2 or 3 or 5 or 6 or 10) and
o365.audit.UserId:(* and not "Not Available") and
source.geo.country_name:* and
source.geo.region_name:* and
o365.audit.ApplicationId:(* and not (
08e18876-6177-487e-b8b5-cf950c1e598c or
29d9ed98-a469-4536-ade2-f981bc1d605e or
38aa3b87-a06d-4817-b275-7a316988d93b or
3e62f81e-590b-425b-9531-cad6683656cf or
a809996b-059e-42e2-9866-db24b99a9782 or
d7b530a4-7680-4c23-a8bf-c52c121d2e87
)) and
o365.audit.ExtendedProperties.RequestType:(* and not (
"Consent:Set" or
"DeviceAuth:ReprocessTls" or
"Federation:oauth2claimsprovider" or
"Federation:oauth2msa" or
"Kmsi:kmsi" or
"Login:reprocess" or
"Login:resume" or
"MessagePrompt:MessagePrompt" or
"OrgIdWsFederation:federation" or
"PermitSso:PermitSso" or
"SAS:EndAuth" or
"SAS:ProcessAuth" or
"SSPR:end" or
"Saml2:processrequest" or
"WsFederation:wsfederation"
)) and
not user_agent.original:(*Android* or *PKeyAuth* or *WebView* or *iPad* or *iPhone*)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user_agent.original | match | Android | excludes:user_agent.original field:"user_agent.original" value:"Android" |
user_agent.original | match | PKeyAuth | excludes:user_agent.original field:"user_agent.original" value:"PKeyAuth" |
user_agent.original | match | WebView | excludes:user_agent.original field:"user_agent.original" value:"WebView" |
user_agent.original | match | iPad | excludes:user_agent.original field:"user_agent.original" value:"iPad" |
user_agent.original | match | iPhone | excludes:user_agent.original field:"user_agent.original" value:"iPhone" |
o365.audit.ApplicationId | in | 08e18876-6177-487e-b8b5-cf950c1e598c, 29d9ed98-a469-4536-ade2-f981bc1d605e, 38aa3b87-a06d-4817-b275-7a316988d93b, 3e62f81e-590b-425b-9531-cad6683656cf, a809996b-059e-42e2-9866-db24b99a9782, d7b530a4-7680-4c23-a8bf-c52c121d2e87 | excludes:o365.audit.ApplicationId |
o365.audit.ExtendedProperties.RequestType | in | Consent:Set, DeviceAuth:ReprocessTls, Federation:oauth2claimsprovider, Federation:oauth2msa, Kmsi:kmsi, Login:reprocess, Login:resume, MessagePrompt:MessagePrompt, OrgIdWsFederation:federation, PermitSso:PermitSso, SAS:EndAuth, SAS:ProcessAuth, SSPR:end, Saml2:processrequest, WsFederation:wsfederation | excludes:o365.audit.ExtendedProperties.RequestType |
o365.audit.UserId | eq | Not Available | excludes:o365.audit.UserId field:"o365.audit.UserId" value:"Not Available" |
M365 Purview DLP Signal
#Identifies Microsoft 365 Data Loss Prevention (DLP) and Data Lifecycle Management (DLM) signals from Microsoft Purview across Exchange, SharePoint, OneDrive, and endpoint devices. These events indicate potential data exfiltration attempts, policy violations involving sensitive data, or unauthorized sharing of classified information. This building block rule generates security events for correlation, threat hunting, and telemetry collection to support detection of collection and exfiltration activities.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Collection | |
| Exfiltration |
Telemetry Coverage
Rule Body
[metadata]
bypass_bbr_timing = true
creation_date = "2026/02/20"
integration = ["o365"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies Microsoft 365 Data Loss Prevention (DLP) and Data Lifecycle Management (DLM) signals from Microsoft Purview
across Exchange, SharePoint, OneDrive, and endpoint devices. These events indicate potential data exfiltration attempts,
policy violations involving sensitive data, or unauthorized sharing of classified information. This building block rule
generates security events for correlation, threat hunting, and telemetry collection to support detection of collection
and exfiltration activities.
"""
from = "now-9m"
index = ["logs-o365.audit-*", "filebeat-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Purview DLP Signal"
references = [
"https://learn.microsoft.com/en-us/purview/dlp-learn-about-dlp",
"https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema#enum-auditlogrecordtype---type-edmint32",
]
risk_score = 21
rule_id = "b8f54e38-7a1d-4c9b-9e2f-3a4b5c6d7e8f"
setup = """### Additional notes
For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
"""
severity = "low"
tags = [
"Domain: Cloud",
"Domain: SaaS",
"Data Source: Microsoft 365",
"Data Source: Microsoft 365 Audit Logs",
"Data Source: Microsoft Purview",
"Data Source: Microsoft Purview DLP",
"Use Case: Threat Detection",
"Use Case: Data Protection",
"Tactic: Collection",
"Tactic: Exfiltration",
"Rule Type: BBR",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.dataset:o365.audit and
event.code:(ComplianceDLPSharePoint or ComplianceDLPExchange or ComplianceDLPSharePointClassification or DLPEndpoint or ComplianceDLPExchangeClassification or ComplianceDLMExchange or ComplianceDLMSharePoint)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"
[[rule.threat.technique]]
id = "T1114"
name = "Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/"
[[rule.threat.technique]]
id = "T1530"
name = "Data from Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1530/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1567"
name = "Exfiltration Over Web Service"
reference = "https://attack.mitre.org/techniques/T1567/"
[[rule.threat.technique.subtechnique]]
id = "T1567.002"
name = "Exfiltration to Cloud Storage"
reference = "https://attack.mitre.org/techniques/T1567/002/"
[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"
Stages and Predicates
Stage 1: query
event.dataset:o365.audit and
event.code:(ComplianceDLPSharePoint or ComplianceDLPExchange or ComplianceDLPSharePointClassification or DLPEndpoint or ComplianceDLPExchangeClassification or ComplianceDLMExchange or ComplianceDLMSharePoint)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.code | in |
| field:"EventID" kind:in |
event.dataset | eq |
| field:"event.dataset" kind:eq value:"o365.audit" |
Manual Memory Dumping via Proc Filesystem
#This rule monitors for manual memory dumping via the proc filesystem. The proc filesystem in Linux provides a virtual filesystem that contains information about system processes and their memory mappings. Attackers may use this technique to dump the memory of a process, potentially extracting sensitive information such as credentials or encryption keys.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access | |
| Collection |
Rule Body
[metadata]
creation_date = "2025/04/25"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule monitors for manual memory dumping via the proc filesystem. The proc filesystem in Linux provides a virtual filesystem
that contains information about system processes and their memory mappings. Attackers may use this technique to dump the memory
of a process, potentially extracting sensitive information such as credentials or encryption keys.
"""
from = "now-9m"
index = [
"auditbeat-*",
"endgame-*",
"logs-auditd_manager.auditd-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Manual Memory Dumping via Proc Filesystem"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Manual Memory Dumping via Proc Filesystem
The proc filesystem in Linux is a virtual interface providing detailed insights into system processes and their memory. Adversaries exploit this by manually dumping memory from processes to extract sensitive data like credentials. The detection rule identifies suspicious activities by monitoring process executions that access memory files within the proc directory, flagging potential credential access attempts.
### Possible investigation steps
- Review the alert details to identify the specific process name and command line that triggered the rule, focusing on processes like "cat", "grep", "tail", "less", "more", "egrep", or "fgrep" accessing "/proc/*/mem".
- Examine the process execution context, including the parent process and user account associated with the suspicious activity, to determine if the activity is expected or potentially malicious.
- Check the system logs and historical data for any previous occurrences of similar activities involving the same process names and command lines to assess if this is part of a pattern or anomaly.
- Investigate the user account's recent activities and permissions to determine if there are any signs of compromise or unauthorized access that could explain the memory dumping attempt.
- Analyze network traffic and connections from the host to identify any potential data exfiltration attempts or communications with known malicious IP addresses or domains.
- If necessary, isolate the affected system to prevent further potential data leakage and conduct a deeper forensic analysis to uncover any additional indicators of compromise.
### False positive analysis
- System administrators or automated scripts may legitimately access the proc filesystem for monitoring or debugging purposes. To handle this, identify and whitelist known scripts or administrative tools that frequently access memory files.
- Security tools or monitoring solutions might access the proc filesystem as part of their regular operations. Review and exclude these processes from the rule to prevent unnecessary alerts.
- Developers or testers might use commands like cat or grep on proc files during application debugging. Establish a list of approved users or groups who are allowed to perform these actions and exclude their activities from triggering alerts.
- Backup or system maintenance processes could involve accessing proc files. Document these processes and create exceptions for them to avoid false positives.
- Regular system health checks might involve accessing memory files. Identify these checks and configure the rule to ignore them by specifying the associated process names or command patterns.
### Response and remediation
- Immediately isolate the affected system to prevent further unauthorized access or data exfiltration. Disconnect the network connection and disable remote access capabilities.
- Terminate any suspicious processes identified by the detection rule, specifically those accessing memory files within the proc directory using commands like "cat", "grep", "tail", "less", "more", "egrep", or "fgrep".
- Conduct a memory analysis on the isolated system to identify any extracted sensitive data, such as credentials or encryption keys, and assess the extent of the compromise.
- Change all potentially compromised credentials and encryption keys immediately, prioritizing those associated with critical systems and services.
- Review and enhance system logging and monitoring configurations to ensure comprehensive visibility into process activities, particularly those involving the proc filesystem.
- Escalate the incident to the security operations center (SOC) or relevant cybersecurity team for further investigation and to determine if the threat is part of a larger attack campaign.
- Implement additional security controls, such as restricting access to the proc filesystem and employing application whitelisting, to prevent unauthorized memory dumping activities in the future.
"""
risk_score = 73
rule_id = "6505e02e-28dd-41cd-b18f-64e649caa4e2"
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: Credential Access",
"Use Case: Vulnerability",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
"Data Source: Elastic Endgame",
"Data Source: Auditd Manager",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("cat", "grep", "tail", "less", "more", "egrep", "fgrep") and process.command_line like "/proc/*/mem"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[rule.threat.technique.subtechnique]]
id = "T1003.007"
name = "Proc Filesystem"
reference = "https://attack.mitre.org/techniques/T1003/007/"
[[rule.threat.technique]]
id = "T1212"
name = "Exploitation for Credential Access"
reference = "https://attack.mitre.org/techniques/T1212/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1005"
name = "Data from Local System"
reference = "https://attack.mitre.org/techniques/T1005/"
[rule.threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("cat", "grep", "tail", "less", "more", "egrep", "fgrep") and process.command_line like "/proc/*/mem"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"/proc/*/mem" |
process.name | in |
| field:"process_basename" kind:in |
Process Suspended via TTD Monitor Driver
#Identifies unsigned code calling an IOCTL in the TTD Monitor kernel driver to suspend a specific process by PID. Adversaries may abuse this driver to tamper with endpoint security solutions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies unsigned code calling an IOCTL in the TTD Monitor kernel driver to suspend a specific process by PID.
Adversaries may abuse this driver to tamper with endpoint security solutions.
"""
id = "4953d091-dd91-4380-9531-e373a5bfffaf"
license = "Elastic License v2"
name = "Process Suspended via TTD Monitor Driver"
os_list = ["windows"]
reference = [
"https://www.sentinelone.com/labs/fin7-reboot-cybercrime-gang-enhances-ops-with-new-edr-bypasses-and-automated-attacks/",
]
version = "1.0.3"
query = '''
api where
process.Ext.api.name == "DeviceIoControl" and
process.Ext.api.parameters.device : "\\Device\\com_microsoft_idna_ProcLaunchMon" and
/* IOCTL 0x228034 to suspend a PID */
process.Ext.api.parameters.io_control_code == 2261044 and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true)
'''
min_endpoint_version = "8.14.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/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.0"
Stages and Predicates
Stage 1: api
api where
process.Ext.api.name == "DeviceIoControl" and
process.Ext.api.parameters.device : "\\Device\\com_microsoft_idna_ProcLaunchMon" and
process.Ext.api.parameters.io_control_code == 2261044 and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"DeviceIoControl" |
process.Ext.api.parameters.device | wildcard |
| field:"process.Ext.api.parameters.device" kind:wildcard value:"\Device\com_microsoft_idna_ProcLaunchMon" |
process.Ext.api.parameters.io_control_code | eq |
| field:"process.Ext.api.parameters.io_control_code" kind:eq value:"2261044" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature |
Shadow File Modification by Unusual Process
#This rule monitors for Linux Shadow file modifications. These modifications are indicative of a potential password change or user addition event. Threat actors may attempt to create new users or change the password of a user account to maintain access to a system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2024/07/05"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule monitors for Linux Shadow file modifications. These modifications are indicative of a potential password
change or user addition event. Threat actors may attempt to create new users or change the password of a user account to
maintain access to a system.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
language = "eql"
license = "Elastic License v2"
name = "Shadow File Modification by Unusual Process"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Shadow File Modification by Unusual Process
The Linux shadow file is crucial for storing hashed user passwords, ensuring system security. Adversaries may exploit this by altering the file to add users or change passwords, thus gaining unauthorized access or maintaining persistence. The detection rule identifies suspicious modifications by monitoring changes and renames of the shadow file, flagging potential unauthorized access attempts for further investigation.
### Possible investigation steps
- Review the alert details to confirm the event type is "change" and the action is "rename" for the file path "/etc/shadow".
- Check the file.Ext.original.path to identify the original location of the shadow file before the rename event.
- Investigate recent user account changes or additions by examining system logs and user management commands executed around the time of the alert.
- Analyze the history of commands executed by users with elevated privileges to identify any unauthorized or suspicious activities.
- Correlate the event with other security alerts or logs to determine if there are additional indicators of compromise or persistence tactics being employed.
- Verify the integrity of the shadow file by comparing its current state with a known good backup to detect unauthorized modifications.
### False positive analysis
- System updates or package installations may trigger legitimate changes to the shadow file. Users can create exceptions for known update processes or package managers to prevent these from being flagged.
- Administrative tasks performed by authorized personnel, such as password changes or user management, can also result in shadow file modifications. Implementing a whitelist for specific user accounts or processes that are known to perform these tasks can reduce false positives.
- Backup or restoration processes that involve the shadow file might cause rename events. Users should identify and exclude these processes if they are part of regular system maintenance.
- Automated scripts or configuration management tools that manage user accounts could lead to expected changes in the shadow file. Users should ensure these tools are recognized and excluded from triggering alerts.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Verify the integrity of the /etc/shadow file by comparing it with a known good backup to identify unauthorized changes or additions.
- Reset passwords for all user accounts on the affected system, ensuring the use of strong, unique passwords to mitigate the risk of compromised credentials.
- Review and remove any unauthorized user accounts that may have been added to the system, ensuring that only legitimate users have access.
- Conduct a thorough audit of system logs and user activity to identify any additional signs of compromise or persistence mechanisms employed by the threat actor.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may be affected.
- Implement enhanced monitoring and alerting for future modifications to the /etc/shadow file to quickly detect and respond to similar threats."""
references = ["https://www.elastic.co/security-labs/primer-on-persistence-mechanisms"]
risk_score = 21
rule_id = "cdf1a39b-1ca5-4e2a-9739-17fc4d026029"
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 to select "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in New agent policy name. If other agent policies already exist, you can click the Existing hosts tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click Save and Continue.
- To complete the integration, select Add Elastic Agent to your hosts and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Privilege Escalation",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "change" and event.action == "rename" and
file.path == "/etc/shadow" and file.Ext.original.path != null and
not (
file.Ext.original.name in ("shadow+", "nshadow") or
process.name in (
"usermod", "useradd", "passwd", "chage", "systemd-sysusers", "chpasswd", "userdel", "adduser", "update-passwd", "perl"
) or
process.executable like "/usr/libexec/platform-python*" or
process.executable in (
"/usr/bin/containerd", "/usr/bin/dnf", "/usr/bin/yum", "/bin/dnf", "./usr/bin/qemu-aarch64-static",
"/usr/local/cpanel/whostmgr/bin/xml-api", "/usr/local/cpanel/whostmgr/bin/whostmgr5",
"/usr/local/cpanel/bin/admin/Cpanel/security"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique]]
id = "T1136"
name = "Create Account"
reference = "https://attack.mitre.org/techniques/T1136/"
[[rule.threat.technique.subtechnique]]
id = "T1136.001"
name = "Local Account"
reference = "https://attack.mitre.org/techniques/T1136/001/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: file
file where host.os.type == "linux" and event.type == "change" and event.action == "rename" and
file.path == "/etc/shadow" and file.Ext.original.path != null and
not (
file.Ext.original.name in ("shadow+", "nshadow") or
process.name in (
"usermod", "useradd", "passwd", "chage", "systemd-sysusers", "chpasswd", "userdel", "adduser", "update-passwd", "perl"
) or
process.executable like "/usr/libexec/platform-python*" or
process.executable in (
"/usr/bin/containerd", "/usr/bin/dnf", "/usr/bin/yum", "/bin/dnf", "./usr/bin/qemu-aarch64-static",
"/usr/local/cpanel/whostmgr/bin/xml-api", "/usr/local/cpanel/whostmgr/bin/whostmgr5",
"/usr/local/cpanel/bin/admin/Cpanel/security"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"rename" |
event.type | eq |
| field:"event.type" kind:eq value:"change" |
file.Ext.original.path | is_not_null | field:"file.Ext.original.path" kind:is_not_null | |
file.path | eq |
| field:"TargetFilename" kind:eq value:"/etc/shadow" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.Ext.original.name | in | nshadow, shadow+ | excludes:file.Ext.original.name field:"file.Ext.original.name" value:"nshadow" field:"file.Ext.original.name" value:"shadow+" |
process.executable | in | ./usr/bin/qemu-aarch64-static, /bin/dnf, /usr/bin/containerd, /usr/bin/dnf, /usr/bin/yum, /usr/local/cpanel/bin/admin/Cpanel/security, /usr/local/cpanel/whostmgr/bin/whostmgr5, /usr/local/cpanel/whostmgr/bin/xml-api | excludes:process.executable |
process.executable | starts_with | /usr/libexec/platform-python | excludes:process.executable field:"process.executable" value:"/usr/libexec/platform-python" |
process.name | in | adduser, chage, chpasswd, passwd, perl, systemd-sysusers, update-passwd, useradd, userdel, usermod | excludes:process.name |
Spike in Privileged Command Execution by a User
#A machine learning job has detected an increase in the execution of privileged commands by a user, suggesting potential privileged access activity. This may indicate an attempt by the user to gain unauthorized access to sensitive or restricted parts of the system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2025/02/18"
integration = ["pad", "endpoint", "sysmon_linux"]
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 an increase in the execution of privileged commands by a user, suggesting potential
privileged access activity. This may indicate an attempt by the user to gain unauthorized access to sensitive or
restricted parts of the system.
"""
from = "now-3h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_linux_high_count_privileged_process_events_by_user_ea"
name = "Spike in Privileged Command Execution by a User"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Spike in Privileged Command Execution by a User
Machine learning models are employed to monitor and analyze user behavior, specifically focusing on the execution of privileged commands. These models identify anomalies that may suggest unauthorized access attempts. Adversaries often exploit valid accounts to escalate privileges and access sensitive systems. The detection rule leverages ML to flag unusual spikes in command execution, indicating potential misuse of privileged access.
### Possible investigation steps
- Review the specific user account associated with the spike in privileged command execution to determine if the activity aligns with their typical behavior or job role.
- Analyze the timeline of the command execution spike to identify any patterns or specific times when the activity occurred, which may correlate with known maintenance windows or unusual access times.
- Cross-reference the commands executed with known privileged command lists to assess whether the commands are typical for the user's role or indicative of potential misuse.
- Check for any recent changes in the user's access rights or group memberships that might explain the increase in privileged command execution.
- Investigate any recent login activity for the user, including source IP addresses and devices, to identify any anomalies or unauthorized access attempts.
- Review any associated alerts or logs for the same user or system around the time of the spike to gather additional context or corroborating evidence of potential unauthorized access.
### False positive analysis
- Routine administrative tasks by IT staff may trigger the rule. To manage this, create exceptions for known maintenance windows or specific user accounts that regularly perform these tasks.
- Automated scripts or scheduled jobs that execute privileged commands can be mistaken for anomalies. Identify and whitelist these scripts or jobs to prevent false alerts.
- Users with newly assigned roles that require elevated privileges might cause a temporary spike in command execution. Monitor these users initially and adjust the model's sensitivity or add exceptions as needed.
- Software updates or installations that require elevated permissions can lead to false positives. Document these events and exclude them from the anomaly detection criteria.
- Training or onboarding sessions where users are learning to use new systems with privileged access can result in increased command execution. Temporarily adjust thresholds or exclude these users during the training period.
### Response and remediation
- Immediately isolate the affected user account to prevent further execution of privileged commands. This can be done by disabling the account or changing its password.
- Review recent privileged command execution logs to identify any unauthorized or suspicious activities performed by the user. Focus on commands that could alter system configurations or access sensitive data.
- Conduct a thorough investigation to determine if the user's credentials have been compromised. This may involve checking for signs of phishing attacks or unauthorized access from unusual locations or devices.
- If unauthorized access is confirmed, reset the affected user's credentials and any other accounts that may have been accessed using the compromised credentials.
- Notify the security team and relevant stakeholders about the incident, providing details of the detected anomaly and actions taken so far.
- Implement additional monitoring on the affected systems and user accounts to detect any further suspicious activities or attempts to regain unauthorized access.
- Review and update access controls and permissions to ensure that users have the minimum necessary privileges, reducing the risk of privilege escalation in the future."""
references = [
"https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
"https://docs.elastic.co/en/integrations/pad",
]
risk_score = 21
rule_id = "bd1eadf6-3ac6-4e66-91aa-4a1e6711915f"
setup = """## Setup
The rule requires the Privileged Access Detection integration assets to be installed, as well as Linux logs collected by integrations such as Elastic Defend and Sysmon Linux.
### Privileged Access Detection Setup
The Privileged Access Detection integration detects privileged access activity by identifying abnormalities in Windows, Linux and Okta events. Anomalies are detected using Elastic's Anomaly Detection feature.
#### Prerequisite Requirements:
- Fleet is required for Privileged Access Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Linux events collected by [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint) or [Sysmon Linux](https://docs.elastic.co/en/integrations/sysmon_linux) integration.
- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
- To add Sysmon Linux integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.
#### The following steps should be executed to install assets associated with the Privileged Access Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Privileged Access Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Data Source: Linux Sysmon Logs",
"Use Case: Privileged Access Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Privilege Escalation",
"Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
SSL Certificate Deletion
#This rule detects the deletion of SSL certificates on a Linux system. Adversaries may delete SSL certificates to subvert trust controls and negatively impact the system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Defense Impairment | |
| Impact |
Rule Body
[metadata]
creation_date = "2024/08/28"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/12/18"
[rule]
author = ["Elastic"]
description = """
This rule detects the deletion of SSL certificates on a Linux system. Adversaries may delete SSL certificates to subvert
trust controls and negatively impact the system.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "SSL Certificate Deletion"
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 SSL Certificate Deletion
SSL certificates are crucial for establishing secure communications in Linux environments. Adversaries may delete these certificates to undermine trust and disrupt system operations, often as part of defense evasion tactics. The detection rule identifies suspicious deletions by monitoring specific directories for certificate files, excluding benign processes, thus highlighting potential malicious activity.
### Possible investigation steps
- Review the alert details to confirm the file path and extension of the deleted SSL certificate, ensuring it matches the pattern "/etc/ssl/certs/*" with extensions "pem" or "crt".
- Identify the process responsible for the deletion by examining the process name and compare it against the exclusion list (e.g., "dockerd", "pacman") to determine if the process is potentially malicious.
- Investigate the user account associated with the process that performed the deletion to assess if the account has a history of suspicious activity or unauthorized access.
- Check system logs and audit trails around the time of the deletion event to identify any related activities or anomalies that could indicate a broader attack or compromise.
- Assess the impact of the certificate deletion on system operations and security, including any disruptions to secure communications or trust relationships.
- If the deletion is deemed suspicious, consider restoring the deleted certificate from backups and implementing additional monitoring to detect further unauthorized deletions.
### False positive analysis
- Routine system updates or package installations may trigger certificate deletions. Exclude processes like package managers or update services that are known to perform these actions.
- Automated certificate renewal services might delete old certificates as part of their renewal process. Identify and exclude these services to prevent false alerts.
- Custom scripts or maintenance tasks that manage SSL certificates could be flagged. Review and whitelist these scripts if they are verified as non-malicious.
- Backup or cleanup operations that involve certificate files might cause false positives. Ensure these operations are recognized and excluded from monitoring.
- Development or testing environments where certificates are frequently added and removed can generate alerts. Consider excluding these environments if they are isolated and secure.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or damage.
- Verify the deletion of SSL certificates by checking the specified directories and confirm the absence of expected certificate files.
- Restore deleted SSL certificates from a secure backup to re-establish secure communications and trust controls.
- Conduct a thorough review of system logs and process activity to identify the source of the deletion and any associated malicious activity.
- Escalate the incident to the security operations 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 further unauthorized deletions or related suspicious activities.
- Review and update access controls and permissions to ensure only authorized processes and users can modify or delete SSL certificates."""
risk_score = 21
rule_id = "7957f3b9-f590-4062-b9f9-003c32bfc7d6"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Tactic: Impact",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "deletion" and process.executable != null and
file.path : "/etc/ssl/certs/*" and file.extension in ("pem", "crt") and
not (
process.name in ("dockerd", "pacman") or
process.executable in (
"/kaniko/executor", "/usr/sbin/update-ca-certificates", "/usr/bin/gnurm", "/usr/bin/podman",
"/usr/local/bin/executor", "/opt/kaniko/executor", "/.envbuilder/bin/envbuilder", "/opt/kaspersky/kesl/libexec/kesl"
)
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[rule.threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"
[[rule.threat.technique]]
id = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"
[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 = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
Stages and Predicates
Stage 1: file
file where host.os.type == "linux" and event.type == "deletion" and process.executable != null and
file.path : "/etc/ssl/certs/*" and file.extension in ("pem", "crt") and
not (
process.name in ("dockerd", "pacman") or
process.executable in (
"/kaniko/executor", "/usr/sbin/update-ca-certificates", "/usr/bin/gnurm", "/usr/bin/podman",
"/usr/local/bin/executor", "/opt/kaniko/executor", "/.envbuilder/bin/envbuilder", "/opt/kaspersky/kesl/libexec/kesl"
)
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"deletion" |
file.extension | in |
| field:"file.extension" kind:in |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"/etc/ssl/certs/*" |
process.executable | is_not_null | field:"Image" kind:is_not_null |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | in | /.envbuilder/bin/envbuilder, /kaniko/executor, /opt/kaniko/executor, /opt/kaspersky/kesl/libexec/kesl, /usr/bin/gnurm, /usr/bin/podman, /usr/local/bin/executor, /usr/sbin/update-ca-certificates | excludes:process.executable |
process.name | in | dockerd, pacman | excludes:process.name field:"process.name" value:"dockerd" field:"process.name" value:"pacman" |
Suspicious File Creation via Web Server
#This rule detects suspicious file uploads to web servers. Attackers may exploit RCE or file upload vulnerabilities to upload malicious files to web servers to gain/maintain access and to establish a command and control channel.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects suspicious file uploads to web servers. Attackers may exploit RCE or file upload vulnerabilities to
upload malicious files to web servers to gain/maintain access and to establish a command and control channel.
"""
id = "a67ef648-f04e-475c-8f53-a2db038ee834"
license = "Elastic License v2"
name = "Suspicious File Creation via Web Server"
os_list = ["linux"]
version = "1.0.7"
query = '''
sequence by process.entity_id with maxspan=3s
[network where event.type == "start" and event.action == "connection_accepted" and not (
source.ip == null or source.ip == "0.0.0.0" or cidrmatch(
source.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
)
)
]
[file where event.type == "change" and event.action in ("rename", "creation") and
file.extension in ("py", "pl", "rb", "elf", "so", "rs", "lua", "jpeg", "md", "sh", "jsp") and (
user.name in (
"apache", "www-data", "httpd", "nginx", "lighttpd", "tomcat", "tomcat8", "tomcat9", "ftp", "ftpuser", "ftpd"
) or
user.id in (99, 33, 498, 48)
) and (
file.path : ("/var/www/*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*") and
process.name : (
"apache", "nginx", "apache2", "httpd", "lighttpd", "caddy", "php-*", "node", "mongrel_rails", "gunicorn",
"uwsgi", "openresty", "cherokee", "h2o", "resin", "puma", "unicorn", "traefik", "tornado", "hypercorn",
"daphne", "twistd", "yaws", "webfsd", "httpd.worker", "flask", "rails", "mongrel"
)
) or
(process.name : ("ruby*", "perl*", "python*", "java") and file.path : "/var/www/*") and
not (
file.name in (
"config-livewaf.php", "pageviews-busy.php", "attack-data.php", "config-synced.php", "packages.php", "README.txt"
) or
file.name like~ "cookie*.txt" or
file.path like ("/tmp/requestdir/*", "/var/www/html/storage*", "/var/www/*/Cache/*", "/var/www/*/cache/*") or
file.extension like ("log", "*-*-*", "webm") or
process.executable like~ "/root/miniconda3/bin/python*"
)
]
'''
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1505"
name = "Server Software Component"
reference = "https://attack.mitre.org/techniques/T1505/"
[[threat.technique.subtechnique]]
id = "T1505.003"
name = "Web Shell"
reference = "https://attack.mitre.org/techniques/T1505/003/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3s, correlated by process.entity_id.
Stage 1: network
[network where event.type == "start" and event.action == "connection_accepted" and not (
source.ip == null or source.ip == "0.0.0.0" or cidrmatch(
source.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
"FF00::/8"
)
)
]
Stage 2: file
[file where event.type == "change" and event.action in ("rename", "creation") and
file.extension in ("py", "pl", "rb", "elf", "so", "rs", "lua", "jpeg", "md", "sh", "jsp") and (
user.name in (
"apache", "www-data", "httpd", "nginx", "lighttpd", "tomcat", "tomcat8", "tomcat9", "ftp", "ftpuser", "ftpd"
) or
user.id in (99, 33, 498, 48)
) and (
file.path : ("/var/www/*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/root/*", "/home/*") and
process.name : (
"apache", "nginx", "apache2", "httpd", "lighttpd", "caddy", "php-*", "node", "mongrel_rails", "gunicorn",
"uwsgi", "openresty", "cherokee", "h2o", "resin", "puma", "unicorn", "traefik", "tornado", "hypercorn",
"daphne", "twistd", "yaws", "webfsd", "httpd.worker", "flask", "rails", "mongrel"
)
) or
(process.name : ("ruby*", "perl*", "python*", "java") and file.path : "/var/www/*") and
not (
file.name in (
"config-livewaf.php", "pageviews-busy.php", "attack-data.php", "config-synced.php", "packages.php", "README.txt"
) or
file.name like~ "cookie*.txt" or
file.path like ("/tmp/requestdir/*", "/var/www/html/storage*", "/var/www/*/Cache/*", "/var/www/*/cache/*") or
file.extension like ("log", "*-*-*", "webm") or
process.executable like~ "/root/miniconda3/bin/python*"
)
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"connection_accepted" |
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq |
file.extension | in |
| field:"file.extension" kind:in |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
user.id | in |
| field:"user.id" kind:in |
user.name | in |
| field:"user" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
source.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:source.ip |
source.ip | eq | 0.0.0.0 | excludes:source.ip field:"source.ip" value:"0.0.0.0" |
source.ip | is_null | excludes:source.ip |
Suspicious HTML File Creation
#Identifies the execution of a browser process to open an HTML file with high entropy and size. Adversaries may smuggle data and files past content filters by hiding malicious payloads inside of seemingly benign HTML files.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Stealth |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2022/07/03"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies the execution of a browser process to open an HTML file with high entropy and size. Adversaries may smuggle
data and files past content filters by hiding malicious payloads inside of seemingly benign HTML files.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.file-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious HTML File Creation"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Suspicious HTML File Creation
HTML files, typically used for web content, can be exploited by adversaries to smuggle malicious payloads past security filters. By embedding harmful data within seemingly benign HTML files, attackers can bypass traditional defenses. The detection rule identifies such threats by monitoring the creation of HTML files with unusual characteristics, such as high entropy or large size, in common download and temporary directories. It also tracks browser processes that open these files, ensuring that any suspicious activity is flagged for further investigation. This approach helps in identifying potential phishing attempts and other initial access tactics used by attackers.
### Possible investigation steps
- Review the file creation or rename event details to confirm the file extension is .htm or .html and check if the file's entropy is 5 or higher or if the file size is 150,000 bytes or more.
- Verify the file path to ensure it is located in one of the common download or temporary directories specified in the rule, such as "?:\\Users\\*\\Downloads\\*" or "?:\\Users\\*\\AppData\\Local\\Temp\\*".
- Examine the process start event to identify the browser process involved, ensuring it matches one of the specified browsers like chrome.exe or firefox.exe, and check if the process arguments align with the rule's conditions.
- Investigate the user.id associated with the sequence to determine if the activity aligns with the user's typical behavior or if it appears suspicious.
- Check for any recent phishing attempts or suspicious emails received by the user that could have led to the download and execution of the HTML file.
- Analyze the content of the HTML file for any embedded scripts or links that could indicate malicious intent or payload delivery.
### False positive analysis
- Legitimate large HTML files downloaded from trusted sources may trigger the rule. Users can create exceptions for specific trusted domains or file hashes to prevent these from being flagged.
- HTML files generated by certain applications or services, such as email clients or document converters, might have high entropy due to embedded data. Identify these applications and exclude their file creation paths from monitoring.
- Temporary HTML files created during software updates or installations in the AppData or Temp directories can be mistaken for suspicious activity. Monitor and whitelist known update processes to reduce false positives.
- Browser extensions or plugins that save web content locally might create HTML files with characteristics similar to those flagged by the rule. Review and whitelist extensions that are known to be safe and necessary for business operations.
- Automated scripts or tools that process web content and save it as HTML files could be misidentified. Ensure these scripts are documented and their file paths are excluded from the rule's scope.
### Response and remediation
- Isolate the affected system from the network to prevent further spread of the potential threat and to contain any malicious activity.
- Terminate any suspicious browser processes identified in the alert to stop the execution of potentially harmful HTML files.
- Quarantine the suspicious HTML files detected in the specified directories to prevent accidental execution or further access by users.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional threats or malicious payloads.
- Review and analyze the system and network logs to identify any lateral movement or additional compromised systems, escalating findings to the security team for further investigation.
- Restore any affected files or systems from known good backups to ensure the integrity and availability of data and services.
- Implement additional monitoring and alerting for similar activities, focusing on high entropy and large HTML files in common download and temporary directories to enhance detection capabilities.
This rule may have a low to medium performance impact due variety of file paths potentially matching each EQL sequence."""
risk_score = 47
rule_id = "f0493cb4-9b15-43a9-9359-68c23a7f2cf3"
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
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by user.id with maxspan=2m
[file where host.os.type == "windows" and event.action in ("creation", "rename") and
/* Check for HTML files with high entropy and size */
file.extension : ("htm", "html") and ((file.Ext.entropy >= 5 and file.size >= 150000) or file.size >= 1000000) and
/* Check for file paths in common download and temporary directories */
file.path : (
"?:\\Users\\*\\Downloads\\*",
"?:\\Users\\*\\Content.Outlook\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*")]
[process where host.os.type == "windows" and event.action == "start" and
(
/* Check for browser processes opening HTML files with single argument */
(process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe")
and process.args == "--single-argument") or
/* Optionally, check for browser processes opening HTML files with two arguments */
(process.name == "iexplore.exe" and process.args_count == 2) or
/* Optionally, check for browser processes opening HTML files with URL argument */
(process.name in ("firefox.exe", "waterfox.exe") and process.args == "-url")
)
/* Check for file paths in common download and temporary directories targeted in the process arguments */
and process.args : ("?:\\Users\\*\\Downloads\\*.htm*",
"?:\\Users\\*\\Content.Outlook\\*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*.htm*")]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"
[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[rule.threat.technique.subtechnique]]
id = "T1027.006"
name = "HTML Smuggling"
reference = "https://attack.mitre.org/techniques/T1027/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 2m, correlated by user.id.
Stage 1: file
[file where host.os.type == "windows" and event.action in ("creation", "rename") and
file.extension : ("htm", "html") and ((file.Ext.entropy >= 5 and file.size >= 150000) or file.size >= 1000000) and
file.path : (
"?:\\Users\\*\\Downloads\\*",
"?:\\Users\\*\\Content.Outlook\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*")]
Stage 2: process
[process where host.os.type == "windows" and event.action == "start" and
(
(process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe")
and process.args == "--single-argument") or
(process.name == "iexplore.exe" and process.args_count == 2) or
(process.name in ("firefox.exe", "waterfox.exe") and process.args == "-url")
)
and process.args : ("?:\\Users\\*\\Downloads\\*.htm*",
"?:\\Users\\*\\Content.Outlook\\*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*.htm*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*.htm*")]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.action | in |
| field:"EventType" kind:in |
file.Ext.entropy | ge |
| field:"file.Ext.entropy" kind:ge value:"5" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
file.size | ge |
| field:"file.size" kind:ge |
process.args | eq |
| field:"process.args" kind:eq |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"2" |
process.name | eq |
| field:"process_basename" kind:eq value:"iexplore.exe" |
process.name | in |
| field:"process_basename" kind:in |
Suspicious Image Load (taskschd.dll) from MS Office
#Identifies a suspicious image load (taskschd.dll) from Microsoft Office processes. This behavior may indicate adversarial activity where a scheduled task is configured via Windows Component Object Model (COM). This technique can be used to configure persistence and evade monitoring by avoiding the usage of the traditional Windows binary (schtasks.exe) used to manage scheduled tasks.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2020/11/17"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"
[transform]
[[transform.osquery]]
label = "Osquery - Retrieve DNS Cache"
query = "SELECT * FROM dns_cache"
[[transform.osquery]]
label = "Osquery - Retrieve All Services"
query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
[[transform.osquery]]
label = "Osquery - Retrieve Services Running on User Accounts"
query = """
SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
user_account == null)
"""
[[transform.osquery]]
label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
query = """
SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
"""
[rule]
author = ["Elastic"]
description = """
Identifies a suspicious image load (taskschd.dll) from Microsoft Office processes. This behavior may indicate
adversarial activity where a scheduled task is configured via Windows Component Object Model (COM). This technique can
be used to configure persistence and evade monitoring by avoiding the usage of the traditional Windows binary
(schtasks.exe) used to manage scheduled tasks.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.library-*", "logs-windows.sysmon_operational-*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Image Load (taskschd.dll) from MS Office"
note = """## Triage and analysis
### Investigating Suspicious Image Load (taskschd.dll) from MS Office
Microsoft Office, a widely used suite of productivity applications, is frequently targeted by attackers due to its popularity in corporate environments. These attackers exploit its extensive capabilities, like macro scripts in Word and Excel, to gain initial access to systems. They often use Office documents as delivery mechanisms for malware or phishing attempts, taking advantage of their trusted status in professional settings.
`taskschd.dll` provides Command Object Model (COM) interfaces for the Windows Task Scheduler service, allowing developers to programmatically manage scheduled tasks.
This rule looks for an MS Office process loading `taskschd.dll`, which may indicate an adversary abusing COM to configure a scheduled task. This can happen as part of a phishing attack, when a malicious office document registers the scheduled task to download the malware "stage 2" or to establish persistent access.
> **Note**:
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
### Possible investigation steps
- Analyze the host's scheduled tasks and explore the related Windows events to determine if tasks were created or deleted (Event IDs 4698 and 4699).
- Investigate any abnormal behavior by the subject process, such as network connections, registry or file modifications, and spawned child processes.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
- Examine the files downloaded during the past 24 hours.
- Identify files that are related or can be executed in MS Office.
- Identify and analyze macros that these documents contain.
- Identify suspicious traits in the office macros, such as encoded or encrypted sections.
- Retrieve the suspicious files identified in the previous step and determine if they are malicious:
- Analyze the file using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
- Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
### False positive analysis
- This activity is unlikely to happen legitimately. Any activity that triggered the alert and is not inherently malicious must be monitored by the security team.
### Related Rules
- Suspicious WMI Image Load from MS Office - 891cb88e-441a-4c3e-be2d-120d99fe7b0d
### Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- If the malicious file was delivered via phishing:
- Block the email sender from sending future emails.
- Block the malicious web pages.
- Remove emails from the sender from mailboxes.
- Consider improvements to the security awareness program.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
"https://medium.com/threatpunter/detecting-adversary-tradecraft-with-image-load-event-logging-and-eql-8de93338c16",
"https://www.clearskysec.com/wp-content/uploads/2020/10/Operation-Quicksand.pdf",
]
risk_score = 21
rule_id = "baa5d22c-5e1c-4f33-bfc9-efa73bb53022"
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Sysmon Event ID 7 - Image Loaded](https://ela.st/sysmon-event-7-setup)
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Tactic: Execution",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
any where host.os.type == "windows" and
(event.category : ("library", "driver") or (event.category == "process" and event.action : "Image loaded*")) and
process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSPUB.EXE", "MSACCESS.EXE") and
(?dll.name : "taskschd.dll" or file.name : "taskschd.dll")
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[rule.threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[rule.threat.technique.subtechnique]]
id = "T1559.001"
name = "Component Object Model"
reference = "https://attack.mitre.org/techniques/T1559/001/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: any
any where host.os.type == "windows" and
(event.category : ("library", "driver") or (event.category == "process" and event.action : "Image loaded*")) and
process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSPUB.EXE", "MSACCESS.EXE") and
(?dll.name : "taskschd.dll" or file.name : "taskschd.dll")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard value:"taskschd.dll" |
event.action | wildcard |
| field:"EventType" kind:wildcard value:"Image loaded*" |
event.category | eq |
| field:"event.category" kind:eq value:"process" |
event.category | wildcard |
| field:"event.category" kind:wildcard |
file.name | wildcard |
| field:"file.name" kind:wildcard value:"taskschd.dll" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
Suspicious Memory Size Protection via VirtualProtect
#Identifies when a process attempts to change memory region using VirtualProtect API from non executable to executable permissions and the size is abnormal.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies when a process attempts to change memory region using VirtualProtect API from non executable to executable
permissions and the size is abnormal.
"""
id = "c771303c-a200-4df3-bb76-3e5f87a18438"
license = "Elastic License v2"
name = "Suspicious Memory Size Protection via VirtualProtect"
os_list = ["windows"]
version = "1.0.7"
query = '''
api where process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and
process.Ext.api.parameters.protection like "*X*" and not process.Ext.api.parameters.protection_old like "*X*" and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
/* one byte change */
process.Ext.api.parameters.size == 1 and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance like ("Kernel", "Kernel|*")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance == "Kernel" and
not (process.executable : "C:\\Program Files\\Common Files\\McAfee\\SystemCore\\mfehcs.exe" and
process.code_signature.subject_name : ("MUSARUBRA US LLC", "McAfee, Inc.") and process.code_signature.trusted == true) and
not process.thread.Ext.call_stack_final_user_module.path like
("c:\\windows\\microsoft.net\\framework*.dll", "d:\\*\\livecodingconsole.exe", "f:\\*\\livecodingconsole.exe") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("76509a878c4328e71e5d9c0622588e28716466bc9e53091b94f2a1777853153b",
"9d16f960bc4f8c90ee29e83dce9dc9f0a12e1da3553dec2a3a9a8dd9c91891e3",
"929cbeec5ba36a2e42080d31dfe7297fb1a0f4239060004283639182a8e62c74",
"12eea38ed51622bb7e46c61f912dab2ba3bd34161d200e0ebfd68b3f3cdd4d09",
"fa0b17d4c411a5011e094154e7f1bbd2e9237448df8a2b27e321bd1b2a3ab3f1",
"b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19",
"3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d",
"b3a2bf77de27a9793cc922872ef2508ba90a7dd30bca3b354fec190bb7dd333a",
"ac27790dd138bb3a27822a28c97d9af4787e1ad9539109aff94a3e5c684c322d",
"05ef9b2ea7b54a89228e058231373233c9b60e12eca9a5065efda42b9107966c",
"6da24b79a9dde5da83d72a11a0172f57ba0003f05d860aa2f4cfef440bc0bf5a",
"69ac5b15502b45663fc9fd4cc196dd0aaee6ce9fe743d5c40797e0d6be7f39c2",
"9e8563c4a6cd0c72a083bacfef449e045d061e7f26858329bd99fe69af4ddba8",
"ce144b3a591f39ab7b4cf9929c029b51959276d105261e31163df7ae7e56974a",
"bc4f488a26fd622c64f01e579d74b27047ada3e26a73ae8529222b1b8029d04e",
"f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
"ce144b3a591f39ab7b4cf9929c029b51959276d105261e31163df7ae7e56974a",
"4b3c8fe9d95b3ae99483dd8ffc5537eb03eef3f2adbdb351794696e4b0167c4e",
"9cdb85902864423ca20e572c97d0d7bcd9223fabebea4626c0954b45d626e044",
"011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
"a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014")
'''
min_endpoint_version = "8.10.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 = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name in ("VirtualProtect", "VirtualProtectEx") and
process.Ext.api.parameters.protection like "*X*" and not process.Ext.api.parameters.protection_old like "*X*" and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
process.Ext.api.parameters.size == 1 and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance like ("Kernel", "Kernel|*")) and
not process.thread.Ext.call_stack_final_user_module.protection_provenance == "Kernel" and
not (process.executable : "C:\\Program Files\\Common Files\\McAfee\\SystemCore\\mfehcs.exe" and
process.code_signature.subject_name : ("MUSARUBRA US LLC", "McAfee, Inc.") and process.code_signature.trusted == true) and
not process.thread.Ext.call_stack_final_user_module.path like
("c:\\windows\\microsoft.net\\framework*.dll", "d:\\*\\livecodingconsole.exe", "f:\\*\\livecodingconsole.exe") and
not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
("76509a878c4328e71e5d9c0622588e28716466bc9e53091b94f2a1777853153b",
"9d16f960bc4f8c90ee29e83dce9dc9f0a12e1da3553dec2a3a9a8dd9c91891e3",
"929cbeec5ba36a2e42080d31dfe7297fb1a0f4239060004283639182a8e62c74",
"12eea38ed51622bb7e46c61f912dab2ba3bd34161d200e0ebfd68b3f3cdd4d09",
"fa0b17d4c411a5011e094154e7f1bbd2e9237448df8a2b27e321bd1b2a3ab3f1",
"b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19",
"3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d",
"b3a2bf77de27a9793cc922872ef2508ba90a7dd30bca3b354fec190bb7dd333a",
"ac27790dd138bb3a27822a28c97d9af4787e1ad9539109aff94a3e5c684c322d",
"05ef9b2ea7b54a89228e058231373233c9b60e12eca9a5065efda42b9107966c",
"6da24b79a9dde5da83d72a11a0172f57ba0003f05d860aa2f4cfef440bc0bf5a",
"69ac5b15502b45663fc9fd4cc196dd0aaee6ce9fe743d5c40797e0d6be7f39c2",
"9e8563c4a6cd0c72a083bacfef449e045d061e7f26858329bd99fe69af4ddba8",
"ce144b3a591f39ab7b4cf9929c029b51959276d105261e31163df7ae7e56974a",
"bc4f488a26fd622c64f01e579d74b27047ada3e26a73ae8529222b1b8029d04e",
"f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80",
"ce144b3a591f39ab7b4cf9929c029b51959276d105261e31163df7ae7e56974a",
"4b3c8fe9d95b3ae99483dd8ffc5537eb03eef3f2adbdb351794696e4b0167c4e",
"9cdb85902864423ca20e572c97d0d7bcd9223fabebea4626c0954b45d626e044",
"011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570",
"a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | MUSARUBRA US LLC, McAfee, Inc. | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"MUSARUBRA US LLC" field:"process.code_signature.subject_name" value:"McAfee, Inc." |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | C:\Program Files\Common Files\McAfee\SystemCore\mfehcs.exe | excludes:process.executable field:"process.executable" value:"C:\Program Files\Common Files\McAfee\SystemCore\mfehcs.exe" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.Ext.api.parameters.protection_old | match | X | excludes:process.Ext.api.parameters.protection_old field:"process.Ext.api.parameters.protection_old" value:"X" |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | in | 011eb5a6789080192f66cc04c2ceecf57ce867bd854a5b8d530a04f41f50a570, 05ef9b2ea7b54a89228e058231373233c9b60e12eca9a5065efda42b9107966c, 12eea38ed51622bb7e46c61f912dab2ba3bd34161d200e0ebfd68b3f3cdd4d09, 3cd00f456f51829eda119e0e133acc1e45a5930d61fc335a2e9aa688a836a24d, 4b3c8fe9d95b3ae99483dd8ffc5537eb03eef3f2adbdb351794696e4b0167c4e, 69ac5b15502b45663fc9fd4cc196dd0aaee6ce9fe743d5c40797e0d6be7f39c2, 6da24b79a9dde5da83d72a11a0172f57ba0003f05d860aa2f4cfef440bc0bf5a, 76509a878c4328e71e5d9c0622588e28716466bc9e53091b94f2a1777853153b, 929cbeec5ba36a2e42080d31dfe7297fb1a0f4239060004283639182a8e62c74, 9cdb85902864423ca20e572c97d0d7bcd9223fabebea4626c0954b45d626e044, 9d16f960bc4f8c90ee29e83dce9dc9f0a12e1da3553dec2a3a9a8dd9c91891e3, 9e8563c4a6cd0c72a083bacfef449e045d061e7f26858329bd99fe69af4ddba8, a40e2533a200e9e8f29ccf937b05efc92cc4b56251758d978cf73c83f265a014, ac27790dd138bb3a27822a28c97d9af4787e1ad9539109aff94a3e5c684c322d, b0968a364408aad11a33343cb9fdf66b994dbd251cc64237f8894d66efe96f19, b3a2bf77de27a9793cc922872ef2508ba90a7dd30bca3b354fec190bb7dd333a, bc4f488a26fd622c64f01e579d74b27047ada3e26a73ae8529222b1b8029d04e, ce144b3a591f39ab7b4cf9929c029b51959276d105261e31163df7ae7e56974a, f83edc04210f95b944921a7254f9dda5ab9a84e0b511c85d85b72a8394bbba80, fa0b17d4c411a5011e094154e7f1bbd2e9237448df8a2b27e321bd1b2a3ab3f1 | excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 |
process.thread.Ext.call_stack_final_user_module.path | wildcard | c:\windows\microsoft.net\framework*.dll, d:\*\livecodingconsole.exe, f:\*\livecodingconsole.exe | excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\microsoft.net\framework*.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"d:\*\livecodingconsole.exe" field:"process.thread.Ext.call_stack_final_user_module.path" value:"f:\*\livecodingconsole.exe" |
process.thread.Ext.call_stack_final_user_module.protection_provenance | eq | Kernel | excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance field:"process.thread.Ext.call_stack_final_user_module.protection_provenance" value:"Kernel" |
Suspicious Windows Service Execution
#Identifies the execution of a Windows service from suspicious path such as mounted localhost admin share. This may indicate an attempt to elevate privileges via windows services.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies the execution of a Windows service from suspicious path such as mounted localhost admin share. This may
indicate an attempt to elevate privileges via windows services.
"""
id = "cd25c529-73b4-4a9d-84a9-e24c4a3540d1"
license = "Elastic License v2"
name = "Suspicious Windows Service Execution"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/twice-around-the-dance-floor-with-pipedance"]
version = "1.0.31"
query = '''
process where event.action == "start" and
process.parent.name : "services.exe" and
process.Ext.token.integrity_level_name == "system" and
(
process.executable : ("\\\\127.0.0.1\\*", "\\Device\\Mup\\*\\c$\\*", "\\Device\\Mup\\*\\ADMIN$\\*") or
/* Silver psexec default pattern */
(process.command_line : "?:\\windows\\Temp\\*.exe \"\"" and process.args_count == 2)
) and
not process.executable : ("\\\\ENT*\\admin$\\smstsvc_passive_*.exe", "\\Device\\Mup\\*\\c$\\Program Files\\SIXPaymentServicesLtd\\*\\eftdvs.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 = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.parent.name : "services.exe" and
process.Ext.token.integrity_level_name == "system" and
(
process.executable : ("\\\\127.0.0.1\\*", "\\Device\\Mup\\*\\c$\\*", "\\Device\\Mup\\*\\ADMIN$\\*") or
(process.command_line : "?:\\windows\\Temp\\*.exe \"\"" and process.args_count == 2)
) and
not process.executable : ("\\\\ENT*\\admin$\\smstsvc_passive_*.exe", "\\Device\\Mup\\*\\c$\\Program Files\\SIXPaymentServicesLtd\\*\\eftdvs.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.token.integrity_level_name | eq |
| field:"process.Ext.token.integrity_level_name" kind:eq value:"system" |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"2" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"services.exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | \\ENT*\admin$\smstsvc_passive_*.exe, \Device\Mup\*\c$\Program Files\SIXPaymentServicesLtd\*\eftdvs.exe | excludes:process.executable field:"process.executable" value:"\\ENT*\admin$\smstsvc_passive_*.exe" field:"process.executable" value:"\Device\Mup\*\c$\Program Files\SIXPaymentServicesLtd\*\eftdvs.exe" |
Unusual City for an Azure Activity Logs Event
#A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from a geolocation (city) that is unusual for the event action. This can be the result of compromised credentials or keys being used by a threat actor in a different geography than the authorized user(s).
Known False Positives
- New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration; changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased adoption of work from home policies; or users who travel frequently.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence | |
| Stealth |
Rule Body
[metadata]
creation_date = "2025/10/06"
integration = ["azure"]
maturity = "production"
min_stack_comments = "New job added"
min_stack_version = "9.4.0"
updated_date = "2026/04/01"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
A machine learning job detected Azure Activity Logs activity that, while not inherently suspicious or abnormal, is sourcing from
a geolocation (city) that is unusual for the event action. This can be the result of compromised credentials or keys being
used by a threat actor in a different geography than the authorized user(s).
"""
false_positives = [
"""
New or unusual event and user geolocation activity can be due to manual troubleshooting or reconfiguration;
changes in cloud automation scripts or workflows; adoption of new services; expansion into new regions; increased
adoption of work from home policies; or users who travel frequently.
""",
]
from = "now-2h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "azure_activitylogs_rare_event_action_for_a_city_ea"
name = "Unusual City for an Azure Activity Logs Event"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual City for an Azure Activity Logs Event
This rule highlights Azure Activity Logs activity executed from a city atypical for the action, indicating use of valid accounts from a different geography. A common pattern is a threat actor using stolen user or service principal credentials to add privileged role assignments and rapidly spin up compute to stage data exfiltration or mining from overseas. Location–action mismatch surfaces stealthy account abuse before persistence and broader impact.
### Possible investigation steps
- Identify the principal behind the operation and validate legitimate presence in the region by contacting the user/owner and reviewing travel or business justification.
- Enrich the source IP with ASN, hosting/cloud provider, VPN/Tor indicators, reverse DNS, and threat intel to determine whether it originates from anonymizing or compute infrastructure.
- Correlate Entra ID sign-in logs for the principal around the timestamp to check impossible travel, MFA usage or bypass, device compliance state, and atypical user-agent strings.
- Review adjacent Azure Resource Manager activity by the same principal for privileged changes such as role assignments, policy updates, access key or secret actions, and rapid compute/network provisioning.
- Determine whether the actor is a user or service principal, and if a service principal, inspect recent secret/certificate changes, unexpected consent or role grants, and potential credential exposure in CI/CD or repositories.
### False positive analysis
- A legitimate admin traveling or connecting via a VPN or newly configured egress/NAT gateway can geolocate to an unexpected city while performing routine Azure Activity Logs actions.
- Service principal or managed identity automation executing from a different Azure region due to multi-region deployment or failover can egress from a city unusual for the action yet still be authorized.
### Response and remediation
- Immediately revoke active sessions and refresh tokens for the implicated user or service principal, disable the account or application, and block the observed source IP/CIDR at Azure Firewall and NSGs to contain activity.
- Reset the user's password and force MFA re-registration, or for a service principal rotate all client secrets/certificates and remove any recent admin consent grants to eradicate credential reuse.
- Revert changes executed from the unusual city by removing newly added role assignments, deleting unexpected VMs/VNets or policy updates, and rotating Storage account keys and Key Vault secrets if they were accessed.
- After containment, verify business justification (travel or new egress) and restore any required resources from ARM/Bicep templates or backups, then re-enable access behind Conditional Access with known egress IPs only.
- Escalate to Incident Response if the actor performs privileged role grants, Key Vault secret retrieval, Storage key listing, or rapid compute provisioning within the same session, or if sign-in shows impossible travel or missing MFA.
- Harden by enforcing PIM for Owner/Contributor/User Access Administrator roles, configuring Conditional Access with country allowlists and named egress IP ranges, restricting service principals to certificate-only auth and Private Link on Key Vault/Storage, and enabling continuous geolocation anomaly alerts in Microsoft Sentinel.
"""
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from Azure Activity Logs.
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Azure Activity Logs Integration Setup
The Azure Activity Logs integration allows you to collect logs and metrics from Azure with Elastic Agent.
#### The following steps should be executed in order to add the Elastic Agent System integration "Azure Activity Logs" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Azure Activity Logs” and select the integration to see more details about it.
- Click “Add Azure Activity Logs”.
- Configure the integration.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://www.elastic.co/docs/reference/integrations/azure/activitylogs).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "ce08cdb8-e6cb-46bb-a7cc-16d17547323f"
severity = "low"
tags = [
"Domain: Cloud",
"Data Source: Azure",
"Data Source: Azure Activity Logs",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[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 = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Unusually Large Script Executed by Osascript
#Detects when Osascript is executed and an abnormally large script is supplied to be executed. Threat actors have been increasingly been observed utilizing Osascript to collect sensitive files and stage them for exfiltration using AppleScript supplied to Osascript via the -e option for execution. These scripts are abnormally large and very uncommon to see executed in this manner.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when Osascript is executed and an abnormally large script is supplied to be executed. Threat actors have been
increasingly been observed utilizing Osascript to collect sensitive files and stage them for exfiltration using
AppleScript supplied to Osascript via the -e option for execution. These scripts are abnormally large and very uncommon
to see executed in this manner.
"""
id = "40d4b42d-ad3a-478d-88cd-d440fa45cd81"
license = "Elastic License v2"
name = "Unusually Large Script Executed by Osascript"
os_list = ["macos"]
version = "1.0.5"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "osascript" and
process.args == "-e" and
(
process.args_count > 40 or
(length(process.command_line) >= 3000 and process.command_line regex """.*\(\{[\s]*\d+[\s]*,[\s]*\d+[\s]*,[\s]*\d+.*""")
) and
not (process.args : "*checkWWAssetsExistence*" and process.args : "*wwAssetsOpenDocuments*" and process.args : "*isWWAssetsInstalled*")
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.002"
name = "AppleScript"
reference = "https://attack.mitre.org/techniques/T1059/002/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "osascript" and
process.args == "-e" and
(
process.args_count > 40 or
(length(process.command_line) >= 3000 and process.command_line regex """.*\(\{[\s]*\d+[\s]*,[\s]*\d+[\s]*,[\s]*\d+.*""")
) and
not (process.args : "*checkWWAssetsExistence*" and process.args : "*wwAssetsOpenDocuments*" and process.args : "*isWWAssetsInstalled*")
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 value:"-e" |
process.args_count | gt |
| field:"process.args_count" kind:gt value:"40" |
process.command_line | regex_match |
| field:"CommandLine" kind:regex_match value:".*({[\s]*\d+[\s]*,[\s]*\d+[\s]*,[\s]*\d+.*" |
process.name | eq |
| field:"process_basename" kind:eq value:"osascript" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | match | checkWWAssetsExistence | excludes:process.args field:"process.args" value:"checkWWAssetsExistence" |
process.args | match | isWWAssetsInstalled | excludes:process.args field:"process.args" value:"isWWAssetsInstalled" |
process.args | match | wwAssetsOpenDocuments | excludes:process.args field:"process.args" value:"wwAssetsOpenDocuments" |
Windows Installer with Suspicious Properties
#Identifies the execution of an installer from an archive or with suspicious properties. Adversaries may abuse msiexec.exe to launch local or network accessible MSI files in an attempt to bypass application whitelisting.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
Rule Body
[metadata]
creation_date = "2023/09/26"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/07/28"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies the execution of an installer from an archive or with suspicious properties. Adversaries may abuse
msiexec.exe to launch local or network accessible MSI files in an attempt to bypass application whitelisting.
"""
from = "now-119m"
index = ["logs-endpoint.events.*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Windows Installer with Suspicious Properties"
references = ["https://lolbas-project.github.io/lolbas/Binaries/Msiexec/"]
risk_score = 21
rule_id = "55f07d1b-25bc-4a0f-aa0c-05323c1319d0"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Rule Type: BBR",
"Data Source: Elastic Defend",
]
type = "eql"
query = '''
sequence by host.id with maxspan=1m
[registry where host.os.type == "windows" and event.type == "change" and process.name : "msiexec.exe" and
(
(registry.value : "InstallSource" and
registry.data.strings : ("?:\\Users\\*\\Temp\\Temp?_*.zip\\*",
"?:\\Users\\*\\*.7z\\*",
"?:\\Users\\*\\*.rar\\*")) or
(registry.value : ("DisplayName", "ProductName") and registry.data.strings : "SetupTest")
)]
[process where host.os.type == "windows" and event.action == "start" and
process.parent.name : "msiexec.exe" and
not process.name : "msiexec.exe" and
not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true)]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[rule.threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by host.id.
Stage 1: registry
[registry where host.os.type == "windows" and event.type == "change" and process.name : "msiexec.exe" and
(
(registry.value : "InstallSource" and
registry.data.strings : ("?:\\Users\\*\\Temp\\Temp?_*.zip\\*",
"?:\\Users\\*\\*.7z\\*",
"?:\\Users\\*\\*.rar\\*")) or
(registry.value : ("DisplayName", "ProductName") and registry.data.strings : "SetupTest")
)]
Stage 2: process
[process where host.os.type == "windows" and event.action == "start" and
process.parent.name : "msiexec.exe" and
not process.name : "msiexec.exe" and
not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event.type | eq |
| field:"event.type" kind:eq value:"change" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"msiexec.exe" |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard value:"msiexec.exe" |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard |
registry.value | wildcard |
| field:"registry_value_name" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\*.exe" field:"process.executable" value:"?:\Program Files\*.exe" |
process.name | eq | msiexec.exe | excludes:process.name field:"process.name" value:"msiexec.exe" |
WMI WBEMTEST Utility Execution
#Adversaries may abuse the WMI diagnostic tool, wbemtest.exe, to enumerate WMI object instances or invoke methods against local or remote endpoints.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2023/08/24"
integration = ["endpoint", "windows", "system"]
maturity = "production"
updated_date = "2025/03/20"
[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Adversaries may abuse the WMI diagnostic tool, wbemtest.exe, to enumerate WMI object instances or invoke methods against
local or remote endpoints.
"""
from = "now-119m"
index = [
"endgame-*",
"logs-endpoint.events.process-*",
"logs-system.security*",
"logs-windows.*",
"winlogbeat-*",
]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "WMI WBEMTEST Utility Execution"
risk_score = 21
rule_id = "d3551433-782f-4e22-bbea-c816af2d41c6"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Rule Type: BBR",
"Data Source: Elastic Endgame",
"Data Source: Windows Security Event Logs",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and process.name : "wbemtest.exe"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and process.name : "wbemtest.exe"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"wbemtest.exe" |