Detection rules › Elastic

Elastic rules: 22

RuleSeverity
Azure Run Command Correlated with Process Executionmedium
Azure VM Serial Console Connection with Unusual User and ASNmedium
Binary Proxy Execution via Runexehelper
Delete Volume USN Journal with Fsutillow
Execution via Program Compatibility Assistant
GKE Admission Webhook Created or Modifiedmedium
M365 Exchange Mailbox Items Accessed Excessivelymedium
Manual Dracut Executionlow
Multiple Device Token Hashes for Single Okta Sessionmedium
Network Connection via MsXsllow
Persistence via MSDTC Service Hijack
Possible JAVA Reverse Shell
Potential ClickFix Attack via Windows Terminal
Potential DLL SideLoad via a Microsoft Signed Binary
Potential Privilege Escalation via a SUID/SGID Binary
Potential Privilege Escalation via Enlightenmenthigh
Potential Privilege Escalation via InstallerFileTakeOverhigh
Potential Privilege Escalation via LogonUI
Shared Object Created by Previously Unknown Processmedium
Shellcode Execution via a CallBack Function
Spike in Group Privilege Change Eventslow
Suspicious Access to AppArmor Policy Management Files
Suspicious Execution of Unsigned or Untrusted Process via Sudo
Suspicious File Downloaded from Google Drivemedium
Suspicious Kerberos Authentication Ticket Requesthigh
Suspicious Process with a Spoofed Parent
Suspicious Termination of ESXI Processhigh
Suspicious WMI Image Load from MS Officelow
Untrusted DLL Loaded by Azure AD Connect Authentication Agenthigh
Unusual Launch Service Creation via Unsigned or Untrusted Binary
Unusual Linux Process Calling the Metadata Servicelow

Azure Run Command Correlated with Process Execution

#
Status
production
Severity
medium
Time window
9m
Group by
Esql.host_name, Esql.time_bucket
Author
Elastic
Source
github.com/elastic/detection-rules

Correlates successful Azure Virtual Machine Run Command operations with endpoint process execution on the same host within minutes. Adversaries abuse Run Command to run scripts remotely as SYSTEM or root while activity logs only record the control-plane action; Elastic Defend process telemetry reveals the on-guest payload.

Known False Positives

  • Legitimate automation that deploys configuration via Azure Run Command and launches PowerShell with unrestricted policy and numbered script files (for example `script1.ps1`) may match. Baseline known deployment pipelines, VM names, and principal IDs before tuning.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2026/05/20"
integration = ["azure", "endpoint"]
maturity = "production"
updated_date = "2026/05/20"

[rule]
author = ["Elastic"]
description = """
Correlates successful Azure Virtual Machine Run Command operations with endpoint process execution on the same host
within minutes. Adversaries abuse Run Command to run scripts remotely as SYSTEM or root while activity logs only record the
control-plane action; Elastic Defend process telemetry reveals the on-guest payload.
"""
false_positives = [
    """
    Legitimate automation that deploys configuration via Azure Run Command and launches PowerShell with unrestricted
    policy and numbered script files (for example `script1.ps1`) may match. Baseline known deployment pipelines, VM
    names, and principal IDs before tuning.
    """,
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "Azure Run Command Correlated with Process Execution"
note = """## Triage and analysis

### Investigating Azure Run Command Correlated with Process Execution

This ES|QL rule correlates Azure Activity Log `MICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION` events with
endpoint process starts, joined on host name within a two-minute bucket and a 0–120 second delay between Run Command and process start.

Pivot into raw `logs-azure.activitylogs-*` and `logs-endpoint.events.process-*` events for full command lines and
resource identifiers.

### Possible investigation steps

- Review `user.email` and `azure.activitylogs.identity.authorization.evidence.principal_id` for who invoked Run Command.
- Inspect `Esql.process_command_line_values` for script paths and arguments beyond the matched pattern.
- Confirm `Esql.host_name` maps to the intended VM and whether Run Command timing aligns with change windows.
- Hunt for additional Run Command or PowerShell activity from the same principal or subscription.

### Response and remediation

- If unauthorized, isolate the VM, revoke credentials used for Run Command, and review role assignments on the VM and
  subscription.
- Collect endpoint artifacts and Azure activity logs for incident reporting.
"""
references = [
    "https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#virtual-machine-contributor",
    "https://posts.specterops.io/attacking-azure-azure-ad-and-introducing-powerzure-ca70b330511a",
    "https://adsecurity.org/?p=4277",
]
risk_score = 47
rule_id = "ebbc1959-3309-4abf-b6cb-2bee3dbc9a7b"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Endpoint",
    "OS: Windows",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Azure",
    "Data Source: Microsoft Azure",
    "Data Source: Azure Activity Logs",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
FROM logs-azure.activitylogs-*, logs-endpoint.events.process-* METADATA _id, _version, _index
| WHERE 
  (
    event.category == "process" AND KQL("event.action:start")
    AND process.parent.name == "powershell.exe"
    AND process.parent.command_line LIKE "powershell  -ExecutionPolicy Unrestricted -File script?.ps1"
    AND process.name != "conhost.exe"
  ) OR
  (
    KQL("event.category:process and event.action:exec and process.parent.name:(dash or bash or sh) and process.parent.args:/var/lib/waagent/run-command/download/*/script.sh")
   ) OR 
  (
    event.module == "azure"
    AND event.action == "MICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION"
    AND NOT KQL("event.outcome:failure")
   )

// Azure hostname comes as upper-case while Endpoint event comes as lowercase
| EVAL Esql.host_name = COALESCE(
    TO_LOWER(host.name),
    TO_LOWER(azure.resource.name)
  )
| EVAL ts_runcommand = CASE(event.module == "azure", @timestamp, null)
| EVAL ts_endpoint = CASE(event.category == "process", @timestamp, null)
| EVAL is_runcommand = CASE(event.module == "azure", 1, null)
| EVAL is_endpoint = CASE(event.category == "process", 1, null)
| EVAL Esql.time_bucket = DATE_TRUNC(2 minutes, @timestamp)
| STATS
    runcommand_count = COUNT(is_runcommand),
    endpoint_count = COUNT(is_endpoint),
    user.email = VALUES(user.email),
    azure.activitylogs.identity.authorization.evidence.principal_id = VALUES(azure.activitylogs.identity.authorization.evidence.principal_id),
    azure.activitylogs.tenant_id = VALUES(azure.activitylogs.tenant_id),
    azure.subscription_id = VALUES(azure.subscription_id),
    source.ip = VALUES(source.ip),
    source.geo.country_name = VALUES(source.geo.country_name),
    source.as.number = VALUES(source.as.number),
    Esql.process_command_line_values = VALUES(process.command_line),
    first_runcommand = MIN(ts_runcommand),
    first_ps_exec = MIN(ts_endpoint),
    outcome = VALUES(event.outcome)
  BY Esql.host_name, Esql.time_bucket
| WHERE runcommand_count >= 1 AND endpoint_count >= 1
| EVAL delta_ms = TO_LONG(first_ps_exec) - TO_LONG(first_runcommand)
| EVAL delta_sec = delta_ms / 1000
| WHERE delta_sec >= 0 AND delta_sec <= 120
| KEEP
    user.email,
    azure.activitylogs.identity.authorization.evidence.principal_id,
    source.ip,
    source.as.number,
    source.geo.country_name,
    azure.activitylogs.tenant_id,
    azure.subscription_id,
    Esql.*
'''


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

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

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

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

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

Stages and Predicates

Stage 1: from

FROM logs-azure.activitylogs-*, logs-endpoint.events.process-* METADATA _id, _version, _index

Stage 2: where

| WHERE
  (
    event.category == "process" AND KQL("event.action:start")
    AND process.parent.name == "powershell.exe"
    AND process.parent.command_line LIKE "powershell  -ExecutionPolicy Unrestricted -File script?.ps1"
    AND process.name != "conhost.exe"
  ) OR
  (
    KQL("event.category:process and event.action:exec and process.parent.name:(dash or bash or sh) and process.parent.args:/var/lib/waagent/run-command/download/*/script.sh")
   ) OR
  (
    event.module == "azure"
    AND event.action == "MICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION"
    AND NOT KQL("event.outcome:failure")
   )

Stage 3: eval

| EVAL Esql.host_name = COALESCE(
    TO_LOWER(host.name),
    TO_LOWER(azure.resource.name)
  )

Stage 4: eval

| EVAL ts_runcommand = CASE(event.module == "azure", @timestamp, null)
ts_runcommand =
ifevent.module == "azure"@timestamp
elsenull

Stage 5: eval

| EVAL ts_endpoint = CASE(event.category == "process", @timestamp, null)
ts_endpoint =
ifevent.category == "process"@timestamp
elsenull

Stage 6: eval

| EVAL is_runcommand = CASE(event.module == "azure", 1, null)
is_runcommand =
ifevent.module == "azure"1
elsenull

Stage 7: eval

| EVAL is_endpoint = CASE(event.category == "process", 1, null)
is_endpoint =
ifevent.category == "process"1
elsenull

Stage 8: eval

| EVAL Esql.time_bucket = DATE_TRUNC(2 minutes, @timestamp)

Stage 9: stats

| STATS
    runcommand_count = COUNT(is_runcommand),
    endpoint_count = COUNT(is_endpoint),
    user.email = VALUES(user.email),
    azure.activitylogs.identity.authorization.evidence.principal_id = VALUES(azure.activitylogs.identity.authorization.evidence.principal_id),
    azure.activitylogs.tenant_id = VALUES(azure.activitylogs.tenant_id),
    azure.subscription_id = VALUES(azure.subscription_id),
    source.ip = VALUES(source.ip),
    source.geo.country_name = VALUES(source.geo.country_name),
    source.as.number = VALUES(source.as.number),
    Esql.process_command_line_values = VALUES(process.command_line),
    first_runcommand = MIN(ts_runcommand),
    first_ps_exec = MIN(ts_endpoint),
    outcome = VALUES(event.outcome)
  BY Esql.host_name, Esql.time_bucket

Stage 10: where

| WHERE runcommand_count >= 1 AND endpoint_count >= 1

Stage 11: eval

| EVAL delta_ms = TO_LONG(first_ps_exec) - TO_LONG(first_runcommand)

Stage 12: eval

| EVAL delta_sec = delta_ms / 1000

Stage 13: where

| WHERE delta_sec >= 0 AND delta_sec <= 120

Stage 14: keep

| KEEP
    user.email,
    azure.activitylogs.identity.authorization.evidence.principal_id,
    source.ip,
    source.as.number,
    source.geo.country_name,
    azure.activitylogs.tenant_id,
    azure.subscription_id,
    Esql.*

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
delta_secge
  • 0
field:"delta_sec" kind:ge value:"0"
delta_secle
  • 120
field:"delta_sec" kind:le value:"120"
endpoint_countge
  • 1
field:"endpoint_count" kind:ge value:"1"
event.actioneq
  • MICROSOFT.COMPUTE/VIRTUALMACHINES/RUNCOMMAND/ACTION
  • exec corpus 37 (elastic 22, sigma 15)
  • start corpus 5 (elastic 5)
field:"EventType" kind:eq
event.categoryeq
  • process corpus 38 (elastic 38)
  • process corpus 105 (elastic 105)
field:"event.category" kind:eq
event.moduleeq
  • azure corpus 2 (elastic 2)
field:"event.module" kind:eq value:"azure"
process.namene
  • conhost.exe
field:"process_basename" kind:ne value:"conhost.exe"
process.parent.argswildcard
  • /var/lib/waagent/run-command/download/*/script.sh corpus 2 (elastic 2)
field:"process.parent.args" kind:wildcard value:"/var/lib/waagent/run-command/download/*/script.sh"
process.parent.command_linewildcard
  • powershell -ExecutionPolicy Unrestricted -File script?.ps1 corpus 2 (elastic 2)
field:"ParentCommandLine" kind:wildcard value:"powershell -ExecutionPolicy Unrestricted -File script?.ps1"
process.parent.nameeq
  • powershell.exe corpus 2 (elastic 2)
field:"parent_process_basename" kind:eq value:"powershell.exe"
process.parent.namein
  • bash corpus 7 (elastic 7)
  • dash corpus 5 (elastic 5)
  • sh corpus 7 (elastic 7)
field:"parent_process_basename" kind:in
runcommand_countge
  • 1
field:"runcommand_count" kind:ge value:"1"

Output Fields

These fields are emitted when the rule matches.

FieldSource
user.emailKEEP user.email
azure.activitylogs.identity.authorization.evidence.principal_idKEEP azure.activitylogs.identity.authorization.evidence.principal_id
source.ipKEEP source.ip
source.as.numberKEEP source.as.number
source.geo.country_nameKEEP source.geo.country_name
azure.activitylogs.tenant_idKEEP azure.activitylogs.tenant_id
azure.subscription_idKEEP azure.subscription_id
Esql.*KEEP Esql.*

Azure VM Serial Console Connection with Unusual User and ASN

#
Status
production
Severity
medium
Time window
9m
Group by
azure.activitylogs.identity.authorization.evidence.principal_id, source.as.number
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies a connection to the Azure Serial Console of a virtual machine (VM) by an identity and source network combination that has not been observed recently. The Serial Console provides text-based console access to a VM through the boot diagnostics serial port, independent of the VM's network state. Because it does not traverse the VM's network interface, a Serial Console session bypasses Network Security Groups (NSGs), Just-in-Time (JIT) access policies, and other network controls. An adversary with a privileged Azure RBAC role (for example Virtual Machine Contributor) and boot diagnostics enabled on the target can use the Serial Console to obtain an interactive session as SYSTEM (Windows) or root (Linux).

Known False Positives

  • System or platform administrators may legitimately use the Serial Console to troubleshoot a VM that is unreachable over the network (boot failures, misconfigured firewall/NSG, lost SSH/RDP access). The first connection per identity and source ASN will alert; baseline expected break-glass principals and their corporate/VPN networks and exclude them if verified as authorized.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2026/06/07"
integration = ["azure"]
maturity = "production"
updated_date = "2026/06/07"

[rule]
author = ["Elastic"]
description = """
Identifies a connection to the Azure Serial Console of a virtual machine (VM) by an identity and source network
combination that has not been observed recently. The Serial Console provides text-based console access to a VM through
the boot diagnostics serial port, independent of the VM's network state. Because it does not traverse the VM's network
interface, a Serial Console session bypasses Network Security Groups (NSGs), Just-in-Time (JIT) access policies, and
other network controls. An adversary with a privileged Azure RBAC role (for example Virtual Machine Contributor) and
boot diagnostics enabled on the target can use the Serial Console to obtain an interactive session as SYSTEM (Windows)
or root (Linux).
"""
false_positives = [
    """
    System or platform administrators may legitimately use the Serial Console to troubleshoot a VM that is unreachable
    over the network (boot failures, misconfigured firewall/NSG, lost SSH/RDP access). The first connection per
    identity and source ASN will alert; baseline expected break-glass principals and their corporate/VPN networks and
    exclude them if verified as authorized.
    """,
]
from = "now-9m"
index = ["logs-azure.activitylogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Azure VM Serial Console Connection with Unusual User and ASN"
note = """## Triage and analysis

### Investigating Azure VM Serial Console Connection with Unusual User and ASN

The Azure Serial Console gives text-based console access to a VM over the boot diagnostics serial port. It works even
when the VM has no inbound network connectivity, so a session bypasses NSGs, JIT, and other network controls. This rule
flags successful `MICROSOFT.SERIALCONSOLE/SERIALPORTS/CONNECT/ACTION` operations where the combination of acting
principal and source ASN has not been seen in the history window.

This rule uses a new terms approach keyed on the acting principal and source ASN, so it surfaces a
known identity connecting from an unusual network as well as any new identity using the Serial Console.

### Triage checklist

- Identify the caller via `azure.activitylogs.identity.authorization.evidence.principal_id` and
  `azure.activitylogs.identity.authorization.evidence.principal_type` (User vs ServicePrincipal). Service principal
  Serial Console access is unusual and warrants scrutiny.
- Review `source.as.organization.name`, `source.as.number`, and `source.geo.country_name` - is the network a known
  corporate/VPN ASN or an unexpected hosting/residential provider?
- Was the connect preceded by reconnaissance, role assignment changes, or Run Command / extension activity on the same VM?
- Were there preceding failed Serial Console connect attempts (`event.outcome:failure`) suggesting access probing?
- Does the target VM normally require Serial Console access, or is it a production system that should be reachable over
  the network?

### Possible investigation steps

- Review `azure.resource.id` to identify the VM and confirm boot diagnostics is enabled.
- Correlate with Entra ID sign-in logs for the caller and review MFA / conditional access posture.
- Pivot on the VM for endpoint telemetry around the connect timestamp (interactive shell, new local accounts, credential
  access) since Serial Console sessions execute as SYSTEM/root.
- Review the principal's RBAC role assignments on the subscription, resource group, and VM.

### Response and remediation

- If unauthorized, terminate the session, rotate credentials reachable from the VM, and review RBAC on the affected scope.
- Consider disabling the subscription-level Serial Console where it is not operationally required.
- Isolate the VM and collect endpoint and activity log artifacts per incident procedures.
"""
references = [
    "https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-overview",
    "https://blog.pwnedlabs.io/diving-deep-into-azure-vm-attack-vectors",
    "https://www.netspi.com/blog/technical-blog/adversary-simulation/7-ways-to-execute-command-on-azure-virtual-machine-virtual-machine-scale-sets/",
]
risk_score = 47
rule_id = "97266eb4-b8c3-4e3e-9417-7d0ace6b3dfe"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Azure",
    "Data Source: Azure Activity Logs",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset:azure.activitylogs and
  azure.activitylogs.operation_name:"MICROSOFT.SERIALCONSOLE/SERIALPORTS/CONNECT/ACTION" and
  event.outcome:("success" or "Success") and
  azure.activitylogs.identity.authorization.evidence.principal_id:* and
  source.as.number:*
'''

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.outcome",
    "azure.activitylogs.operation_name",
    "azure.activitylogs.identity.authorization.evidence.principal_id",
    "azure.activitylogs.identity.authorization.evidence.principal_type",
    "azure.activitylogs.identity.claims_initiated_by_user.name",
    "azure.resource.id",
    "azure.resource.name",
    "source.ip",
    "source.as.number",
    "source.as.organization.name",
    "source.geo.country_name",
    "azure.subscription_id",
    "azure.activitylogs.tenant_id",
]

[rule.new_terms]
field = "new_terms_fields"
value = [
    "azure.activitylogs.identity.authorization.evidence.principal_id",
    "source.as.number",
]

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1021.008"
name = "Direct Cloud VM Connections"
reference = "https://attack.mitre.org/techniques/T1021/008/"

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

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

[[rule.threat.technique]]
id = "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/"

Stages and Predicates

Stage 1: new_terms

data_stream.dataset:azure.activitylogs and
  azure.activitylogs.operation_name:"MICROSOFT.SERIALCONSOLE/SERIALPORTS/CONNECT/ACTION" and
  event.outcome:("success" or "Success") and
  azure.activitylogs.identity.authorization.evidence.principal_id:* and
  source.as.number:*

Indicators

These rows show field, operator, and value matches.

Binary Proxy Execution via Runexehelper

#
Source
github.com/elastic/protections-artifacts

Identifies the execution of a binary via the Windows RunExeHelper utility. Adversaries may bypass process and signature-based defenses by proxying execution of malicious content with signed, or otherwise trusted, binaries.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a binary via the Windows RunExeHelper utility. Adversaries may bypass process and
signature-based defenses by proxying execution of malicious content with signed, or otherwise trusted, binaries.
"""
id = "8b1ae402-a41b-485f-8eb6-00ae6144cf8a"
license = "Elastic License v2"
name = "Binary Proxy Execution via Runexehelper"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Runexehelper/"]
version = "1.0.7"

query = '''
process where event.action == "start" and process.parent.name : "runexehelper.exe" and 
 not process.executable :
              ("?:\\Windows\\System32\\conhost.exe",
               "?:\\Windows\\System32\\powercfg.exe",
               "?:\\WINDOWS\\system32\\wevtutil.exe",
               "?:\\Windows\\System32\\WSCollect.exe",
               "?:\\Windows\\System32\\TpmTool.exe",
               "?:\\Windows\\System32\\MdmDiagnosticsTool.exe",
               "?:\\Windows\\System32\\dsregcmd.exe",
               "?:\\Windows\\System32\\stordiag.exe",
               "?:\\Windows\\System32\\dxdiag.exe",
               "?:\\Windows\\System32\\logman.exe",
               "?:\\Windows\\System32\\licensingdiag.exe",
               "?:\\Windows\\System32\\dispdiag.exe",
               "?:\\Windows\\System32\\pnputil.exe",
               "?:\\Windows\\System32\\hcsdiag.exe",
               "?:\\Windows\\System32\\ddodiag.exe")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and process.parent.name : "runexehelper.exe" and 
 not process.executable :
              ("?:\\Windows\\System32\\conhost.exe",
               "?:\\Windows\\System32\\powercfg.exe",
               "?:\\WINDOWS\\system32\\wevtutil.exe",
               "?:\\Windows\\System32\\WSCollect.exe",
               "?:\\Windows\\System32\\TpmTool.exe",
               "?:\\Windows\\System32\\MdmDiagnosticsTool.exe",
               "?:\\Windows\\System32\\dsregcmd.exe",
               "?:\\Windows\\System32\\stordiag.exe",
               "?:\\Windows\\System32\\dxdiag.exe",
               "?:\\Windows\\System32\\logman.exe",
               "?:\\Windows\\System32\\licensingdiag.exe",
               "?:\\Windows\\System32\\dispdiag.exe",
               "?:\\Windows\\System32\\pnputil.exe",
               "?:\\Windows\\System32\\hcsdiag.exe",
               "?:\\Windows\\System32\\ddodiag.exe")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Windows\System32\conhost.exe, ?:\Windows\System32\powercfg.exe, ?:\WINDOWS\system32\wevtutil.exe, ?:\Windows\System32\WSCollect.exe, ?:\Windows\System32\TpmTool.exe, ?:\Windows\System32\MdmDiagnosticsTool.exe, ?:\Windows\System32\dsregcmd.exe, ?:\Windows\System32\stordiag.exe, ?:\Windows\System32\dxdiag.exe, ?:\Windows\System32\logman.exe, ?:\Windows\System32\licensingdiag.exe, ?:\Windows\System32\dispdiag.exe, ?:\Windows\System32\pnputil.exe, ?:\Windows\System32\hcsdiag.exe, ?:\Windows\System32\ddodiag.exeexcludes:process.executable

Delete Volume USN Journal with Fsutil

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

Identifies use of the fsutil.exe to delete the volume USNJRNL. This technique is used by attackers to eliminate evidence of files created during post-exploitation activities.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies use of the fsutil.exe to delete the volume USNJRNL. This technique is used by attackers to eliminate evidence
of files created during post-exploitation activities.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Delete Volume USN Journal with Fsutil"
note = """## Triage and analysis

### Investigating Delete Volume USN Journal with Fsutil

The Update Sequence Number (USN) Journal is a feature in the NTFS file system used by Microsoft Windows operating systems to keep track of changes made to files and directories on a disk volume. The journal records metadata for changes such as file creation, deletion, modification, and permission changes. It is used by the operating system for various purposes, including backup and recovery, file indexing, and file replication.

This artifact can provide valuable information in forensic analysis, such as programs executed (prefetch file operations), file modification events in suspicious directories, deleted files, etc. Attackers may delete this artifact in an attempt to cover their tracks, and this rule identifies the usage of the `fsutil.exe` utility to accomplish it.

Consider using the Elastic Defend integration instead of USN Journal, as the Elastic Defend integration provides more visibility and context in the file operations it records.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
  - Verify if any other anti-forensics behaviors were observed.
- Review file operation logs from Elastic Defend for suspicious activity the attacker tried to hide.

### False positive analysis

- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

### Response and remediation

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

setup = """## Setup

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

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

### Additional data sources

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

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""

risk_score = 21
rule_id = "f675872f-6d85-40a3-b502-c0d2ef101e92"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Windows Security Event Logs",
    "Data Source: Microsoft Defender XDR",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  (process.name : "fsutil.exe" or ?process.pe.original_file_name == "fsutil.exe") and
  process.args : "deletejournal" and process.args : "usn"
'''


[[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.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  (process.name : "fsutil.exe" or ?process.pe.original_file_name == "fsutil.exe") and
  process.args : "deletejournal" and process.args : "usn"

Indicators

These rows show field, operator, and value matches.

Execution via Program Compatibility Assistant

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to proxy execution using Microsoft Program Compatibility Assistant binary. Adversaries may use pcalua.exe to evade suspicious parent child process relationships.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to proxy execution using Microsoft Program Compatibility Assistant binary. Adversaries may use
pcalua.exe to evade suspicious parent child process relationships.
"""
id = "812a9a02-aac3-43b9-873a-70c2882fe19b"
license = "Elastic License v2"
name = "Execution via Program Compatibility Assistant"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Pcalua/"]
version = "1.0.8"

query = '''
process where event.action == "start" and
 (
  (process.parent.name : "pcalua.exe" and process.parent.args : "-a" and not process.parent.args : "-d") or
  (process.name : "pcalua.exe" and process.args : "-a" and not process.args : "-d")
 ) and
 not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and

 /* excluding signed and non Microsoft binaries */
 not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



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

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (
  (process.parent.name : "pcalua.exe" and process.parent.args : "-a" and not process.parent.args : "-d") or
  (process.name : "pcalua.exe" and process.args : "-a" and not process.args : "-d")
 ) and
 not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
 not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

GKE Admission Webhook Created or Modified

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

Detects creation or modification of GKE mutating or validating admission webhook configurations by non-system identities. Malicious webhooks can inject workloads, block security tooling, or intercept API traffic for persistence and defense evasion.

Known False Positives

  • GitOps and platform controllers (cert-manager, Gatekeeper, Kyverno, service mesh) legitimately manage webhooks. Validate change tickets and controller identities before tuning.

MITRE ATT&CK Coverage

TacticTechniques
Persistence
Defense Impairment

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/06/30"
integration = ["gcp"]
maturity = "production"
updated_date = "2026/06/30"

[rule]
author = ["Elastic"]
description = """
Detects creation or modification of GKE mutating or validating admission webhook configurations by non-system identities.
Malicious webhooks can inject workloads, block security tooling, or intercept API traffic for persistence and defense
evasion.
"""
false_positives = [
    """
    GitOps and platform controllers (cert-manager, Gatekeeper, Kyverno, service mesh) legitimately manage webhooks.
    Validate change tickets and controller identities before tuning.
    """,
]
from = "now-9m"
index = ["logs-gcp.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "GKE Admission Webhook Created or Modified"
note = """## Triage and analysis

### Investigating GKE Admission Webhook Created or Modified

Review webhook name, actor, and clientConfig destination in `gcp.audit.request`.

### Investigation steps

- Confirm `user.email`, `event.action`, and webhook resource name.
- Inspect webhook URL or in-cluster service target for external endpoints.
- Hunt for pod mutations or blocked security deployments after the change.

### False positives

- Approved controller upgrades during change windows.

## Setup

The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."""
references = [
    "https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/",
]
risk_score = 47
rule_id = "4886ce11-fca5-433f-bbb9-e33e410ef9ae"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Kubernetes",
    "Data Source: GCP",
    "Data Source: Google Cloud Platform",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:gcp.audit and event.outcome:success and event.action:(
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.create" or
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.update" or
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.patch" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.create" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.update" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.patch"
) and not user.email:(
  "system:kube-controller-manager" or "system:kube-scheduler" or system\:serviceaccount\:kube-system\:* or
  system\:serviceaccount\:gke-managed-system\:* or system\:serviceaccount\:cert-manager\:* or
  system\:serviceaccount\:gatekeeper-system\:* or system\:serviceaccount\:kyverno\:* or "system:addon-manager" or
  *-operator or *-cainjector or *-webhook or *argocd* or "system:gke-common-webhooks"
)
'''

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

[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"

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

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

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

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

Stages and Predicates

Stage 1: query

data_stream.dataset:gcp.audit and event.outcome:success and event.action:(
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.create" or
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.update" or
  "io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.patch" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.create" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.update" or
  "io.k8s.admissionregistration.v1.validatingwebhookconfigurations.patch"
) and not user.email:(
  "system:kube-controller-manager" or "system:kube-scheduler" or system\:serviceaccount\:kube-system\:* or
  system\:serviceaccount\:gke-managed-system\:* or system\:serviceaccount\:cert-manager\:* or
  system\:serviceaccount\:gatekeeper-system\:* or system\:serviceaccount\:kyverno\:* or "system:addon-manager" or
  *-operator or *-cainjector or *-webhook or *argocd* or "system:gke-common-webhooks"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
data_stream.dataseteq
  • gcp.audit corpus 60 (elastic 60)
field:"data_stream.dataset" kind:eq value:"gcp.audit"
event.actionin
  • io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.create
  • io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.patch
  • io.k8s.admissionregistration.v1.mutatingwebhookconfigurations.update
  • io.k8s.admissionregistration.v1.validatingwebhookconfigurations.create
  • io.k8s.admissionregistration.v1.validatingwebhookconfigurations.patch
  • io.k8s.admissionregistration.v1.validatingwebhookconfigurations.update
field:"EventType" kind:in
event.outcomeeq
  • success corpus 306 (elastic 306)
field:"event.outcome" kind:eq value:"success"

Exclusions

The rule actively suppresses these predicates.

M365 Exchange Mailbox Items Accessed Excessively

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

Identifies an excessive number of Microsoft 365 mailbox items accessed by a user either via aggregated counts or throttling. Microsoft audits mailbox access via the MailItemsAccessed event, which is triggered when a user accesses mailbox items. If more than 1000 mailbox items are accessed within a 24-hour period, it is then throttled. Excessive mailbox access may indicate an adversary attempting to exfiltrate sensitive information or perform reconnaissance on a target's mailbox. This rule detects both the throttled and unthrottled events with a high threshold.

Known False Positives

  • Legitimate users may access a large number of mailbox items in a short period, especially in environments with high email volume or during data migrations. If this is expected behavior, consider adjusting the rule or adding exceptions for specific users or groups.

MITRE ATT&CK Coverage

Telemetry Coverage

PlatformRecord / event type
Microsoft 365MailItemsAccessed

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2025/06/17"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies an excessive number of Microsoft 365 mailbox items accessed by a user either via aggregated counts or
throttling. Microsoft audits mailbox access via the MailItemsAccessed event, which is triggered when a user accesses
mailbox items. If more than 1000 mailbox items are accessed within a 24-hour period, it is then throttled. Excessive
mailbox access may indicate an adversary attempting to exfiltrate sensitive information or perform reconnaissance on a
target's mailbox. This rule detects both the throttled and unthrottled events with a high threshold.
"""
false_positives = [
    """
    Legitimate users may access a large number of mailbox items in a short period, especially in environments with high
    email volume or during data migrations. If this is expected behavior, consider adjusting the rule or adding
    exceptions for specific users or groups.
    """,
]
from = "now-9m"
index = ["filebeat-*", "logs-o365.audit-*"]
language = "kuery"
license = "Elastic License v2"
name = "M365 Exchange Mailbox Items Accessed Excessively"
note = """## Triage and analysis

### Investigating M365 Exchange Mailbox Items Accessed Excessively

Identifies an excessive number of Microsoft 365 mailbox items accessed by a user either via aggregated counts or throttling. Microsoft audits mailbox access via the MailItemsAccessed event, which is triggered when a user accesses mailbox items. If more than 1000 mailbox items are accessed within a 24-hour period, it is then throttled. Excessive mailbox access may indicate an adversary attempting to exfiltrate sensitive information or perform reconnaissance on a target's mailbox. This rule detects both the throttled and unthrottled events with a high threshold.

### Possible investigation steps
- Review `host.name` to identify the tenant where the mailbox access occurred.
- Review `o365.audit.UserId` or `o365.audit.MailboxOwnerUPN` to identify the user associated with the mailbox access.
- Examine `o365.audit.ExternalAccess` to determine if the mailbox access was performed by an external user or application.
- Check the geolocation data to identify the location from which the mailbox access occurred. Is this an expected location for the user?
- Check `o365.audit.ClientAppId` to identify the application used for mailbox access. Look for any unusual or unexpected applications but be aware that some legitimate applications may also trigger this rule if OAuth phishing was used.
- Review `o365.audit.Folders.Path` and `o365.audit.Folders.FolderItems.Id` to identify the specific folders and items accessed within the mailbox. Look for any sensitive or high-value folders that may indicate targeted access.
- For specific items accessed, examine `o365.audit.Folders.FolderItems.Id` to gather more context on the accessed mailbox items.
- User types can be identified by checking `o365.audit.UserType`. Review if the mailbox of the user is a member, admin or delegate.
- If Entra ID logs are available, checking the risk status via `azure.signinlogs.properties.risk_state` and `azure.signinlogs.properties.risk_level` can provide additional context on the user's risk status during the mailbox access.

### False positive analysis
- Legitimate users may access a large number of mailbox items in a short period, especially in environments with high email volume or during data migrations. If this is expected behavior, consider adjusting the rule or adding exceptions for specific users or groups.
- Automated processes or scripts that access mailbox items may also trigger this rule. If these processes are legitimate and necessary, consider adding exceptions for the specific applications or users involved.
- Users with high email activity, such as helpdesk or support roles, may trigger this rule due to their job responsibilities. If this is expected behavior, consider adjusting the rule or adding exceptions for specific users or groups.

### Response and remediation
- Investigate the user account associated with the excessive mailbox access to determine if it has been compromised or if the activity is expected behavior.
- If the mailbox access is confirmed to be suspicious or unauthorized, take immediate action to revoke the access token and prevent further access.
- Disable the user account temporarily to prevent any potential compromise or unauthorized access.
- Review the user's recent sign-in activity and access patterns to identify any potential compromise or unauthorized access.
- If the user account is compromised, initiate a password reset and enforce multi-factor authentication (MFA) for the user.
- Review the conditional access policies in place to ensure they are sufficient to prevent unauthorized access to sensitive resources.
- Examine how the mailbox access was performed. If it was done via a third-party application, review the permissions granted to that application and consider revoking them if they are not necessary.
"""
references = [
    "https://learn.microsoft.com/en-us/purview/audit-log-investigate-accounts#use-mailitemsaccessed-audit-records-for-forensic-investigations",
    "https://www.microsoft.com/en-us/security/blog/2025/05/27/new-russia-affiliated-actor-void-blizzard-targets-critical-sectors-for-espionage/",
]
risk_score = 47
rule_id = "7fc95782-4bd1-11f0-9838-f661ea17fbcd"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: Email",
    "Data Source: Microsoft 365",
    "Data Source: Microsoft 365 Audit Logs",
    "Use Case: Threat Detection",
    "Tactic: Collection",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset: "o365.audit" and
    event.provider: "Exchange" and
    event.action: "MailItemsAccessed" and
    event.code: "ExchangeItemAggregated" and
    (
        (
            o365.audit.OperationProperties.Name: "IsThrottled" and
            o365.audit.OperationProperties.Value: "True"
        ) or o365.audit.OperationCount >= 100
    )
'''


[[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.002"
name = "Remote Email Collection"
reference = "https://attack.mitre.org/techniques/T1114/002/"



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

[rule.investigation_fields]
field_names = [
    "user.id",
    "user.name",
    "user.email",
    "user.domain",
    "event.id",
    "event.action",
    "event.outcome",
    "event.provider",
    "source.ip",
    "related.ip",
    "related.user",
    "o365.audit.ClientAppId",
    "o365.audit.AppId",
    "o365.audit.AppAccessContext.UniqueTokenId",
    "o365.audit.OperationCount",
    "o365.audit.MailboxOwnerUPN",
    "o365.audit.MailboxOwnerSid",
    "o365.audit.MailboxGuid",
    "o365.audit.UserKey",
    "o365.audit.LogonUserSid",
    "o365.audit.TokenTenantId",
    "o365.audit.OriginatingServer",
    "o365.audit.ClientInfoString",
    "o365.audit.CreationTime",
    "o365.audit.ResultStatus",
    "source.geo.country_iso_code",
    "source.geo.country_name",
    "source.geo.continent_name",
    "source.geo.location",
    "cloud.account.id",
    "cloud.provider",
    "cloud.region",
    "cloud.service.name",
]

Stages and Predicates

Stage 1: query

data_stream.dataset: "o365.audit" and
    event.provider: "Exchange" and
    event.action: "MailItemsAccessed" and
    event.code: "ExchangeItemAggregated" and
    (
        (
            o365.audit.OperationProperties.Name: "IsThrottled" and
            o365.audit.OperationProperties.Value: "True"
        ) or o365.audit.OperationCount >= 100
    )

Indicators

These rows show field, operator, and value matches.

Manual Dracut Execution

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

This rule detects manual execution of the "dracut" command on Linux systems. Dracut is a tool used to generate an initramfs image that is used to boot the system. Attackers may use "dracut" to create a custom initramfs image that includes malicious code or backdoors, allowing them to maintain persistence on the system.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
This rule detects manual execution of the "dracut" command on Linux systems. Dracut is a tool used to generate an
initramfs image that is used to boot the system. Attackers may use "dracut" to create a custom initramfs image that
includes malicious code or backdoors, allowing them to maintain persistence on the system.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-crowdstrike.fdr*",
    "logs-endpoint.events.process*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Manual Dracut Execution"
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 Dracut Execution

Dracut is a utility in Linux systems used to create initramfs images, essential for booting. Adversaries might exploit Dracut to craft malicious initramfs, embedding backdoors for persistence. The detection rule identifies unusual Dracut executions by scrutinizing process origins and excluding legitimate parent processes, flagging potential unauthorized use.

### Possible investigation steps

- Review the process details to confirm the execution of the dracut command, focusing on the process.name and process.parent.executable fields to identify any unusual parent processes.
- Examine the command line arguments used with the dracut process by checking the process.parent.command_line field to understand the context of its execution.
- Investigate the user account associated with the dracut execution to determine if it aligns with expected administrative activity or if it indicates potential unauthorized access.
- Check the system logs and any related security alerts around the time of the dracut execution to identify any correlated suspicious activities or anomalies.
- Assess the system for any changes to the initramfs image or other boot-related files that could indicate tampering or the presence of backdoors.

### False positive analysis

- Legitimate system updates or kernel installations may trigger the rule. To handle this, users can create exceptions for processes originating from known update paths like /usr/lib/kernel/* or /etc/kernel/install.d/*.
- Automated scripts or maintenance tasks that use dracut for legitimate purposes might be flagged. Users should identify these scripts and add their parent process names, such as dracut-install or run-parts, to the exclusion list.
- Custom administrative scripts executed by trusted users could be mistaken for suspicious activity. Users can exclude specific command lines or arguments associated with these scripts, such as /usr/bin/dracut-rebuild, to prevent false positives.
- Temporary or testing environments where dracut is used for non-malicious testing purposes might trigger alerts. Users can exclude these environments by specifying unique parent process paths or names that are characteristic of the testing setup.

### Response and remediation

- Immediately isolate the affected system from the network to prevent potential lateral movement or data exfiltration by the adversary.
- Terminate any suspicious or unauthorized dracut processes identified on the system to halt any ongoing malicious activity.
- Conduct a thorough review of the initramfs images on the affected system to identify and remove any unauthorized or malicious modifications.
- Restore the system's initramfs from a known good backup to ensure the integrity of the boot process.
- Implement monitoring for any future unauthorized dracut executions by setting up alerts for similar process activities, ensuring quick detection and response.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Review and update access controls and permissions to limit the ability to execute dracut to only authorized personnel, reducing the risk of future exploitation."""
risk_score = 21
rule_id = "834ee026-f9f9-4ec7-b5e0-7fbfe84765f4"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Execution",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Crowdstrike",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.name == "dracut" and process.parent.executable != null and not (
  process.parent.executable like (
    "/usr/lib/kernel/*", "/etc/kernel/install.d/*", "/var/lib/dpkg/info/dracut.postinst",
    "/tmp/newroot/*", "/usr/lib/module-init-tools/*", "/usr/bin/xargs", "/sbin/dkms",
    "/sbin/mkinitrd", "/usr/bin/timeout", "/usr/sbin/dkms", "/usr/bin/systemd-inhibit"
  ) or
  process.parent.name in (
    "dracut-install", "dracut", "run-parts", "weak-modules", "mkdumprd", "new-kernel-pkg", "sudo"
  ) or
  process.parent.args like~ ("/usr/bin/dracut-rebuild", "/var/tmp/rpm-tmp.*") or
  process.parent.command_line like~ "/bin/sh -c if command -v mkinitcpio*"
)
'''

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

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

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

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

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

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

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

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

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

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.name == "dracut" and process.parent.executable != null and not (
  process.parent.executable like (
    "/usr/lib/kernel/*", "/etc/kernel/install.d/*", "/var/lib/dpkg/info/dracut.postinst",
    "/tmp/newroot/*", "/usr/lib/module-init-tools/*", "/usr/bin/xargs", "/sbin/dkms",
    "/sbin/mkinitrd", "/usr/bin/timeout", "/usr/sbin/dkms", "/usr/bin/systemd-inhibit"
  ) or
  process.parent.name in (
    "dracut-install", "dracut", "run-parts", "weak-modules", "mkdumprd", "new-kernel-pkg", "sudo"
  ) or
  process.parent.args like~ ("/usr/bin/dracut-rebuild", "/var/tmp/rpm-tmp.*") or
  process.parent.command_line like~ "/bin/sh -c if command -v mkinitcpio*"
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.argswildcard/usr/bin/dracut-rebuild, /var/tmp/rpm-tmp.*excludes:process.parent.args field:"process.parent.args" value:"/usr/bin/dracut-rebuild" field:"process.parent.args" value:"/var/tmp/rpm-tmp.*"
process.parent.command_linestarts_with/bin/sh -c if command -v mkinitcpioexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/sh -c if command -v mkinitcpio"
process.parent.executablewildcard/usr/lib/kernel/*, /etc/kernel/install.d/*, /var/lib/dpkg/info/dracut.postinst, /tmp/newroot/*, /usr/lib/module-init-tools/*, /usr/bin/xargs, /sbin/dkms, /sbin/mkinitrd, /usr/bin/timeout, /usr/sbin/dkms, /usr/bin/systemd-inhibitexcludes:process.parent.executable
process.parent.nameindracut, dracut-install, mkdumprd, new-kernel-pkg, run-parts, sudo, weak-modulesexcludes:process.parent.name

Multiple Device Token Hashes for Single Okta Session

#
Status
production
Severity
medium
Time window
9m
Group by
okta.actor.alternate_id, okta.authentication_context.external_session_id
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects when a specific Okta actor has multiple device token hashes and multiple source IPs for a single Okta session. This may indicate an authenticated session has been hijacked or replayed from a different device and network. Adversaries may steal session cookies or tokens to gain unauthorized access to Okta admin console, applications, tenants, or other resources.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/11/08"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/13"

[rule]
author = ["Elastic"]
description = """
This rule detects when a specific Okta actor has multiple device token hashes and multiple source IPs for a single Okta
session. This may indicate an authenticated session has been hijacked or replayed from a different device and network.
Adversaries may steal session cookies or tokens to gain unauthorized access to Okta admin console, applications,
tenants, or other resources.
"""
from = "now-9m"
interval = "8m"
language = "esql"
license = "Elastic License v2"
name = "Multiple Device Token Hashes for Single Okta Session"
note = """## Triage and analysis

### Investigating Multiple Device Token Hashes for Single Okta Session

This rule detects when a specific Okta actor has multiple device token hashes and multiple source IPs for a single Okta session. This may indicate an authenticated session has been hijacked or replayed from a different device and network. Adversaries may steal session cookies or tokens to gain unauthorized access to Okta admin console, applications, tenants, or other resources.

> **Note**: This is an ES|QL aggregation-based rule. Exceptions can be added on the original ECS or integration-related fields. We recommend using the indicators from the alert document to pivot into the raw events for analysis.

#### Possible investigation steps:
- Use `okta.actor.alternate_id` and `okta.authentication_context.external_session_id` from the alert to pivot into the raw Okta system log events for the affected session.
- Review the source IPs (`okta.client.ip`) and ASN information (`source.as.organization.name`) to determine if the session was used from multiple distinct networks.
    - Multiple ASNs or geolocations (`client.geo.country_name`, `client.geo.city_name`) within the same session strongly suggest session hijacking.
- Compare the `okta.debug_context.debug_data.dt_hash` values to identify the device token hashes associated with the session.
    - A legitimate session should have a consistent device token hash. Multiple distinct hashes indicate the session cookie may have been replayed from a different device.
- Examine `okta.client.user_agent.raw_user_agent` and `okta.client.device` for inconsistencies that suggest different devices or browsers using the same session.
- Review `event.action` to understand what actions were performed during the session.
    - Look for suspicious post-authentication activity such as admin console access, policy changes, or application assignment modifications.
- Check `okta.debug_context.debug_data.risk_level`, `okta.debug_context.debug_data.risk_reasons`, and `okta.debug_context.debug_data.behaviors` for Okta's own risk assessment of the session activity.
- Review the past activities of the actor(s) involved by checking their previous sessions and login patterns.

### False positive analysis:
- OAuth application integrations (e.g., backend services exchanging authorization codes for tokens) can generate multiple device token hashes per session due to the multi-step token grant flow. These typically involve `Okta-Integrations` user agents and known infrastructure IPs.
- Users switching between networks (e.g., VPN reconnects, WiFi to cellular transitions) may produce multiple source IPs for the same session, though the device token hash should remain consistent.
- Automated tools or scripts that interact with Okta APIs on behalf of a user may generate additional device token hashes.

### Response and remediation:
- If the alert shows multiple distinct ASNs or geolocations for the same session, immediately revoke all active sessions for the affected user via the Okta admin console.
- Reset the user's password and all active MFA factors.
    - If MFA is not enabled, enforce MFA enrollment before allowing re-authentication.
- Review Okta system logs for any administrative or sensitive actions performed during the suspicious session window.
- If the session was used to access downstream applications, review those application logs for unauthorized activity.
- Check with the user to confirm whether they were actively using Okta during the alert time window.
- For recurring false positives from known integrations, add exceptions on `okta.actor.alternate_id` for the specific service account or application client ID.
"""
references = [
    "https://developer.okta.com/docs/reference/api/system-log/",
    "https://developer.okta.com/docs/reference/api/event-types/",
    "https://www.elastic.co/security-labs/testing-okta-visibility-and-detection-dorothy",
    "https://sec.okta.com/articles/2023/08/cross-tenant-impersonation-prevention-and-detection",
    "https://support.okta.com/help/s/article/session-hijacking-attack-definition-damage-defense?language=en_US",
    "https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
    "https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
]
risk_score = 47
rule_id = "cc382a2e-7e52-11ee-9aac-f661ea17fbcd"
severity = "medium"
tags = [
    "Domain: Identity",
    "Domain: SaaS",
    "Data Source: Okta",
    "Data Source: Okta System Logs",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-okta.system-*
| where
    data_stream.dataset == "okta.system" and
    not event.action in (
        "policy.evaluate_sign_on",
        "user.session.start",
        "user.authentication.sso"
    ) and
    okta.actor.alternate_id != "system@okta.com" and
    okta.actor.alternate_id rlike "[^@\\s]+\\@[^@\\s]+" and
    okta.authentication_context.external_session_id != "unknown" and
    (
        okta.authentication_context.external_session_id IS NOT NULL and
        okta.debug_context.debug_data.dt_hash IS NOT NULL and
        okta.client.ip IS NOT NULL and
        okta.client.user_agent.raw_user_agent IS NOT NULL
    ) and
    (
        okta.authentication_context.external_session_id != "-" and
        okta.debug_context.debug_data.dt_hash != "-" and
        okta.client.user_agent.raw_user_agent != "-"
    )
| stats
    Esql.dt_hash_count_distinct = count_distinct(okta.debug_context.debug_data.dt_hash),
    Esql.client_ip_count_distinct = count_distinct(okta.client.ip),
    Esql.event_count = count(*),
    Esql.first_event_time = min(@timestamp),
    Esql.last_event_time = max(@timestamp),
    Esql.dt_hash_values = values(okta.debug_context.debug_data.dt_hash),
    Esql.event_action_values = values(event.action),
    Esql.client_ip_values = values(okta.client.ip),
    Esql.user_agent_values = values(okta.client.user_agent.raw_user_agent),
    Esql.device_values = values(okta.client.device),
    Esql.is_proxy_values = values(okta.security_context.is_proxy),
    Esql.geo_country_name_values = values(client.geo.country_name),
    Esql.geo_city_name_values = values(client.geo.city_name),
    Esql.source_asn_number_values = values(source.`as`.number),
    Esql.source_asn_org_name_values = values(source.`as`.organization.name),
    Esql.threat_suspected_values = values(okta.debug_context.debug_data.threat_suspected),
    Esql.risk_level_values = values(okta.debug_context.debug_data.risk_level),
    Esql.risk_reasons_values = values(okta.debug_context.debug_data.risk_reasons),
    Esql.behaviors_values = values(okta.debug_context.debug_data.behaviors),
    Esql.device_fingerprint_values = values(okta.debug_context.debug_data.device_fingerprint),
    Esql.risk_behaviors_values = values(okta.debug_context.debug_data.risk_behaviors),
    Esql.request_uri_values = values(okta.debug_context.debug_data.request_uri)
  by
    okta.actor.alternate_id,
    okta.authentication_context.external_session_id
| where
    Esql.dt_hash_count_distinct >= 4 and
    Esql.client_ip_count_distinct >= 2
| keep Esql.*, okta.*
'''


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

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

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

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

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

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

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

Stages and Predicates

Stage 1: from

from logs-okta.system-*

Stage 2: where

| where
    data_stream.dataset == "okta.system" and
    not event.action in (
        "policy.evaluate_sign_on",
        "user.session.start",
        "user.authentication.sso"
    ) and
    okta.actor.alternate_id != "system@okta.com" and
    okta.actor.alternate_id rlike "[^@\\s]+\\@[^@\\s]+" and
    okta.authentication_context.external_session_id != "unknown" and
    (
        okta.authentication_context.external_session_id IS NOT NULL and
        okta.debug_context.debug_data.dt_hash IS NOT NULL and
        okta.client.ip IS NOT NULL and
        okta.client.user_agent.raw_user_agent IS NOT NULL
    ) and
    (
        okta.authentication_context.external_session_id != "-" and
        okta.debug_context.debug_data.dt_hash != "-" and
        okta.client.user_agent.raw_user_agent != "-"
    )

Stage 3: stats

| stats
    Esql.dt_hash_count_distinct = count_distinct(okta.debug_context.debug_data.dt_hash),
    Esql.client_ip_count_distinct = count_distinct(okta.client.ip),
    Esql.event_count = count(*),
    Esql.first_event_time = min(@timestamp),
    Esql.last_event_time = max(@timestamp),
    Esql.dt_hash_values = values(okta.debug_context.debug_data.dt_hash),
    Esql.event_action_values = values(event.action),
    Esql.client_ip_values = values(okta.client.ip),
    Esql.user_agent_values = values(okta.client.user_agent.raw_user_agent),
    Esql.device_values = values(okta.client.device),
    Esql.is_proxy_values = values(okta.security_context.is_proxy),
    Esql.geo_country_name_values = values(client.geo.country_name),
    Esql.geo_city_name_values = values(client.geo.city_name),
    Esql.source_asn_number_values = values(source.`as`.number),
    Esql.source_asn_org_name_values = values(source.`as`.organization.name),
    Esql.threat_suspected_values = values(okta.debug_context.debug_data.threat_suspected),
    Esql.risk_level_values = values(okta.debug_context.debug_data.risk_level),
    Esql.risk_reasons_values = values(okta.debug_context.debug_data.risk_reasons),
    Esql.behaviors_values = values(okta.debug_context.debug_data.behaviors),
    Esql.device_fingerprint_values = values(okta.debug_context.debug_data.device_fingerprint),
    Esql.risk_behaviors_values = values(okta.debug_context.debug_data.risk_behaviors),
    Esql.request_uri_values = values(okta.debug_context.debug_data.request_uri)
  by
    okta.actor.alternate_id,
    okta.authentication_context.external_session_id

Stage 4: where

| where
    Esql.dt_hash_count_distinct >= 4 and
    Esql.client_ip_count_distinct >= 2

Stage 5: keep

| keep Esql.*, okta.*

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
event.actioninpolicy.evaluate_sign_on, user.authentication.sso, user.session.startexcludes:event.action field:"event.action" value:"policy.evaluate_sign_on" field:"event.action" value:"user.authentication.sso" field:"event.action" value:"user.session.start"

Output Fields

These fields are emitted when the rule matches.

FieldSource
Esql.*KEEP Esql.*
okta.*KEEP okta.*

Network Connection via MsXsl

#
Status
production
Severity
low
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies msxsl.exe making a network connection. This may indicate adversarial activity as msxsl.exe is often leveraged by adversaries to execute malicious scripts and evade detection.

MITRE ATT&CK Coverage

TacticTechniques
Stealth
Command & Control

Telemetry Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies msxsl.exe making a network connection. This may indicate adversarial activity as msxsl.exe is often leveraged
by adversaries to execute malicious scripts and evade detection.
"""
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.process-*",
    "logs-endpoint.events.network-*",
    "logs-windows.sysmon_operational-*",
    "logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Network Connection via MsXsl"
note = """## Triage and analysis

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

### Investigating Network Connection via MsXsl

MsXsl.exe is a legitimate Windows utility used to transform XML data using XSLT stylesheets. Adversaries exploit it to execute malicious scripts, bypassing security measures. The detection rule identifies suspicious network activity by MsXsl.exe, focusing on connections to non-local IPs, which may indicate unauthorized data exfiltration or command-and-control communication.

### Possible investigation steps

- Review the process execution details for msxsl.exe, focusing on the process.entity_id and event.type fields to confirm the process start event and gather initial context.
- Analyze the network connection details, particularly the destination.ip field, to identify the external IP address msxsl.exe attempted to connect to and assess its reputation or any known associations with malicious activity.
- Check for any related alerts or logs involving the same process.entity_id to determine if msxsl.exe has been involved in other suspicious activities or if there are patterns of behavior indicating a broader attack.
- Investigate the parent process of msxsl.exe to understand how it was launched and whether it was initiated by a legitimate application or a potentially malicious script.
- Examine the system for any additional indicators of compromise, such as unusual file modifications or other processes making unexpected network connections, to assess the scope of potential adversarial activity.

### False positive analysis

- Legitimate use of msxsl.exe for XML transformations in enterprise applications may trigger alerts. Users should identify and whitelist known applications or processes that use msxsl.exe for legitimate purposes.
- Automated scripts or scheduled tasks that utilize msxsl.exe for data processing can cause false positives. Review and document these tasks, then create exceptions for their network activity.
- Development or testing environments where msxsl.exe is used for debugging or testing XML transformations might be flagged. Ensure these environments are recognized and excluded from monitoring if they are verified as non-threatening.
- Internal network tools or monitoring solutions that leverage msxsl.exe for legitimate network communications should be identified. Add these tools to an exception list to prevent unnecessary alerts.
- Regularly review and update the list of excluded IP addresses to ensure that only trusted and verified internal IPs are exempt from triggering the rule.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized data exfiltration or command-and-control communication.
- Terminate the msxsl.exe process if it is still running to stop any ongoing malicious activity.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any malicious scripts or files associated with msxsl.exe.
- Review and analyze the network logs to identify any other systems that may have been targeted or compromised by similar activity.
- Restore the affected system from a known good backup if any critical system files or configurations have been altered.
- Implement network segmentation to limit the ability of msxsl.exe or similar utilities to make unauthorized external connections in the future.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems or data have been impacted."""
references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
risk_score = 21
rule_id = "b86afe07-0d98-4738-b15d-8d7465f95ff5"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by process.entity_id
  [process where host.os.type == "windows" and process.name : "msxsl.exe" and event.type == "start"]
  [network where host.os.type == "windows" and process.name : "msxsl.exe" and
     not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.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")]
'''

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:

- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Sysmon Event ID 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
"""


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

[[rule.threat.technique]]
id = "T1220"
name = "XSL Script Processing"
reference = "https://attack.mitre.org/techniques/T1220/"

[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 = "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/"

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "windows" and process.name : "msxsl.exe" and event.type == "start"]

Stage 2: network

[network where host.os.type == "windows" and process.name : "msxsl.exe" and
     not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.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")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.namewildcard
  • msxsl.exe corpus 22 (elastic 22)
field:"process_basename" kind:wildcard value:"msxsl.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match10.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::/8excludes:destination.ip

Persistence via MSDTC Service Hijack

#
Source
github.com/elastic/protections-artifacts

Detects attempts to hijack the execution of the MSDTC Windows service via the OracleOciLib registry key modification forcing to load a random library.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects attempts to hijack the execution of the MSDTC Windows service via the OracleOciLib registry key modification
forcing to load a random library.
"""
id = "aa2a4cd9-0b08-4783-b94e-f65fca46566a"
license = "Elastic License v2"
name = "Persistence via MSDTC Service Hijack"
os_list = ["windows"]
reference = [
    "https://www.trendmicro.com/en_sg/research/19/l/waterbear-is-back-uses-api-hooking-to-evade-security-product-detection.html",
]
version = "1.0.3"

query = '''
library where process.executable : "?:\\Windows\\System32\\msdtc.exe" and
 not dll.code_signature.status : "trusted" and user.id : "S-1-5-20" and
 (dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000) and
 process.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|mtxoci.dll*"
'''

min_endpoint_version = "8.7.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"


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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: library

library where process.executable : "?:\\Windows\\System32\\msdtc.exe" and
 not dll.code_signature.status : "trusted" and user.id : "S-1-5-20" and
 (dll.Ext.relative_file_creation_time < 5000 or dll.Ext.relative_file_name_modify_time < 5000) and
 process.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|mtxoci.dll*"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuseqtrustedexcludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted"

Possible JAVA Reverse Shell

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

Identifies the execution of a shell process from a Java JAR application post an incoming network connection. This behavior may indicate a reverse shell activity via malicious Java application.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the execution of a shell process from a Java JAR application post an incoming network connection. This
behavior may indicate a reverse shell activity via malicious Java application.
"""
id = "41dcfe9e-9170-4ffe-b620-351736366ced"
license = "Elastic License v2"
name = "Possible JAVA Reverse Shell"
os_list = ["macos"]
version = "1.0.10"

query = '''
sequence with maxspan=5s
[network where event.action in ("connection_accepted", "connection_attempted") and 
 process.name in ("java", "javaw")] by process.entity_id
[process where event.action == "start" and process.parent.name like "java" and
 process.parent.args like~ "-jar" and
 process.name in ("bash", "sh", "zsh")] by process.parent.entity_id
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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 = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"


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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

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

Stage 1: network

[network where event.action in ("connection_accepted", "connection_attempted") and 
 process.name in ("java", "javaw")] by process.entity_id

Stage 2: process

[process where event.action == "start" and process.parent.name like "java" and
 process.parent.args like~ "-jar" and
 process.name in ("bash", "sh", "zsh")] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Potential ClickFix Attack via Windows Terminal

#
Source
github.com/elastic/protections-artifacts

Detects a ClickFix-style attack where a user pastes a malicious PowerShell command into Windows Terminal after being tricked by a fake human verification, reCAPTCHA, CAPTCHA, or Turnstile confirmation prompt. Adversaries increasingly abuse Windows Terminal as an alternative to the Windows Run dialog to evade registry-based detections, often spoofing Cloudflare or Google verification pages and using Terminal customization to make the lure appear legitimate.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects a ClickFix-style attack where a user pastes a malicious PowerShell command into Windows Terminal after being
tricked by a fake human verification, reCAPTCHA, CAPTCHA, or Turnstile confirmation prompt. Adversaries increasingly
abuse Windows Terminal as an alternative to the Windows Run dialog to evade registry-based detections, often spoofing
Cloudflare or Google verification pages and using Terminal customization to make the lure appear legitimate.
"""
id = "c3884320-f423-4d44-aa55-08bd99237ce4"
license = "Elastic License v2"
name = "Potential ClickFix Attack via Windows Terminal"
os_list = ["windows"]
reference = [
    "https://www.microsoft.com/en-us/security/blog/2025/08/21/think-before-you-clickfix-analyzing-the-clickfix-social-engineering-technique/",
    "https://detect.fyi/hunting-clickfix-win-x-variants-ff06e4c62bd9",
    "https://www.securityweek.com/clickfix-attack-uses-windows-terminal-to-evade-detection/",
]
version = "1.0.1"

query = '''
api where process.Ext.api.name == "AmsiScanBuffer" and
  process.name == "powershell.exe" and
  process.parent.executable : "?:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_*\\WindowsTerminal.exe" and
  process.Ext.api.parameters.buffer : (
    "*not a robot*",
    "*<#Verification ID*",
    "*<#Verification UID*",
    "*<#Verification Code*",
    "*Verify*Human*",
    "*Microsoft Defender Services Secure Access*",
    "*Enter to verify*",
    "*challenge.cloudflare.com*",
    "*confirmChallenge*",
    "*Human verif*",
    "*Checking your browser*",
    "*Just a moment*"
  )
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"


[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.001"
name = "Malicious Link"
reference = "https://attack.mitre.org/techniques/T1204/001/"



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

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name == "AmsiScanBuffer" and
  process.name == "powershell.exe" and
  process.parent.executable : "?:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_*\\WindowsTerminal.exe" and
  process.Ext.api.parameters.buffer : (
    "*not a robot*",
    "*<#Verification ID*",
    "*<#Verification UID*",
    "*<#Verification Code*",
    "*Verify*Human*",
    "*Microsoft Defender Services Secure Access*",
    "*Enter to verify*",
    "*challenge.cloudflare.com*",
    "*confirmChallenge*",
    "*Human verif*",
    "*Checking your browser*",
    "*Just a moment*"
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • AmsiScanBuffer corpus 18 (elastic 18)
field:"process.Ext.api.name" kind:eq value:"AmsiScanBuffer"
process.Ext.api.parameters.bufferwildcard
  • *<#Verification Code*
  • *<#Verification ID*
  • *<#Verification UID*
  • *Checking your browser*
  • *Enter to verify*
  • *Human verif*
  • *Just a moment*
  • *Microsoft Defender Services Secure Access*
  • *Verify*Human*
  • *challenge.cloudflare.com*
  • *confirmChallenge*
  • *not a robot*
field:"process.Ext.api.parameters.buffer" kind:wildcard
process.nameeq
  • powershell.exe corpus 3 (elastic 3)
field:"process_basename" kind:eq value:"powershell.exe"
process.parent.executablewildcard
  • ?:\Program Files\WindowsApps\Microsoft.WindowsTerminal_*\WindowsTerminal.exe corpus 2 (elastic 2)
field:"ParentImage" kind:wildcard value:"?:\Program Files\WindowsApps\Microsoft.WindowsTerminal_*\WindowsTerminal.exe"

Potential DLL SideLoad via a Microsoft Signed Binary

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to load an unsigned DLL from a mounted virtual disk (.iso, .vhd) and by a signed Microsoft binary. This may indicate an attempt to sideload a malicious DLL to stealthily execute code.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to load an unsigned DLL from a mounted virtual disk (.iso, .vhd) and by a signed Microsoft binary.
This may indicate an attempt to sideload a malicious DLL to stealthily execute code.
"""
id = "ba802fb2-f183-420e-947b-da5ce0c74dd3"
license = "Elastic License v2"
name = "Potential DLL SideLoad via a Microsoft Signed Binary"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.27"

query = '''
/* MS bin used as DLL sideloading target from an ISO/DMG/VHD archive */
library where
  (dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not dll.path : "C:\\*") and
  process.code_signature.subject_name : "Microsoft*" and
  not dll.code_signature.status : ("trusted", "errorCode_endpoint*") and
  not process.executable : "C:\\*" and
  not startswith~(dll.name, process.name) and
  not dll.hash.sha256 :
              ("94555c70cf6376c645c6f7277d0cf61f8b50add7fe0b8b17b6d5f222589689b6",
               "9b594093385a5f3f23e8bb2112d0ee5df93b4cf6f95515909d4fbea22e4283aa",
               "d668366c74f476d73fc0e00b00433ce3e2ccff7b18a525cf41758b7c3c495ea3",
               "0924c7a3f02eee3b0b6f1b4d9c22cd3c7e914d57fcd07a707d56e0cb04d66e7a",
               "6ee2c087b7c55b7fea604515fd47eb20a7a531854da8a7c010744743cb937f6a",
               "c048df2f3928f57f27951e5d917f90b788b1881948d98379c8772423d91fc4fb",
               "3c30e83ae1150ae8efd52d652af227948cc8d8107c99d313084a3f4c3a0545c7",
               "0b8094f76dbe2621cef9f6340bf4225d49ac847b8fd5c7b3456256fdb31141de",
               "69326fd2322db837d680d3fd0d61ca4de77eac3ba96306bad8c12b64c922880f",
               "6a6299dc667bedfa449f374931d1990cd19c3b23e2e603562b7f9d2c42e37f62")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"



[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: library

library where
  (dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk") and not dll.path : "C:\\*") and
  process.code_signature.subject_name : "Microsoft*" and
  not dll.code_signature.status : ("trusted", "errorCode_endpoint*") and
  not process.executable : "C:\\*" and
  not startswith~(dll.name, process.name) and
  not dll.hash.sha256 :
              ("94555c70cf6376c645c6f7277d0cf61f8b50add7fe0b8b17b6d5f222589689b6",
               "9b594093385a5f3f23e8bb2112d0ee5df93b4cf6f95515909d4fbea22e4283aa",
               "d668366c74f476d73fc0e00b00433ce3e2ccff7b18a525cf41758b7c3c495ea3",
               "0924c7a3f02eee3b0b6f1b4d9c22cd3c7e914d57fcd07a707d56e0cb04d66e7a",
               "6ee2c087b7c55b7fea604515fd47eb20a7a531854da8a7c010744743cb937f6a",
               "c048df2f3928f57f27951e5d917f90b788b1881948d98379c8772423d91fc4fb",
               "3c30e83ae1150ae8efd52d652af227948cc8d8107c99d313084a3f4c3a0545c7",
               "0b8094f76dbe2621cef9f6340bf4225d49ac847b8fd5c7b3456256fdb31141de",
               "69326fd2322db837d680d3fd0d61ca4de77eac3ba96306bad8c12b64c922880f",
               "6a6299dc667bedfa449f374931d1990cd19c3b23e2e603562b7f9d2c42e37f62")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.device.product_idwildcard
  • Virtual DVD-ROM corpus 5 (elastic 5)
  • Virtual Disk corpus 5 (elastic 5)
field:"dll.Ext.device.product_id" kind:wildcard
process.code_signature.subject_namewildcard
  • Microsoft* corpus 19 (elastic 19)
field:"Signature" kind:wildcard value:"Microsoft*"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuswildcardtrusted, errorCode_endpoint*excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorCode_endpoint*"
dll.hash.sha256eq94555c70cf6376c645c6f7277d0cf61f8b50add7fe0b8b17b6d5f222589689b6, 9b594093385a5f3f23e8bb2112d0ee5df93b4cf6f95515909d4fbea22e4283aa, d668366c74f476d73fc0e00b00433ce3e2ccff7b18a525cf41758b7c3c495ea3, 0924c7a3f02eee3b0b6f1b4d9c22cd3c7e914d57fcd07a707d56e0cb04d66e7a, 6ee2c087b7c55b7fea604515fd47eb20a7a531854da8a7c010744743cb937f6a, c048df2f3928f57f27951e5d917f90b788b1881948d98379c8772423d91fc4fb, 3c30e83ae1150ae8efd52d652af227948cc8d8107c99d313084a3f4c3a0545c7, 0b8094f76dbe2621cef9f6340bf4225d49ac847b8fd5c7b3456256fdb31141de, 69326fd2322db837d680d3fd0d61ca4de77eac3ba96306bad8c12b64c922880f, 6a6299dc667bedfa449f374931d1990cd19c3b23e2e603562b7f9d2c42e37f62excludes:dll.hash.sha256
dll.namestarts_withprocess.nameexcludes:dll.name field:"dll.name" value:"process.name"
dll.pathstarts_withC:\excludes:dll.path field:"dll.path" value:"C:\"
process.executablestarts_withC:\excludes:process.executable field:"process.executable" value:"C:\"

Potential Privilege Escalation via a SUID/SGID Binary

#
Source
github.com/elastic/protections-artifacts

This rule detects potential privilege escalation under the root effective user when the real user and parent user are not root, indicative of the execution of binaries with SUID or SGID bits set. Attackers may abuse SUID/SGID binaries to escalate their privileges to root, using exploits or misconfigurations.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects potential privilege escalation under the root effective user when the real user and parent user are
not root, indicative of the execution of binaries with SUID or SGID bits set. Attackers may abuse SUID/SGID binaries to
escalate their privileges to root, using exploits or misconfigurations.
"""
id = "6ac2717b-a63d-4697-b01e-918388bdc762"
license = "Elastic License v2"
name = "Potential Privilege Escalation via a SUID/SGID Binary"
os_list = ["linux"]
version = "1.0.5"

query = '''
process where event.type == "start" and event.action == "exec" and (
  (process.user.id == 0 and process.real_user.id != 0 and process.parent.user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0 and process.parent.group.id != 0)
) and
(
  stringcontains(process.executable, process.command_line) or
  stringcontains(process.name, process.command_line)
) and
(
  process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*", "node", "deno", "bun", "java") or
  process.parent.executable like ("./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*") or
  (
    process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh") and
    process.parent.args in ("-c", "-cl", "-lc", "--command", "-ic", "-ci", "-bash", "-sh", "-zsh", "-dash", "-fish", "-ksh", "-mksh") and
    process.parent.args_count <= 4
  )
) and
not (
  /* Covered by b1d415dc-796a-48f1-944f-4bb6037b2450 */
  process.name in (
    "unix_chkpwd", "fusermount", "fusermount3", "umount", "newgrp", "chsh", "sudoedit", "gpasswd", "chfn", "polkit-agent-helper-1",
    "dbus-daemon-launch-helper", "ssh-keysign", "pam_extrausers_chkpwd", "expiry", "chage", "wall", "bsd-write", "ssh-agent",
    "ping6", "traceroute", "mtr", "ntfs-3g", "Xorg.wrap", "chrome-sandbox", "bwrap", "hostname", "sudo"
  ) or
  (
    /* Covered by 83b0e48b-f42e-4323-b8cd-386619a96d35 */
    (process.name == "su" and process.args_count <= 2) or
    (process.name == "pkexec" and process.args_count == 1) or
    (process.name == "passwd" and process.args_count <= 2)
  ) or
  (process.name == "mount" and process.args_count <= 2) or
  process.parent.executable like "/u0*/*" or
  process.name like "python*" or
  process.executable like (
    "/opt/psa/admin/bin/*", "/usr/lib/landscape/apt-update", "/usr/sbin/login_duo", "/usr/bin/nvidia-modprobe", "/usr/bin/proxmox-mail-forward",
    "/opt/andrisoft/bin/WANmaintenance", "/ora/SW/em_agent/*", "/opt/OracleHomes/agent_home/*", "/opt/rsa/am/utils/lib/linux-x86_64/*",
    "/usr/libexec/spice-client-glib-usb-acl-helper", "/tmp/newroot/usr/bin/vmware-user-suid-wrapper",
    "/tmp/newroot/usr/lib/landscape/apt-update", "/home/*/sqllib/adm/db2start",
    "/home/*/sqllib/adm/db2stop", "/*/app/oracle/product/*/sbin/nmo", "/opt/data/db2inst1/sqllib/adm/db2stop", "/opt/data/db2inst1/sqllib/adm/db2start",
    "/usr/local/sbin/uid_gid_mapping", "/usr/bin/crontab", "/home/db2inst1/sqllib/adm/db2chparm", "/vz/root/*/opt/psa/admin/bin/osdetect",
    "/data/app/oracle/agent/*", "/usr/lib/plesk-*/msmtp-pwdeval", "/usr/sbin/mount.nfs"
  ) or
  process.command_line in ("/usr/bin/nvidia-modprobe", "/usr/sbin/login_duo")
)
'''

min_endpoint_version = "8.2.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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"

[[threat.technique.subtechnique]]
id = "T1548.003"
name = "Sudo and Sudo Caching"
reference = "https://attack.mitre.org/techniques/T1548/003/"



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

[internal]
min_endpoint_version = "8.2.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  (process.user.id == 0 and process.real_user.id != 0 and process.parent.user.id != 0) or
  (process.group.id == 0 and process.real_group.id != 0 and process.parent.group.id != 0)
) and
(
  stringcontains(process.executable, process.command_line) or
  stringcontains(process.name, process.command_line)
) and
(
  process.parent.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*", "node", "deno", "bun", "java") or
  process.parent.executable like ("./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*") or
  (
    process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh") and
    process.parent.args in ("-c", "-cl", "-lc", "--command", "-ic", "-ci", "-bash", "-sh", "-zsh", "-dash", "-fish", "-ksh", "-mksh") and
    process.parent.args_count <= 4
  )
) and
not (
  process.name in (
    "unix_chkpwd", "fusermount", "fusermount3", "umount", "newgrp", "chsh", "sudoedit", "gpasswd", "chfn", "polkit-agent-helper-1",
    "dbus-daemon-launch-helper", "ssh-keysign", "pam_extrausers_chkpwd", "expiry", "chage", "wall", "bsd-write", "ssh-agent",
    "ping6", "traceroute", "mtr", "ntfs-3g", "Xorg.wrap", "chrome-sandbox", "bwrap", "hostname", "sudo"
  ) or
  (
    (process.name == "su" and process.args_count <= 2) or
    (process.name == "pkexec" and process.args_count == 1) or
    (process.name == "passwd" and process.args_count <= 2)
  ) or
  (process.name == "mount" and process.args_count <= 2) or
  process.parent.executable like "/u0*/*" or
  process.name like "python*" or
  process.executable like (
    "/opt/psa/admin/bin/*", "/usr/lib/landscape/apt-update", "/usr/sbin/login_duo", "/usr/bin/nvidia-modprobe", "/usr/bin/proxmox-mail-forward",
    "/opt/andrisoft/bin/WANmaintenance", "/ora/SW/em_agent/*", "/opt/OracleHomes/agent_home/*", "/opt/rsa/am/utils/lib/linux-x86_64/*",
    "/usr/libexec/spice-client-glib-usb-acl-helper", "/tmp/newroot/usr/bin/vmware-user-suid-wrapper",
    "/tmp/newroot/usr/lib/landscape/apt-update", "/home/*/sqllib/adm/db2start",
    "/home/*/sqllib/adm/db2stop", "/*/app/oracle/product/*/sbin/nmo", "/opt/data/db2inst1/sqllib/adm/db2stop", "/opt/data/db2inst1/sqllib/adm/db2start",
    "/usr/local/sbin/uid_gid_mapping", "/usr/bin/crontab", "/home/db2inst1/sqllib/adm/db2chparm", "/vz/root/*/opt/psa/admin/bin/osdetect",
    "/data/app/oracle/agent/*", "/usr/lib/plesk-*/msmtp-pwdeval", "/usr/sbin/mount.nfs"
  ) or
  process.command_line in ("/usr/bin/nvidia-modprobe", "/usr/sbin/login_duo")
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.args_counteq1excludes:process.args_count field:"process.args_count" value:"1"
process.nameeqpkexecexcludes:process.name field:"process.name" value:"pkexec"
process.args_countle2excludes:process.args_count field:"process.args_count" value:"2"
process.nameeqmountexcludes:process.name field:"process.name" value:"mount"
process.nameeqpasswdexcludes:process.name field:"process.name" value:"passwd"
process.nameeqsuexcludes:process.name field:"process.name" value:"su"
process.command_linein/usr/bin/nvidia-modprobe, /usr/sbin/login_duoexcludes:process.command_line field:"process.command_line" value:"/usr/bin/nvidia-modprobe" field:"process.command_line" value:"/usr/sbin/login_duo"
process.executablewildcard/opt/psa/admin/bin/*, /usr/lib/landscape/apt-update, /usr/sbin/login_duo, /usr/bin/nvidia-modprobe, /usr/bin/proxmox-mail-forward, /opt/andrisoft/bin/WANmaintenance, /ora/SW/em_agent/*, /opt/OracleHomes/agent_home/*, /opt/rsa/am/utils/lib/linux-x86_64/*, /usr/libexec/spice-client-glib-usb-acl-helper, /tmp/newroot/usr/bin/vmware-user-suid-wrapper, /tmp/newroot/usr/lib/landscape/apt-update, /home/*/sqllib/adm/db2start, /home/*/sqllib/adm/db2stop, /*/app/oracle/product/*/sbin/nmo, /opt/data/db2inst1/sqllib/adm/db2stop, /opt/data/db2inst1/sqllib/adm/db2start, /usr/local/sbin/uid_gid_mapping, /usr/bin/crontab, /home/db2inst1/sqllib/adm/db2chparm, /vz/root/*/opt/psa/admin/bin/osdetect, /data/app/oracle/agent/*, /usr/lib/plesk-*/msmtp-pwdeval, /usr/sbin/mount.nfsexcludes:process.executable
process.nameinXorg.wrap, bsd-write, bwrap, chage, chfn, chrome-sandbox, chsh, dbus-daemon-launch-helper, expiry, fusermount, fusermount3, gpasswd, hostname, mtr, newgrp, ntfs-3g, pam_extrausers_chkpwd, ping6, polkit-agent-helper-1, ssh-agent, ssh-keysign, sudo, sudoedit, traceroute, umount, unix_chkpwd, wallexcludes:process.name
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"
process.parent.executablewildcard/u0*/*excludes:process.parent.executable field:"process.parent.executable" value:"/u0*/*"

Potential Privilege Escalation via Enlightenment

#
Status
production
Severity
high
Time window
5s
Sequence by
host.id, process.parent.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies an attempt to exploit a local privilege escalation CVE-2022-37706 via a flaw in Linux window manager package Enlightenment. enlightenment_sys in Enlightenment before 0.25.4 allows local users to gain privileges because it is setuid root, and the system library function mishandles pathnames that begin with a /dev/.. substring.

MITRE ATT&CK Coverage

Rule Body

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

[rule]
author = ["Elastic"]
description = """
Identifies an attempt to exploit a local privilege escalation CVE-2022-37706 via a flaw in Linux window manager package
Enlightenment. enlightenment_sys in Enlightenment before 0.25.4 allows local users to gain privileges because it is
setuid root, and the system library function mishandles pathnames that begin with a /dev/.. substring.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Privilege Escalation via Enlightenment"
references = ["https://ubuntu.com/security/CVE-2022-37706", "https://www.exploit-db.com/exploits/51180"]
risk_score = 73
rule_id = "bc0fc359-68db-421e-a435-348ced7a7f92"
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: Privilege Escalation",
    "Use Case: Vulnerability",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
type = "eql"

query = '''
sequence by host.id, process.parent.entity_id with maxspan=5s
  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
    process.name == "enlightenment_sys" and process.args in ("/bin/mount/", "-o","noexec","nosuid","nodev","uid=*") ]
  [process where host.os.type == "linux" and event.action == "uid_change" and event.type == "change" and user.id == "0"]
'''
note = """## Triage and analysis

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

### Investigating Potential Privilege Escalation via Enlightenment

Enlightenment, a Linux window manager, can be exploited for privilege escalation due to a flaw in its setuid root configuration. Attackers may exploit this by manipulating pathnames, gaining unauthorized root access. The detection rule identifies suspicious execution of 'enlightenment_sys' with specific arguments and subsequent UID changes to root, flagging potential exploitation attempts.

### Possible investigation steps

- Review the alert details to confirm the presence of the process "enlightenment_sys" with the specified arguments ("/bin/mount/", "-o", "noexec", "nosuid", "nodev", "uid=*") on a Linux host.
- Check the process execution timeline to verify if the suspicious "enlightenment_sys" execution was followed by a UID change to root (user.id == "0") within a 5-second window.
- Investigate the host.id and process.parent.entity_id to identify the parent process and determine if it was initiated by a legitimate user or service.
- Examine the system logs around the time of the alert to identify any other unusual activities or related processes that might indicate a broader attack or exploitation attempt.
- Assess the affected system for any unauthorized changes or signs of compromise, focusing on privilege escalation indicators and potential persistence mechanisms.
- Review user access logs and permissions to determine if the user associated with the process had legitimate reasons to execute "enlightenment_sys" with elevated privileges.
- Consider isolating the affected system to prevent further exploitation and begin remediation steps, such as applying patches or configuration changes to mitigate the vulnerability.

### False positive analysis

- Legitimate administrative tasks using enlightenment_sys may trigger the rule. Review the context of the execution, such as the user and the specific arguments used, to determine if the activity is authorized.
- Automated scripts or system maintenance processes that involve enlightenment_sys with similar arguments might be flagged. Identify these scripts and consider excluding them by specifying their process hashes or paths in the detection rule.
- System updates or package installations that temporarily change UID to root could be misinterpreted as exploitation attempts. Monitor these activities and whitelist known update processes to prevent false alerts.
- Custom user applications that interact with enlightenment_sys for legitimate purposes may cause false positives. Evaluate these applications and, if deemed safe, add them to an exception list based on their unique identifiers.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement.
- Terminate any suspicious processes related to 'enlightenment_sys' that are running with elevated privileges to stop ongoing exploitation.
- Conduct a thorough review of system logs to identify any unauthorized changes or access patterns, focusing on UID changes to root.
- Revoke any unauthorized access or privileges granted during the exploitation, ensuring that only legitimate users have root access.
- Apply the latest security patches and updates to the Enlightenment package, specifically upgrading to version 0.25.4 or later to mitigate the vulnerability.
- Implement file integrity monitoring to detect unauthorized changes to critical system files and configurations in the future.
- Escalate the incident to the security operations team for further investigation and to assess the potential impact on other systems within the network."""


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

[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[rule.threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"

[[rule.threat.technique.subtechnique]]
id = "T1548.001"
name = "Setuid and Setgid"
reference = "https://attack.mitre.org/techniques/T1548/001/"

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

Stages and Predicates

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

Stage 1: process

[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
    process.name == "enlightenment_sys" and process.args in ("/bin/mount/", "-o","noexec","nosuid","nodev","uid=*") ]

Stage 2: process

[process where host.os.type == "linux" and event.action == "uid_change" and event.type == "change" and user.id == "0"]

Indicators

These rows show field, operator, and value matches.

Potential Privilege Escalation via InstallerFileTakeOver

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

Identifies a potential exploitation of InstallerTakeOver (CVE-2021-41379) default PoC execution. Successful exploitation allows an unprivileged user to escalate privileges to SYSTEM.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/11/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Identifies a potential exploitation of InstallerTakeOver (CVE-2021-41379) default PoC execution. Successful exploitation
allows an unprivileged user to escalate privileges to SYSTEM.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Privilege Escalation via InstallerFileTakeOver"
references = ["https://github.com/klinix5/InstallerFileTakeOver"]
risk_score = 73
rule_id = "58c6d58b-a0d3-412d-b3b8-0981a9400607"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
    "Use Case: Vulnerability",
    "Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
    process.Ext.token.integrity_level_name : "System" and
    (
      (process.name : "elevation_service.exe" and
       not process.pe.original_file_name == "elevation_service.exe") or
      
      (process.name : "elevation_service.exe" and
       not process.code_signature.trusted == true) or

      (process.parent.name : "elevation_service.exe" and
       process.name : ("rundll32.exe", "cmd.exe", "powershell.exe"))
    ) and
    not
    (
      process.name : "elevation_service.exe" and process.code_signature.trusted == true and
      process.pe.original_file_name == null
    )
'''

note = """## Triage and analysis

### Investigating Potential Privilege Escalation via InstallerFileTakeOver

#### Possible investigation steps

- Which alert path fired: a suspect service binary or a service-spawned child?
  - Focus: alert-local `process.name`, `process.executable`, `process.command_line`, `process.parent.executable`, and `process.Ext.token.integrity_level_name`.
  - Implication: escalate when SYSTEM "elevation_service.exe" runs outside "%ProgramFiles% or %ProgramFiles(x86)%\\Microsoft\\Edge\\Application\\<version>\\elevation_service.exe" or starts "cmd.exe", "powershell.exe", or "rundll32.exe"; lower suspicion only for a genuine Edge service start with no shell child.
- Is the elevation service binary genuine Microsoft content?
  - Focus: compare service `process.executable`, `process.pe.original_file_name`, `process.hash.sha256`, `process.code_signature.subject_name`, and `process.code_signature.trusted`; for child alerts, recover the parent service start on `host.id` with `process.parent.entity_id` and compare those fields there.
  - Hint: if a child alert lacks parent hash or signer details, recover the parent service process start with entity or PID fallback. $investigate_0
  - Implication: escalate when original filename is not "elevation_service.exe", signer is not Microsoft, trust fails, or the same hash appears from a user-writable path; lower suspicion only when path, filename, signer, trust, and hash history fit the expected Microsoft Edge service.
- Does lineage show Windows Installer takeover rather than normal Edge servicing?
  - Focus: `process.parent.executable`, `process.parent.command_line`, `process.parent.code_signature.subject_name`, `process.parent.code_signature.trusted`, and broader process lineage when needed.
  - Implication: escalate when an MSI, temp, or user-session chain leads to the SYSTEM service or shell; lower suspicion when Microsoft-signed Edge installer or updater lineage starts the genuine service with servicing arguments and no shell.
- Do recovered file events show service overwrite or PoC staging artifacts?
  - Focus: if file telemetry exists, open host-scoped file events, then filter to the recovered service or child `process.entity_id`; if entity IDs are absent, use `host.id` plus service `process.pid` or `process.parent.pid` and the alert window. Review `file.path`, `file.Ext.original.path`, and writing `process.executable`. $investigate_2
  - Range: start 30 minutes before the alert because MSI administrative-install staging can precede service execution.
  - Implication: escalate when the Edge service path is overwritten or PoC artifacts such as the "microsoft plz" temp folder, temp MSI, or "elevation_service.exe" file creation cluster around the alert; treat those names as corroborators, not required evidence. Missing file telemetry is unresolved, not benign.
  - Hint: modified variants may omit PoC names; keep this centered on service replacement and MSI staging when names differ.
- What did the SYSTEM service or spawned child do next?
  - Focus: descendant process starts on the same `host.id` from `process.entity_id` or `process.parent.entity_id`, especially `process.name`, `process.command_line`, and `process.Ext.token.integrity_level_name`. $investigate_1
  - Implication: escalate when SYSTEM context launches credential-access, persistence, payload staging, or remote-execution tooling; keep scope near the privilege-escalation event only when the service or shell produces no follow-on SYSTEM activity.
- If local findings remain suspicious or unresolved, do related alerts show broader exploitation?
  - Focus: related alerts for the same `host.id` in the last 48 hours, especially service tampering, suspicious MSI, credential access, or follow-on execution. $investigate_3
  - Hint: compare `user.id` only when it identifies a non-SYSTEM actor; otherwise keep broadened review host-scoped and use lineage to avoid over-attributing the operator. $investigate_4
  - Implication: broaden response when the same host or user shows privilege-escalation or post-exploitation alerts; quiet related-alert review does not close unresolved local evidence.
- Escalate on identity mismatch, MSI/user lineage, service overwrite, SYSTEM shell, or follow-on activity; close only when all evidence fits genuine Microsoft Edge service identity with no shell behavior or verified validation/detonation; preserve artifacts and escalate when evidence is mixed or telemetry is missing.

### False positive analysis

- Authorized exploit validation, red-team work, detection-content testing, malware research, or incident-response detonation can trigger this rule on lab or disposable analysis hosts. Confirm `process.hash.sha256`, service `process.executable`, parent `process.parent.executable`, child `process.command_line`, recovered temp-artifact pattern, and bounded `host.id` cohort match the same test kit or analysis-host cohort. If change, test, or sandbox records are unavailable, require the same telemetry pattern across prior alerts from this rule before closing as benign.
- Before creating an exception, keep `process.hash.sha256`, `process.executable`, `process.parent.executable`, child `process.command_line`, `host.id`, and the recovered temp-artifact pattern stable across prior alerts from this rule. Avoid exceptions on `process.name`, `process.parent.name`, or "elevation_service.exe" alone because those values overlap real service abuse.

### Response and remediation

- If confirmed benign, reverse temporary containment and record the validation or analysis workflow that matched the alert, including the stable `process.hash.sha256`, service `process.executable`, parent `process.parent.executable`, child `process.command_line`, recovered artifact pattern, and bounded `host.id` cohort. Create an exception only after the same pattern recurs across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the case export, process tree with service and child entity IDs, service binary and hash identity, spawned-shell command line, and recovered service-overwrite or temp-artifact timeline before containment or cleanup. Apply reversible containment first, such as heightened monitoring or host isolation when the asset role permits it; terminate the spawned shell only after capture, and escalate to isolation if follow-on SYSTEM activity or spread appears.
- If confirmed malicious, use the preserved identity, lineage, artifact, and follow-on evidence to isolate the endpoint or escalate to the team that can contain it. Before replacing or deleting files, collect the overwritten service binary, temp MSI or recovered PoC artifacts, and spawned-shell timeline. Review related hosts and users for the same hash or service-path pattern, then restore the genuine Edge elevation service binary and remove only attacker payloads, persistence, or configuration changes identified during scoping.
- Post-incident hardening: verify Windows Installer and Edge components are patched, restrict unnecessary MSI administrative-install paths where possible, retain process and file telemetry long enough to reconstruct service replacement, and record the service-path, temp-artifact, and child-shell pattern for future response.
"""

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
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.pid",
    "process.executable",
    "process.command_line",
    "process.pe.original_file_name",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "process.hash.sha256",
    "process.Ext.token.integrity_level_name",
    "process.Ext.relative_file_creation_time",
    "process.parent.executable",
    "process.parent.command_line",
]

[transform]

[[transform.investigate]]
label = "Parent elevation service process start"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.parent.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.parent.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Child process starts from the alert process"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "File events on this host near the alert"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

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

[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

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

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

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

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

[[rule.threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
    process.Ext.token.integrity_level_name : "System" and
    (
      (process.name : "elevation_service.exe" and
       not process.pe.original_file_name == "elevation_service.exe") or
      
      (process.name : "elevation_service.exe" and
       not process.code_signature.trusted == true) or

      (process.parent.name : "elevation_service.exe" and
       process.name : ("rundll32.exe", "cmd.exe", "powershell.exe"))
    ) and
    not
    (
      process.name : "elevation_service.exe" and process.code_signature.trusted == true and
      process.pe.original_file_name == null
    )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.Ext.token.integrity_level_namewildcard
  • System corpus 8 (elastic 8)
field:"process.Ext.token.integrity_level_name" kind:wildcard value:"System"
process.namewildcard
  • cmd.exe corpus 122 (elastic 93, splunk 29)
  • elevation_service.exe corpus 2 (elastic 2)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
field:"process_basename" kind:wildcard
process.parent.namewildcard
  • elevation_service.exe
field:"parent_process_basename" kind:wildcard value:"elevation_service.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.nameeqelevation_service.exeexcludes:process.name field:"process.name" value:"elevation_service.exe"
process.pe.original_file_nameis_null(no value, null check)excludes:process.pe.original_file_name

Potential Privilege Escalation via LogonUI

#
Source
github.com/elastic/protections-artifacts

Identifies attempts to force the LogonUI process to load an unsigned DLL via logoff action. The LogonUI.exe process will communicate with desktop GUI processes, a malicious one may force it to load a DLL using memory mapped shellcode via marshal/unmarshal Direct Composition objects. This may indicate a successful vulnerability exploitation for privilege escalation.

MITRE ATT&CK Coverage

TacticTechniques
Privilege Escalation

Rule Body

[rule]
description = """
Identifies attempts to force the LogonUI process to load an unsigned DLL via logoff action. The LogonUI.exe process will
communicate with desktop GUI processes, a malicious one may force it to load a DLL using memory mapped shellcode via
marshal/unmarshal Direct Composition objects. This may indicate a successful vulnerability exploitation for privilege
escalation.
"""
id = "b9d6cfad-4d18-49a4-a653-47d26fda4431"
license = "Elastic License v2"
name = "Potential Privilege Escalation via LogonUI"
os_list = ["windows"]
reference = [
    "https://googleprojectzero.github.io/0days-in-the-wild/0day-RCAs/2023/CVE-2023-36033.html",
    "https://www.elastic.co/security-labs/itw-windows-lpe-0days-insights-and-detection-strategies",
]
version = "1.0.3"

query = '''
library where process.executable : "?:\\Windows\\System32\\LogonUI.exe" and user.id : "S-1-5-18" and 
 not dll.code_signature.status : "trusted" and process.thread.Ext.call_stack_summary : "*combase.dll|dcomp.dll*"
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: library

library where process.executable : "?:\\Windows\\System32\\LogonUI.exe" and user.id : "S-1-5-18" and 
 not dll.code_signature.status : "trusted" and process.thread.Ext.call_stack_summary : "*combase.dll|dcomp.dll*"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuseqtrustedexcludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted"

Shared Object Created by Previously Unknown Process

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

This rule monitors the creation of shared object files by previously unknown processes. The creation of a shared object file involves compiling code into a dynamically linked library that can be loaded by other programs at runtime. While this process is typically used for legitimate purposes, malicious actors can leverage shared object files to execute unauthorized code, inject malicious functionality into legitimate processes, or bypass security controls. This allows malware to persist on the system, evade detection, and potentially compromise the integrity and confidentiality of the affected system and its data.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2023/06/09"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[transform]
[[transform.osquery]]
label = "Osquery - Retrieve File Listing Information"
query = "SELECT * FROM file WHERE path = {{file.path}}\n"

[[transform.osquery]]
label = "Osquery - Retrieve Additional File Listing Information"
query = """
SELECT f.path, u.username AS file_owner, g.groupname AS group_owner, datetime(f.atime, 'unixepoch') AS
file_last_access_time, datetime(f.mtime, 'unixepoch') AS file_last_modified_time, datetime(f.ctime, 'unixepoch') AS
file_last_status_change_time, datetime(f.btime, 'unixepoch') AS file_created_time, f.size AS size_bytes FROM file f LEFT
JOIN users u ON f.uid = u.uid LEFT JOIN groups g ON f.gid = g.gid WHERE path = {{file.path}}
"""

[[transform.osquery]]
label = "Osquery - Retrieve Running Processes by User"
query = "SELECT pid, username, name FROM processes p JOIN users u ON u.uid = p.uid ORDER BY username"

[[transform.osquery]]
label = "Osquery - Retrieve Crontab Information"
query = "SELECT * FROM crontab"

[[transform.osquery]]
label = "Osquery - Retrieve Listening Ports"
query = "SELECT pid, address, port, socket, protocol, path FROM listening_ports"

[[transform.osquery]]
label = "Osquery - Retrieve Open Sockets"
query = "SELECT pid, family, remote_address, remote_port, socket, state FROM process_open_sockets"

[[transform.osquery]]
label = "Osquery - Retrieve Information for a Specific User"
query = "SELECT * FROM users WHERE username = {{user.name}}"

[[transform.osquery]]
label = "Osquery - Investigate the Account Authentication Status"
query = "SELECT * FROM logged_in_users WHERE user = {{user.name}}"


[rule]
author = ["Elastic"]
description = """
This rule monitors the creation of shared object files by previously unknown processes. The creation of a shared object
file involves compiling code into a dynamically linked library that can be loaded by other programs at runtime. While
this process is typically used for legitimate purposes, malicious actors can leverage shared object files to execute
unauthorized code, inject malicious functionality into legitimate processes, or bypass security controls. This allows
malware to persist on the system, evade detection, and potentially compromise the integrity and confidentiality of the
affected system and its data.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "endgame-*"]
language = "kuery"
license = "Elastic License v2"
name = "Shared Object Created by Previously Unknown Process"
note = """## Triage and analysis

### Investigating Shared Object Created by Previously Unknown Process

A shared object file is a compiled library file (typically with a .so extension) that can be dynamically linked to executable programs at runtime, allowing for code reuse and efficient memory usage. The creation of a shared object file involves compiling code into a dynamically linked library that can be loaded by other programs at runtime.

Malicious actors can leverage shared object files to execute unauthorized code, inject malicious functionality into legitimate processes, or bypass security controls. This allows malware to persist on the system, evade detection, and potentially compromise the integrity and confidentiality of the affected system and its data.

This rule monitors the creation of shared object files by previously unknown processes through the usage of the new terms rule type.

> **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.
> This investigation guide uses [placeholder fields](https://www.elastic.co/guide/en/security/current/osquery-placeholder-fields.html) to dynamically pass alert data into Osquery queries. Placeholder fields were introduced in Elastic Stack version 8.7.0. If you're using Elastic Stack version 8.6.0 or earlier, you'll need to manually adjust this investigation guide's queries to ensure they properly run.

#### Possible Investigation Steps

- Investigate the shared object that was created or modified through OSQuery.
  - $osquery_0
  - $osquery_1
- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence and whether they are located in expected locations.
  - $osquery_2
- Investigate other alerts associated with the user/host during the past 48 hours.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Investigate whether the altered scripts call other malicious scripts elsewhere on the file system. 
  - If scripts or executables were dropped, retrieve the files and determine if they are malicious:
    - Use a private sandboxed malware analysis system to perform analysis.
      - Observe and collect information about the following activities:
        - Attempts to contact external domains and addresses.
          - Check if the domain is newly registered or unexpected.
          - Check the reputation of the domain or IP address.
        - File access, modification, and creation activities.
        - Cron jobs, services and other persistence mechanisms.
            - $osquery_3
- Investigate abnormal behaviors by the subject process/user such as network connections, file modifications, and any other spawned child processes.
  - Investigate listening ports and open sockets to look for potential command and control traffic or data exfiltration.
    - $osquery_4
    - $osquery_5
  - Identify the user account that performed the action, analyze it, and check whether it should perform this kind of action.
    - $osquery_6
- Investigate whether the user is currently logged in and active.
    - $osquery_7

### False Positive Analysis

- If this activity is related to new benign software installation activity, consider adding exceptions — preferably with a combination of user and command line conditions.
- If this activity is related to a system administrator that performed these actions for administrative purposes, consider adding exceptions for this specific administrator user account. 
- Try to understand the context of the execution by thinking about the user, machine, or business purpose. A small number of endpoints, such as servers with unique software, might appear unusual but satisfy a specific business need.

### 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.
- 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.
- Leverage the incident response data and logging to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://threatpost.com/sneaky-malware-backdoors-linux/180158/"]
risk_score = 47
rule_id = "aebaa51f-2a91-4f6a-850b-b601db2293f4"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

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

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

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.category:file and host.os.type:"linux" and event.action:("creation" or "file_create_event") and
(file.extension:"so" or file.name:*.so.*) and
file.path:(
  /dev/shm/* or /usr/lib/* or /usr/lib64/* or /usr/local/lib/* or /usr/local/lib64/* or /lib/x86_64-linux-gnu/* or
  /usr/lib/x86_64-linux-gnu/* or /lib/i386-linux-gnu/* or /usr/lib/i386-linux-gnu/* or /lib/* or /lib64/*
) and not (
  process.name:(
    "dockerd" or "dpkg" or "rpm" or "snapd" or "yum" or "vmis-launcher" or "pacman" or "apt-get" or "dnf" or "podman" or
    platform-python* or "dnf-automatic" or "unattended-upgrade" or "apk" or "snap-update-ns" or "install" or "exe" or
    "systemd" or "root" or "sshd" or "pip" or "jlink" or python* or "update-alternatives" or pip* or "crio" or "packagekitd"
  ) or 
  (process.name:"vmware-install.pl" and file.path:/usr/lib/vmware-tools/*) or
  (process.name:"ssm-agent-worker" and file.path:/usr/lib/jvm/java*) or 
  process.executable : (
    /dev/fd/* or "/" or "/kaniko/executor" or "/usr/bin/buildah" or "/usr/bin/microdnf" or "/usr/sbin/yum-cron" or
    "/usr/lib/check_mk_agent/plugins/3600/cmk-update-agent" or "/usr/bin/pamac-daemon" or "/usr/bin/dnf5" or
    "3600/cmk-update-agent" or "/usr/lib/dracut/dracut-install" or "/usr/bin/dockerd" or "/usr/sbin/crond" or
    "./usr/bin/qemu-aarch64-static" or "/usr/bin/nvidia-installer" or "./nvidia-installer" or "/usr/bin/cmake" or
    /var/lib/docker/overlay2/* or "/usr/sbin/gdm" or "/opt/ITSPlatform/plugin/scap/fortify-scap-plugin" or
    /tmp/makeself* or /tmp/selfgz* or "./usr/bin/qemu-aarch64" or "/usr/local/bin/cmake" or /opt/lpruitt/tmp/selfgz* or
    "/usr/lib/snapd/snap-update-ns" or "/sbin/yum-cron" or "/usr/local/psa/bin/dnf_install" or /opt/lmanteuffel/useful/tmp/makeself*
  ) or
  file.name:libnvidia*
)
'''

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

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

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

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

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

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

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

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

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

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

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

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[rule.new_terms]
field = "new_terms_fields"
value = ["file.name", "process.name"]

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

Stages and Predicates

Stage 1: new_terms

event.category:file and host.os.type:"linux" and event.action:("creation" or "file_create_event") and
(file.extension:"so" or file.name:*.so.*) and
file.path:(
  /dev/shm/* or /usr/lib/* or /usr/lib64/* or /usr/local/lib/* or /usr/local/lib64/* or /lib/x86_64-linux-gnu/* or
  /usr/lib/x86_64-linux-gnu/* or /lib/i386-linux-gnu/* or /usr/lib/i386-linux-gnu/* or /lib/* or /lib64/*
) and not (
  process.name:(
    "dockerd" or "dpkg" or "rpm" or "snapd" or "yum" or "vmis-launcher" or "pacman" or "apt-get" or "dnf" or "podman" or
    platform-python* or "dnf-automatic" or "unattended-upgrade" or "apk" or "snap-update-ns" or "install" or "exe" or
    "systemd" or "root" or "sshd" or "pip" or "jlink" or python* or "update-alternatives" or pip* or "crio" or "packagekitd"
  ) or 
  (process.name:"vmware-install.pl" and file.path:/usr/lib/vmware-tools/*) or
  (process.name:"ssm-agent-worker" and file.path:/usr/lib/jvm/java*) or 
  process.executable : (
    /dev/fd/* or "/" or "/kaniko/executor" or "/usr/bin/buildah" or "/usr/bin/microdnf" or "/usr/sbin/yum-cron" or
    "/usr/lib/check_mk_agent/plugins/3600/cmk-update-agent" or "/usr/bin/pamac-daemon" or "/usr/bin/dnf5" or
    "3600/cmk-update-agent" or "/usr/lib/dracut/dracut-install" or "/usr/bin/dockerd" or "/usr/sbin/crond" or
    "./usr/bin/qemu-aarch64-static" or "/usr/bin/nvidia-installer" or "./nvidia-installer" or "/usr/bin/cmake" or
    /var/lib/docker/overlay2/* or "/usr/sbin/gdm" or "/opt/ITSPlatform/plugin/scap/fortify-scap-plugin" or
    /tmp/makeself* or /tmp/selfgz* or "./usr/bin/qemu-aarch64" or "/usr/local/bin/cmake" or /opt/lpruitt/tmp/selfgz* or
    "/usr/lib/snapd/snap-update-ns" or "/sbin/yum-cron" or "/usr/local/psa/bin/dnf_install" or /opt/lmanteuffel/useful/tmp/makeself*
  ) or
  file.name:libnvidia*
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • creation
  • file_create_event
field:"EventType" kind:in
event.categoryeq
  • file
field:"event.category" kind:eq value:"file"
file.extensioneq
  • so
field:"file.extension" kind:eq value:"so"
file.namewildcard
  • *.so.*
field:"file.name" kind:wildcard value:"*.so.*"
file.pathwildcard
  • /dev/shm/*
  • /lib/*
  • /lib/i386-linux-gnu/*
  • /lib/x86_64-linux-gnu/*
  • /lib64/*
  • /usr/lib/*
  • /usr/lib/i386-linux-gnu/*
  • /usr/lib/x86_64-linux-gnu/*
  • /usr/lib64/*
  • /usr/local/lib/*
  • /usr/local/lib64/*
field:"TargetFilename" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathstarts_with/usr/lib/jvm/javaexcludes:file.path field:"file.path" value:"/usr/lib/jvm/java"
process.nameeqssm-agent-workerexcludes:process.name field:"process.name" value:"ssm-agent-worker"
file.pathstarts_with/usr/lib/vmware-tools/excludes:file.path field:"file.path" value:"/usr/lib/vmware-tools/"
process.nameeqvmware-install.plexcludes:process.name field:"process.name" value:"vmware-install.pl"
file.namestarts_withlibnvidiaexcludes:file.name field:"file.name" value:"libnvidia"
process.executableeq./nvidia-installerexcludes:process.executable field:"process.executable" value:"./nvidia-installer"
process.executableeq./usr/bin/qemu-aarch64excludes:process.executable field:"process.executable" value:"./usr/bin/qemu-aarch64"
process.executableeq./usr/bin/qemu-aarch64-staticexcludes:process.executable field:"process.executable" value:"./usr/bin/qemu-aarch64-static"
process.executableeq/excludes:process.executable field:"process.executable" value:"/"
process.executableeq/kaniko/executorexcludes:process.executable field:"process.executable" value:"/kaniko/executor"
process.executableeq/opt/ITSPlatform/plugin/scap/fortify-scap-pluginexcludes:process.executable field:"process.executable" value:"/opt/ITSPlatform/plugin/scap/fortify-scap-plugin"
process.executableeq/sbin/yum-cronexcludes:process.executable field:"process.executable" value:"/sbin/yum-cron"
process.executableeq/usr/bin/buildahexcludes:process.executable field:"process.executable" value:"/usr/bin/buildah"
process.executableeq/usr/bin/cmakeexcludes:process.executable field:"process.executable" value:"/usr/bin/cmake"
process.executableeq/usr/bin/dnf5excludes:process.executable field:"process.executable" value:"/usr/bin/dnf5"
process.executableeq/usr/bin/dockerdexcludes:process.executable field:"process.executable" value:"/usr/bin/dockerd"
process.executableeq/usr/bin/microdnfexcludes:process.executable field:"process.executable" value:"/usr/bin/microdnf"
process.executableeq/usr/bin/nvidia-installerexcludes:process.executable field:"process.executable" value:"/usr/bin/nvidia-installer"
process.executableeq/usr/bin/pamac-daemonexcludes:process.executable field:"process.executable" value:"/usr/bin/pamac-daemon"
process.executableeq/usr/lib/check_mk_agent/plugins/3600/cmk-update-agentexcludes:process.executable field:"process.executable" value:"/usr/lib/check_mk_agent/plugins/3600/cmk-update-agent"
process.executableeq/usr/lib/dracut/dracut-installexcludes:process.executable field:"process.executable" value:"/usr/lib/dracut/dracut-install"
process.executableeq/usr/lib/snapd/snap-update-nsexcludes:process.executable field:"process.executable" value:"/usr/lib/snapd/snap-update-ns"
process.executableeq/usr/local/bin/cmakeexcludes:process.executable field:"process.executable" value:"/usr/local/bin/cmake"
process.executableeq/usr/local/psa/bin/dnf_installexcludes:process.executable field:"process.executable" value:"/usr/local/psa/bin/dnf_install"
process.executableeq/usr/sbin/crondexcludes:process.executable field:"process.executable" value:"/usr/sbin/crond"
process.executableeq/usr/sbin/gdmexcludes:process.executable field:"process.executable" value:"/usr/sbin/gdm"
process.executableeq/usr/sbin/yum-cronexcludes:process.executable field:"process.executable" value:"/usr/sbin/yum-cron"
process.executableeq3600/cmk-update-agentexcludes:process.executable field:"process.executable" value:"3600/cmk-update-agent"
process.executablestarts_with/dev/fd/excludes:process.executable field:"process.executable" value:"/dev/fd/"
process.executablestarts_with/opt/lmanteuffel/useful/tmp/makeselfexcludes:process.executable field:"process.executable" value:"/opt/lmanteuffel/useful/tmp/makeself"
process.executablestarts_with/opt/lpruitt/tmp/selfgzexcludes:process.executable field:"process.executable" value:"/opt/lpruitt/tmp/selfgz"
process.executablestarts_with/tmp/makeselfexcludes:process.executable field:"process.executable" value:"/tmp/makeself"
process.executablestarts_with/tmp/selfgzexcludes:process.executable field:"process.executable" value:"/tmp/selfgz"
process.executablestarts_with/var/lib/docker/overlay2/excludes:process.executable field:"process.executable" value:"/var/lib/docker/overlay2/"
process.nameeqapkexcludes:process.name field:"process.name" value:"apk"
process.nameeqapt-getexcludes:process.name field:"process.name" value:"apt-get"
process.nameeqcrioexcludes:process.name field:"process.name" value:"crio"
process.nameeqdnfexcludes:process.name field:"process.name" value:"dnf"
process.nameeqdnf-automaticexcludes:process.name field:"process.name" value:"dnf-automatic"
process.nameeqdockerdexcludes:process.name field:"process.name" value:"dockerd"
process.nameeqdpkgexcludes:process.name field:"process.name" value:"dpkg"
process.nameeqexeexcludes:process.name field:"process.name" value:"exe"
process.nameeqinstallexcludes:process.name field:"process.name" value:"install"
process.nameeqjlinkexcludes:process.name field:"process.name" value:"jlink"
process.nameeqpackagekitdexcludes:process.name field:"process.name" value:"packagekitd"
process.nameeqpacmanexcludes:process.name field:"process.name" value:"pacman"
process.nameeqpipexcludes:process.name field:"process.name" value:"pip"
process.nameeqpodmanexcludes:process.name field:"process.name" value:"podman"
process.nameeqrootexcludes:process.name field:"process.name" value:"root"
process.nameeqrpmexcludes:process.name field:"process.name" value:"rpm"
process.nameeqsnap-update-nsexcludes:process.name field:"process.name" value:"snap-update-ns"
process.nameeqsnapdexcludes:process.name field:"process.name" value:"snapd"
process.nameeqsshdexcludes:process.name field:"process.name" value:"sshd"
process.nameeqsystemdexcludes:process.name field:"process.name" value:"systemd"
process.nameequnattended-upgradeexcludes:process.name field:"process.name" value:"unattended-upgrade"
process.nameequpdate-alternativesexcludes:process.name field:"process.name" value:"update-alternatives"
process.nameeqvmis-launcherexcludes:process.name field:"process.name" value:"vmis-launcher"
process.nameeqyumexcludes:process.name field:"process.name" value:"yum"
process.namestarts_withpipexcludes:process.name field:"process.name" value:"pip"
process.namestarts_withplatform-pythonexcludes:process.name field:"process.name" value:"platform-python"
process.namestarts_withpythonexcludes:process.name field:"process.name" value:"python"

Shellcode Execution via a CallBack Function

#
Source
github.com/elastic/protections-artifacts

Identifies attemtps to call Windows memory management APIs from unusual Microsoft call back function. This may indicate an attempt to execute shellcode.

MITRE ATT&CK Coverage

TacticTechniques
Stealth

Rule Body

[rule]
description = """
Identifies attemtps to call Windows memory management APIs from unusual Microsoft call back function. This may indicate
an attempt to execute shellcode.
"""
id = "976d1f98-59ab-452c-858b-cb1596355564"
license = "Elastic License v2"
name = "Shellcode Execution via a CallBack Function"
os_list = ["windows"]
reference = ["https://github.com/ChaitanyaHaritash/Callback_Shellcode_Injection/tree/main"]
version = "1.0.3"

query = '''
api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory","VirtualProtectEx", "VirtualAllocEx") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined", "kernel") and
 process.thread.Ext.call_stack_final_user_module.name != null and

 /* most abused callBack functions */
 _arraysearch(process.thread.Ext.call_stack, $entry,
              $entry.symbol_info like
                                  ("c:\\windows\\sys?????\\user32.dll!EnumChildWindows+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumWindows+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumDesktopW+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumDesktopWindows*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumThreadWindows*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumDateFormatsA*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemCodePages?*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemGeoID*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemLanguageGroups*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemLocales*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumUILanguages*")) and

 (
  (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
  _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "Unbacked+*" and $entry.protection == "RWX" and
              stringcontains~($entry.protection_provenance, process.thread.Ext.call_stack_final_user_module.protection_provenance))) or

  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or

  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|kernelbase.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or

  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or

  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat(process.thread.Ext.call_stack_final_user_module.name, "|user32.dll|")) and
   _arraysearch(process.thread.Ext.call_stack, $entry,
              stringcontains~($entry.symbol_info, process.thread.Ext.call_stack_final_user_module.name) and ($entry.callsite_trailing_bytes : "?*" or $entry.protection == "RWX")))

  ) and

  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info like
                                  ("c:\\windows\\sys?????\\ntdll.dll!KiUserCallbackDispatcher+*",
                                   "c:\\windows\\sys?????\\user32.dll!CreateDialogIndirectParam*",
                                   "c:\\windows\\sys?????\\user32.dll!AddClipboardFormatListener*",
                                   "c:\\windows\\sys?????\\user32.dll!DialogBoxParam*",
                                   "c:\\windows\\sys?????\\user32.dll!DialogBoxIndirectParam*"))
'''

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

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


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

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory","VirtualProtectEx", "VirtualAllocEx") and
 not process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined", "kernel") and
 process.thread.Ext.call_stack_final_user_module.name != null and
 _arraysearch(process.thread.Ext.call_stack, $entry,
              $entry.symbol_info like
                                  ("c:\\windows\\sys?????\\user32.dll!EnumChildWindows+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumWindows+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumDesktopW+*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumDesktopWindows*",
                                   "c:\\windows\\sys?????\\user32.dll!EnumThreadWindows*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumDateFormatsA*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemCodePages?*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemGeoID*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemLanguageGroups*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumSystemLocales*",
                                   "c:\\windows\\sys?????\\kernel32.dll!EnumUILanguages*")) and
 (
  (process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
  _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "Unbacked+*" and $entry.protection == "RWX" and
              stringcontains~($entry.protection_provenance, process.thread.Ext.call_stack_final_user_module.protection_provenance))) or
  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or
  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|kernelbase.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or
  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false or $entry.subject_name in ("AutoIt Consulting Ltd", "Python Software Foundation", "The MathWorks, Inc.")) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat("ntdll.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance))) or
  (_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
   stringcontains~(process.thread.Ext.call_stack_summary, concat(process.thread.Ext.call_stack_final_user_module.name, "|user32.dll|")) and
   _arraysearch(process.thread.Ext.call_stack, $entry,
              stringcontains~($entry.symbol_info, process.thread.Ext.call_stack_final_user_module.name) and ($entry.callsite_trailing_bytes : "?*" or $entry.protection == "RWX")))
  ) and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info like
                                  ("c:\\windows\\sys?????\\ntdll.dll!KiUserCallbackDispatcher+*",
                                   "c:\\windows\\sys?????\\user32.dll!CreateDialogIndirectParam*",
                                   "c:\\windows\\sys?????\\user32.dll!AddClipboardFormatListener*",
                                   "c:\\windows\\sys?????\\user32.dll!DialogBoxParam*",
                                   "c:\\windows\\sys?????\\user32.dll!DialogBoxIndirectParam*"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.namein
  • VirtualAlloc corpus 27 (elastic 27)
  • VirtualAllocEx corpus 22 (elastic 22)
  • VirtualProtect corpus 35 (elastic 35)
  • VirtualProtectEx corpus 29 (elastic 29)
  • WriteProcessMemory corpus 23 (elastic 23)
field:"process.Ext.api.name" kind:in
process.thread.Ext.call_stack_final_user_module.nameeq
  • Unbacked corpus 21 (elastic 21)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:eq value:"Unbacked"
process.thread.Ext.call_stack_final_user_module.nameis_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:is_not_null
process.thread.Ext.call_stack_summarycontains
  • concat("ntdll.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance) (expression)
  • concat("ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance) (expression)
  • concat("ntdll.dll|kernelbase.dll|Unbacked|user32.dll|", process.thread.Ext.call_stack_final_user_module.protection_provenance) (expression)
  • concat(process.thread.Ext.call_stack_final_user_module.name, "|user32.dll|") (expression)
field:"process.thread.Ext.call_stack_summary" kind:contains

Exclusions

The rule actively suppresses these predicates.

Spike in Group Privilege Change Events

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

A machine learning job has identified an unusual spike in Okta group privilege change events, indicating potential privileged access activity. Attackers might be elevating privileges by adding themselves or compromised accounts to high-privilege groups, enabling further access or persistence.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2025/02/18"
integration = ["pad", "okta"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has identified an unusual spike in Okta group privilege change events, indicating potential
privileged access activity. Attackers might be elevating privileges by adding themselves or compromised accounts to
high-privilege groups, enabling further access or persistence.
"""
from = "now-3h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_okta_spike_in_group_privilege_changes_ea"
name = "Spike in Group Privilege Change Events"
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 Group Privilege Change Events

In environments using Okta, group privilege changes are crucial for managing access. Adversaries may exploit this by adding themselves to privileged groups, gaining unauthorized access. The detection rule leverages machine learning to identify unusual spikes in these events, signaling potential privilege escalation attempts, thus aiding in early threat detection and response.

### Possible investigation steps

- Review the specific group privilege change events identified by the machine learning job to determine which accounts were added to privileged groups.
- Cross-reference the accounts involved in the privilege changes with recent login activity to identify any unusual or suspicious access patterns.
- Check the history of privilege changes for the affected groups to see if there is a pattern of unauthorized access or if this is an isolated incident.
- Investigate the source IP addresses and locations associated with the privilege change events to identify any anomalies or unexpected geolocations.
- Examine any recent changes to the accounts involved, such as password resets or multi-factor authentication (MFA) modifications, to assess if they have been compromised.
- Collaborate with the affected users or their managers to verify if the privilege changes were authorized and legitimate.

### False positive analysis

- Routine administrative tasks may trigger spikes in group privilege changes. Regularly scheduled audits or updates to group memberships should be documented and excluded from alerts.
- Automated scripts or tools that manage user access can cause frequent changes. Identify these scripts and create exceptions for their activity to prevent false positives.
- Organizational restructuring or mergers often lead to bulk updates in group privileges. During these periods, temporarily adjust the sensitivity of the detection rule or whitelist specific activities.
- Onboarding or offboarding processes can result in a high volume of legitimate group changes. Coordinate with HR and IT to anticipate these events and adjust monitoring accordingly.
- Changes in security policies or compliance requirements might necessitate widespread privilege adjustments. Ensure these policy-driven changes are communicated to the security team to avoid unnecessary alerts.

### Response and remediation

- Immediately isolate the affected accounts by removing them from any high-privilege groups to prevent further unauthorized access.
- Conduct a thorough review of recent group membership changes in Okta to identify any other unauthorized privilege escalations.
- Reset passwords and enforce multi-factor authentication for the affected accounts to secure them against further compromise.
- Notify the security team and relevant stakeholders about the incident for awareness and potential escalation if further suspicious activity is detected.
- Implement additional monitoring on the affected accounts and privileged groups to detect any further unauthorized changes or access attempts.
- Review and update access control policies to ensure that only authorized personnel can modify group memberships, reducing the risk of future privilege escalation.
- Document the incident, including all actions taken, to improve response strategies and inform future security measures."""
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 = "02b4420d-eda2-4529-9e46-4a60eccb7e2d"
setup = """## Setup

The rule requires the Privileged Access Detection integration assets to be installed, as well as Okta logs collected by integrations such as Okta.

### Privileged Access Detection Setup
The Privileged Access Detection integration detects privileged access activity by identifying abnormalities in Windows, Linux and Okta events. Anomalies are detected using Elastic's Anomaly Detection feature.

#### Prerequisite Requirements:
- Fleet is required for Privileged Access Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Okta events collected by [Okta](https://docs.elastic.co/en/integrations/okta) integration.
- To add the Okta integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.

#### The following steps should be executed to install assets associated with the Privileged Access Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Privileged Access Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Data Source: Okta",
    "Use Case: Privileged Access Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

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

[[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/"

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

Suspicious Access to AppArmor Policy Management Files

#
Source
github.com/elastic/protections-artifacts

Detects processes accessing AppArmor policy management pseudo-files located under "/sys/kernel/security/apparmor/". These special kernel interfaces are used to load, replace, or remove AppArmor profiles (".load", ".replace", ".remove"). In normal environments, AppArmor policy management is typically performed by administrative tools such as "apparmor_parser" during system initialization or package installation. Direct interaction with these pseudo-files from shell utilities, interpreters, or scripting environments is uncommon and may indicate attempts to modify security policy at runtime. Adversaries may abuse these interfaces to weaken or disable AppArmor protections, introduce malicious profiles, or exploit vulnerabilities in the AppArmor policy parser as part of local privilege escalation chains.

MITRE ATT&CK Coverage

TacticTechniques
Defense Impairment

Rule Body

[rule]
description = """
Detects processes accessing AppArmor policy management pseudo-files located under "/sys/kernel/security/apparmor/".
These special kernel interfaces are used to load, replace, or remove AppArmor profiles (".load", ".replace", ".remove").
In normal environments, AppArmor policy management is typically performed by administrative tools such as
"apparmor_parser" during system initialization or package installation. Direct interaction with these pseudo-files from
shell utilities, interpreters, or scripting environments is uncommon and may indicate attempts to modify security policy
at runtime. Adversaries may abuse these interfaces to weaken or disable AppArmor protections, introduce malicious
profiles, or exploit vulnerabilities in the AppArmor policy parser as part of local privilege escalation chains.
"""
id = "bb0b594d-a674-47c7-9500-d48eb289e679"
license = "Elastic License v2"
name = "Suspicious Access to AppArmor Policy Management Files"
os_list = ["linux"]
reference = [
    "https://cdn2.qualys.com/advisory/2026/03/10/crack-armor.txt",
    "https://blog.qualys.com/vulnerabilities-threat-research/2026/03/12/crackarmor-critical-apparmor-flaws-enable-local-privilege-escalation-to-root",
]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action == "exec" and (
  process.name in (
    "cat", "echo", "tee", "dd", "truncate", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "busybox", "awk", "sed", "xargs", "find", "grep", "node", "timeout", "env"
  ) or
  process.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*")
) and
process.command_line like (
  "*/sys/kernel/security/apparmor/.load*",
  "*/sys/kernel/security/apparmor/.replace*",
  "*/sys/kernel/security/apparmor/.remove*"
)
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "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 in (
    "cat", "echo", "tee", "dd", "truncate", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish",
    "busybox", "awk", "sed", "xargs", "find", "grep", "node", "timeout", "env"
  ) or
  process.name like (".*", "python*", "perl*", "ruby*", "lua*", "php*")
) and
process.command_line like (
  "*/sys/kernel/security/apparmor/.load*",
  "*/sys/kernel/security/apparmor/.replace*",
  "*/sys/kernel/security/apparmor/.remove*"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • */sys/kernel/security/apparmor/.load*
  • */sys/kernel/security/apparmor/.remove*
  • */sys/kernel/security/apparmor/.replace*
field:"CommandLine" kind:wildcard
process.namein
  • awk
  • bash
  • busybox
  • cat
  • csh
  • dash
  • dd
  • echo
  • env
  • find
  • fish
  • grep
  • ksh
  • node
  • sed
  • sh
  • tcsh
  • tee
  • timeout
  • truncate
  • xargs
  • zsh
field:"process_basename" kind:in
process.namewildcard
  • .*
  • lua*
  • perl*
  • php*
  • python*
  • ruby*
field:"process_basename" kind:wildcard

Suspicious Execution of Unsigned or Untrusted Process via Sudo

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

Detects when Sudo is used to execute an untrusted or unsigned binary via the -S option allowing a password or pre-gathered key to be piped to the binary upon execution. A recent stealer sample was seen executing a second stage payload in this manner passing the user provided password to supply the second stage payload with upon execution. The use of Sudo with the -S option in itself is not common but when its used to execute an untrusted or unsigned binary it should be considered highly suspicious acitvity.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when Sudo is used to execute an untrusted or unsigned binary via the -S option allowing a password or
pre-gathered key to be piped to the binary upon execution. A recent stealer sample was seen executing a second stage
payload in this manner passing the user provided password to supply the second stage payload with upon execution. The
use of Sudo with the -S option in itself is not common but when its used to execute an untrusted or unsigned binary it
should be considered highly suspicious acitvity.
"""
id = "7998fa77-dc94-4bd7-b458-34cf1cbcee9a"
license = "Elastic License v2"
name = "Suspicious Execution of Unsigned or Untrusted Process via Sudo"
os_list = ["macos"]
reference = ["https://x.com/moonlock_lab/status/1815640547551306015"]
version = "1.0.6"

query = '''
sequence with maxspan=5s
[process where event.type == "start" and event.action == "exec" and process.name == "sudo" and 
  process.args == "-S"] by process.entity_id
[process where event.type == "start" and event.action == "exec" and process.parent.name == "sudo" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false)] by process.parent.entity_id
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"



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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name == "sudo" and 
  process.args == "-S"] by process.entity_id

Stage 2: process

[process where event.type == "start" and event.action == "exec" and process.parent.name == "sudo" and 
  (process.code_signature.trusted == false or process.code_signature.exists == false)] by process.parent.entity_id

Indicators

These rows show field, operator, and value matches.

Suspicious File Downloaded from Google Drive

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

Identifies suspicious file download activity from a Google Drive URL. This could indicate an attempt to deliver phishing payloads via a trusted webservice.

Known False Positives

  • Approved third-party applications that use Google Drive download URLs.
  • Legitimate publicly shared files from Google Drive.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2023/06/19"
integration = ["endpoint", "system"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Identifies suspicious file download activity from a Google Drive URL. This could indicate an attempt to deliver phishing
payloads via a trusted webservice.
"""
false_positives = [
    "Approved third-party applications that use Google Drive download URLs.",
    "Legitimate publicly shared files from Google Drive.",
]
from = "now-9m"
index = ["auditbeat-*", "logs-endpoint*", "logs-system.security*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious File Downloaded from Google Drive"
references = ["https://intelligence.abnormalsecurity.com/blog/google-drive-matanbuchus-malware"]
risk_score = 47
rule_id = "a8afdce2-0ec1-11ee-b843-f661ea17fbcd"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "OS: Windows",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where

    /* common browser processes  */
    event.action in ("exec", "fork", "start") and

    process.name : ("Microsoft Edge", "chrome.exe", "Google Chrome", "google-chrome-stable",
                    "google-chrome-beta", "google-chrome", "msedge.exe", "firefox.exe", "brave.exe",
                    "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe", "firefox",
                    "powershell.exe", "curl", "curl.exe", "wget", "wget.exe") and

    /* Look for Google Drive download URL with AV flag skipping */
    (process.command_line : "*drive.google.com*" and process.command_line : "*export=download*" and process.command_line : "*confirm=no_antivirus*")
'''
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 File Downloaded from Google Drive

Google Drive is a widely-used cloud storage service that allows users to store and share files. Adversaries may exploit its trusted nature to distribute malicious files, bypassing security measures by using download links with antivirus checks disabled. The detection rule identifies such activities by monitoring browser processes for specific Google Drive download patterns, flagging potential threats for further investigation.

### Possible investigation steps

- Review the process command line details to confirm the presence of the Google Drive download URL with the "export=download" and "confirm=no_antivirus" parameters, which indicate an attempt to bypass antivirus checks.
- Identify the user account associated with the process to determine if the activity aligns with their typical behavior or if it appears suspicious.
- Check the file downloaded from the Google Drive URL for any known malicious signatures or behaviors using a reputable antivirus or malware analysis tool.
- Investigate the source of the download link to determine if it was shared via email, messaging, or another communication channel, and assess the legitimacy of the source.
- Analyze network logs to identify any additional suspicious activity or connections related to the IP address or domain associated with the download.
- Review historical data for any previous similar alerts or activities involving the same user or device to identify potential patterns or repeated attempts.

### False positive analysis

- Legitimate file sharing activities from Google Drive may trigger alerts if users frequently download files for business purposes. To manage this, create exceptions for specific users or departments known to use Google Drive extensively for legitimate work.
- Automated scripts or tools that download files from Google Drive for regular data processing tasks might be flagged. Identify these scripts and whitelist their associated processes or command lines to prevent unnecessary alerts.
- Educational institutions or research organizations often share large datasets via Google Drive, which could be mistakenly flagged. Implement exceptions for known educational or research-related Google Drive URLs to reduce false positives.
- Internal IT or security teams may use Google Drive to distribute software updates or patches. Recognize these activities and exclude them by specifying trusted internal Google Drive links or user accounts.
- Collaboration with external partners who use Google Drive for file sharing can lead to false positives. Establish a list of trusted partners and their associated Google Drive URLs to minimize unnecessary alerts.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further spread of potential malware or unauthorized access.
- Quarantine the downloaded file and perform a detailed malware analysis using a sandbox environment to determine its behavior and potential impact.
- If malware is confirmed, initiate a full system scan using updated antivirus and anti-malware tools to identify and remove any additional threats.
- Review and analyze the process command line logs to identify any other suspicious activities or downloads that may have occurred concurrently.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are compromised.
- Implement network-level blocking of the specific Google Drive URL or domain if it is confirmed to be malicious, to prevent future access.
- Update endpoint detection and response (EDR) systems with indicators of compromise (IOCs) identified during the analysis to enhance detection of similar threats in the future."""


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

[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"

[[rule.threat.technique.subtechnique]]
id = "T1102.003"
name = "One-Way Communication"
reference = "https://attack.mitre.org/techniques/T1102/003/"

[[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/"

Stages and Predicates

Stage 1: process

process where
    event.action in ("exec", "fork", "start") and
    process.name : ("Microsoft Edge", "chrome.exe", "Google Chrome", "google-chrome-stable",
                    "google-chrome-beta", "google-chrome", "msedge.exe", "firefox.exe", "brave.exe",
                    "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe", "firefox",
                    "powershell.exe", "curl", "curl.exe", "wget", "wget.exe") and
    (process.command_line : "*drive.google.com*" and process.command_line : "*export=download*" and process.command_line : "*confirm=no_antivirus*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec corpus 180 (elastic 180)
  • fork corpus 6 (elastic 6)
  • start corpus 157 (elastic 157)
field:"EventType" kind:in
process.command_linewildcard
  • *confirm=no_antivirus*
  • *drive.google.com*
  • *export=download*
field:"CommandLine" kind:wildcard
process.namewildcard
  • Google Chrome
  • Microsoft Edge
  • brave.exe corpus 7 (elastic 7)
  • browser.exe corpus 7 (elastic 7)
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • curl corpus 15 (elastic 11, splunk 4)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • dragon.exe corpus 7 (elastic 7)
  • firefox
  • firefox.exe corpus 5 (elastic 5)
  • google-chrome
  • google-chrome-beta
  • google-chrome-stable
  • msedge.exe corpus 12 (elastic 12)
  • opera.exe corpus 3 (elastic 3)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • vivaldi.exe corpus 6 (elastic 6)
  • wget corpus 10 (elastic 9, splunk 1)
  • wget.exe corpus 7 (elastic 7)
  • whale.exe corpus 4 (elastic 4)
field:"process_basename" kind:wildcard

Suspicious Kerberos Authentication Ticket Request

#
Status
production
Severity
high
Time window
3s
Sequence by
source.ip, source.port
Author
Elastic
Source
github.com/elastic/detection-rules

Correlates network connections to the standard Kerberos port by an unusual process from the source machine with a Kerberos authentication ticket request from the target domain controller.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/10/28"
integration = ["endpoint", "windows", "system"]
maturity = "production"
updated_date = "2026/07/02"

[rule]
author = ["Elastic"]
description = """
Correlates network connections to the standard Kerberos port by an unusual process from the source machine with a
Kerberos authentication ticket request from the target domain controller.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.network-*",
    "logs-windows.sysmon_operational-*",
    "logs-system.security*",
    "logs-windows.forwarded*",
    "winlogbeat-*"
]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Kerberos Authentication Ticket Request"
references = [
"https://github.com/its-a-feature/bifrost", 
"https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4768",
"https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4769"
]
risk_score = 73
rule_id = "c6b40f4c-c6a9-434e-adb8-989b0d06d005"
severity = "high"
tags = [
    "Domain: Endpoint",
    "Domain: Identity",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Use Case: Active Directory Monitoring",
    "Data Source: Active Directory",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Windows Security Event Logs",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence by source.port, source.ip with maxspan=3s
 [network where host.os.type == "windows" and destination.port == 88 and
  process.executable != null and process.pid != 4 and 
  not process.executable : (
        "?:\\Windows\\system32\\lsass.exe",
        "\\device\\harddiskvolume*\\windows\\system32\\lsass.exe",
        "\\device\\harddiskvolume*\\windows\\system32\\svchost.exe"
  ) and
  not (
    process.executable : (
      "C:\\Windows\\System32\\svchost.exe",
      "C:\\Program Files\\VMware\\VMware View\\Server\\bin\\ws_TomcatService.exe",
      "C:\\Program Files\\Omnissa\\Horizon\\Server\\bin\\ws_TomcatService.exe",
      "C:\\Program Files\\SysAidServer\\root\\WEB-INF\\domains\\NetworkDiscovery.exe",
      "C:\\Program Files (x86)\\IGEL\\RemoteManager\\*\\bin\\tomcat10.exe",
      "F:\\IGEL\\RemoteManager\\*\\bin\\tomcat10.exe"
    ) and
    user.id in ("S-1-5-20", "S-1-5-18")
  ) and
  source.ip != "127.0.0.1" and destination.ip != "::1" and destination.ip != "127.0.0.1"]
 [authentication where host.os.type == "windows" and event.code in ("4768", "4769")]
'''

note = """## Triage and analysis

### Investigating Suspicious Kerberos Authentication Ticket Request

#### Possible investigation steps

- Which Timeline member events define this Kerberos sequence?
  - Focus: Timeline members keyed by alert `source.ip` and `source.port`; recover source `process.executable`, Kerberos `destination.ip`, and auth `event.code`.
  - Hint: record `host.id` and `process.entity_id`; verify auth `winlog.computer_name` is the DC.
  - Implication: escalate when one non-"lsass.exe" source process maps to a DC "4768" or "4769" event in the sequence window; lower concern for socket reuse, a different process, or non-DC destination.

- Is the recovered source process a recognized Kerberos-capable client?
  - Focus: `process.executable`, `process.hash.sha256`, `process.pe.original_file_name`, `process.code_signature.subject_name`, and `process.code_signature.trusted`.
  - Hint: open process start with recovered `host.id` and `process.entity_id`; if absent, use `host.id`, `process.pid`, and sequence window.
  - Implication: escalate when the binary is unsigned, renamed, user-writable, signer-mismatched, or outside known AD audit, Kerberos diagnostic, or security-test tooling; lower concern only when path, signer, hash history, command, and parent converge on one known tool.

- Does command-line and parentage show ticket-tool intent?
  - Focus: recovered `process.command_line`, `process.parent.executable`, `process.parent.command_line`, and broader process lineage when needed.
  - Implication: escalate on Bifrost-like verbs or flags such as asktgt, asktgs, s4u, ptt, kerberoast, service/SPN targets, hashes, keytabs, RC4, or base64 tickets, especially from shell or script parents; bounded diagnostics from a recognized admin tool reduce but do not clear concern.

- Which ticket path and target account did the DC member event show?
  - Focus: recovered auth `event.code`, `winlog.event_data.TargetUserName`, and `winlog.event_data.TargetDomainName`.
  - Implication: escalate when "4769" shows service-ticket activity or "4768" shows TGT handling for privileged, service, machine, or delegation-sensitive targets from the unusual process; fan-out increases concern.

- Does the source user and session context fit one bounded admin or audit source?
  - Focus: recovered `user.id`, `user.name`, `user.domain`, and `winlog.event_data.TargetUserName`.
  - Implication: escalate when privileged, service, or user-account tickets originate from a workstation, user session, or non-management tool; lower concern only when source host, user, process identity, command/parent, and target account recur as one bounded Kerberos diagnostic or audit pattern.

- Do surrounding Kerberos events show repetition or account fan-out?
  - Focus: same-source Kerberos network and authentication events, checking additional "4768"/"4769" events and `winlog.event_data.TargetUserName`.
    - $investigate_0
    - $investigate_1
  - Implication: escalate when requests repeat or fan out across accounts; a single bounded request narrows scope but does not close if process identity or command intent remains suspicious. Missing network or authentication telemetry is unresolved, not benign.

- Do later logon or explicit-credential events suggest ticket use?
  - Focus: same-source authentication results, checking later `event.code` "4624"/"4648", `winlog.event_data.TargetUserName`, and 4648 `winlog.event_data.TargetServerName`.
  - Implication: escalate when post-ticket logon or explicit-credential activity reaches sensitive accounts or servers from the same source; absence narrows impact but does not close if the ticket request remains suspicious. Missing same-source authentication telemetry leaves ticket use unresolved, not benign.

- If local evidence remains suspicious or unresolved, does the same source show related alerts?
  - Focus: related alerts for `source.ip`; manually pivot on recovered `process.hash.sha256` or `winlog.event_data.TargetUserName` when locally suspicious. $investigate_2
  - Implication: broaden scope when credential-access, Kerberoasting, relay, or lateral-movement alerts share the source, process, or target account; keep local only when related alerts are absent and recovered evidence resolves cleanly.

- Escalate when sequence recovery, source-process identity, command intent, DC ticket target, account context, or surrounding ticket/logon activity show unauthorized direct Kerberos; close only when telemetry binds one recognized tool, source host, user, and target account and outside confirmation verifies exact activity when telemetry cannot; preserve and escalate when visibility is incomplete or evidence conflicts.

### False positive analysis

- AD audit tools, Kerberos diagnostics, interoperability testing, or security testing can request tickets directly instead of through "lsass.exe". Confirm only when process path, signer/hash, parent, command line, `source.ip`, `user.id`, `event.code`, and target account align with the same recognized tool on a dedicated admin, lab, or audit source; without outside records, require the same process identity, source host/user, target account, and bounded ticket pattern across prior alerts from this rule.
- Treat partial matches as unresolved when process identity fits but the command targets unusual SPNs, privileged accounts, RC4/kerberoast behavior, or follow-on "4624"/"4648" activity. Do not close on signer, source IP, or event code alone when ticket target or command intent contradicts benign workflow.
- Before creating an exception, anchor it to the minimum stable workflow: dedicated `source.ip` or source host, process signer/hash/path, parent workflow, `user.id`, target account, and bounded `event.code` pattern. Avoid exceptions on `source.port`, `event.code`, process name, or broad account patterns alone.

### Response and remediation

- If confirmed benign, reverse temporary containment and document the recovered source host/IP, process identity, command line, source user, DC ticket event, and target account that proved the recognized workflow. Create an exception only after the same dedicated source and process pattern recurs consistently.
- If suspicious but unconfirmed, preserve the alert, Timeline member events, suspicious process binary and command line, source socket, DC authentication record, and any follow-on "4624" or "4648" evidence before containment or process action.
- Apply reversible containment next: restrict the recovered source host's Kerberos/DC access or isolate the host when its role tolerates isolation, and suspend the recovered process only after process and authentication artifacts are captured.
- If confirmed malicious, isolate the recovered source host, terminate or suspend the recovered process after recording its `process.entity_id`, expire exposed Kerberos tickets where operationally appropriate, and reset or rotate impacted credentials, prioritizing privileged, service, machine, and delegation-capable accounts.
- Before cleanup, search for the same source IP, recovered process hash, target account, and related credential-access, Kerberoasting, relay, or lateral-movement activity so scope is not limited to the first sequence.
- After containment, retain DC "4768"/"4769" auditing and endpoint network telemetry, restrict direct Kerberos tooling to controlled admin/testing hosts, and document the recovered tool pattern and any logging gaps in the case record.
"""

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 3 - Network Connection](https://ela.st/sysmon-event-3-setup)
- [Audit Kerberos Authentication Service](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/audit-kerberos-authentication-service)
- [Audit Kerberos Service Ticket Operations](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/audit-kerberos-service-ticket-operations)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "source.ip",
    "source.port",
    "host.id",
]

[transform]

[[transform.investigate]]
label = "Kerberos network events from the same source IP"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
    { excluded = false, field = "source.ip", queryType = "phrase", value = "{{source.ip}}", valueType = "string" },
    { excluded = false, field = "destination.port", queryType = "phrase", value = "88", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Authentication events for the same source IP"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "authentication", valueType = "string" },
    { excluded = false, field = "source.ip", queryType = "phrase", value = "{{source.ip}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the same source IP"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "source.ip", queryType = "phrase", value = "{{source.ip}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[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.technique.subtechnique]]
id = "T1550.003"
name = "Pass the Ticket"
reference = "https://attack.mitre.org/techniques/T1550/003/"

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

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

[[rule.threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"

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

[[rule.threat.technique.subtechnique]]
id = "T1558.004"
name = "AS-REP Roasting"
reference = "https://attack.mitre.org/techniques/T1558/004/"

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

Stages and Predicates

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

Stage 1: network

[network where host.os.type == "windows" and destination.port == 88 and
  process.executable != null and process.pid != 4 and 
  not process.executable : (
        "?:\\Windows\\system32\\lsass.exe",
        "\\device\\harddiskvolume*\\windows\\system32\\lsass.exe",
        "\\device\\harddiskvolume*\\windows\\system32\\svchost.exe"
  ) and
  not (
    process.executable : (
      "C:\\Windows\\System32\\svchost.exe",
      "C:\\Program Files\\VMware\\VMware View\\Server\\bin\\ws_TomcatService.exe",
      "C:\\Program Files\\Omnissa\\Horizon\\Server\\bin\\ws_TomcatService.exe",
      "C:\\Program Files\\SysAidServer\\root\\WEB-INF\\domains\\NetworkDiscovery.exe",
      "C:\\Program Files (x86)\\IGEL\\RemoteManager\\*\\bin\\tomcat10.exe",
      "F:\\IGEL\\RemoteManager\\*\\bin\\tomcat10.exe"
    ) and
    user.id in ("S-1-5-20", "S-1-5-18")
  ) and
  source.ip != "127.0.0.1" and destination.ip != "::1" and destination.ip != "127.0.0.1"]

Stage 2: authentication

[authentication where host.os.type == "windows" and event.code in ("4768", "4769")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.ipne
  • 127.0.0.1 corpus 7 (elastic 7)
  • ::1 corpus 5 (elastic 5)
field:"dest_ip" kind:ne
destination.porteq
  • 88 transforms: number corpus 4 (elastic 4)
field:"DestinationPort" kind:eq value:"88"
event.codein
  • 4768
  • 4769
field:"EventID" kind:in
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
source.ipne
  • 127.0.0.1 corpus 22 (elastic 22)
field:"src_ip" kind:ne value:"127.0.0.1"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcardC:\Windows\System32\svchost.exe, C:\Program Files\VMware\VMware View\Server\bin\ws_TomcatService.exe, C:\Program Files\Omnissa\Horizon\Server\bin\ws_TomcatService.exe, C:\Program Files\SysAidServer\root\WEB-INF\domains\NetworkDiscovery.exe, C:\Program Files (x86)\IGEL\RemoteManager\*\bin\tomcat10.exe, F:\IGEL\RemoteManager\*\bin\tomcat10.exeexcludes:process.executable
user.idinS-1-5-18, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-20"
process.executablewildcard?:\Windows\system32\lsass.exe, \device\harddiskvolume*\windows\system32\lsass.exe, \device\harddiskvolume*\windows\system32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\system32\lsass.exe" field:"process.executable" value:"\device\harddiskvolume*\windows\system32\lsass.exe" field:"process.executable" value:"\device\harddiskvolume*\windows\system32\svchost.exe"

Suspicious Process with a Spoofed Parent

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

Detects attempts to start a process with a fake parent process identity to blend in with normal parent child process tree.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects attempts to start a process with a fake parent process identity to blend in with normal parent child process
tree.
"""
id = "667a1895-5920-4fb2-820f-16c356f79341"
license = "Elastic License v2"
name = "Suspicious Process with a Spoofed Parent"
os_list = ["windows"]
version = "1.0.16"

query = '''
sequence with maxspan=1m
 [process where event.action == "start" and process.parent.Ext.real.pid > 0 and 
  not (process.name : "powershell.exe" and process.args : "Invoke-InProcessStub" and 
       process.args : "$execWrapper" and process.args : "\"ANSIBLE_BOOTSTRAP_ERROR:") and
  not (process.name : "WerFault.exe" and
       process.parent.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|faultrep.dll|wersvc.dll|*")] by process.parent.Ext.real.entity_id
 [api where 
  process.executable : "?:\\*" and 
  process.Ext.api.name == "WriteProcessMemory" and process.parent.executable != null and 
  
  not (process.executable : ("?:\\windows\\system32\\svchost.exe", "?:\\Windows\\System32\\sppsvc.exe") and
       process.parent.executable : "?:\\Windows\\System32\\services.exe") and

  not process.executable : ("?:\\Windows\\System32\\RuntimeBroker.exe", 
                            "?:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe", 
                            "?:\\Windows\\SoftwareDistribution\\*.exe",
                            "?:\\Windows\\System32\\WerFaultSecure.exe",
                            "?:\\WINDOWS\\SysWOW64\\WerFaultSecure.exe",
                            "?:\\Program Files\\Macrium\\Common\\MacriumService.exe") and
							 
  not (process.executable : ("*\\Program Files (x86)\\*.exe", "*\\Program Files\\*.exe") and process.code_signature.trusted == true) and 


  not (process.code_signature.subject_name : ("BeyondTrust Software, Inc", "Michael Maltsev", "BeyondTrust Software Inc", "Malwarebytes Inc.", "Malwarebytes Inc", "Proton AG") and
       process.code_signature.trusted == true) and

  not (process.name : ("devenv.exe", "PowerToys.exe", "notification_helper.exe", "cpptools.exe") and process.code_signature.trusted == true and 
       process.code_signature.subject_name : "Microsoft*") and 

  not (process.executable : 
                ("?:\\Windows\\System32\\backgroundTaskHost.exe", 
                 "?:\\Windows\\System32\\SystemSettingsBroker.exe", 
                 "?:\\Windows\\SystemApps\\Microsoft*.exe", 
                 "?:\\WINDOWS\\system32\\OpenWith.exe", 
                 "?:\\WINDOWS\\syswow64\\OpenWith.exe", 
                 "?:\\Windows\\System32\\PickerHost.Exe",
                 "?:\\WINDOWS\\Microsoft.NET\\Framework\\*\\RegAsm.exe") and 
        process.parent.executable : "?:\\Windows\\system32\\svchost.exe") and

  not (process.name : "tailscale-ipn.exe" and
        process.code_signature.subject_name == "Tailscale Inc." and
        (process.code_signature.trusted == true or process.code_signature.status == "errorChaining")) and
	
  not (process.code_signature.subject_name == "Roblox Corporation" and
        (process.code_signature.trusted == true or process.code_signature.status == "errorTimeStamp")) and
  not process.thread.Ext.call_stack_final_user_module.path : ("c:\\program files\\sentinelone\\*.dll") and
  not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
                                        ("07e82c4bc4f48e94a634480ff5140b94b2026a7716473867806355957dc4d291",
                                         "b1179b4476d19f8861c5f331b0805fc47fe86101875abf87ca7805d9d0523db5",
                                         "9ab9db0eb58feb23271a6ecce89bc3de36df95a6304a7f91c02260067d9b88c4",
                                         "74eaa6197dc723f93cdb509a2ce59ffd4b302e9117585d32d56b8c4255253f50",
                                         "97b930b2d7af917d9fba37c03709da1c929cb97ea6c43cda823702ad3f96786e",
                                         "913f3371d4aa9f77d0e7cc480918558aac95f148d77e4f5475c0db4f73194863") and
  not process.thread.Ext.call_stack_final_user_module.path :
                                      ("c:\\program files\\avecto\\privilege guard client\\pghook.dll",
                                       "c:\\program files (x86)\\webroot\\wrsa.exe") and
  not (process.executable : "?:\\Windows\\System32\\wermgr.exe" and
       process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and
       process.thread.Ext.call_stack_final_user_module.path : "c:\\windows\\system32\\windows.storage.dll") and

  not process.executable : "C:\\Program Files (x86)\\IBM\\Client Access\\Emulator\\pcssnd.exe" and

  not (process.executable : "C:\\Windows\\System32\\ShellHost.exe" and process.parent.executable : "C:\\Windows\\System32\\sihost.exe") and
  not (process.name : "FileCoAuth.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\windows.storage.dll" and
       process.Ext.api.summary == "WriteProcessMemory( Self, Data, 0x1 )")
  ] by process.entity_id
'''

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

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

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

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

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

[[threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[[threat.technique.subtechnique]]
id = "T1134.004"
name = "Parent PID Spoofing"
reference = "https://attack.mitre.org/techniques/T1134/004/"



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

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and process.parent.Ext.real.pid > 0 and 
  not (process.name : "powershell.exe" and process.args : "Invoke-InProcessStub" and 
       process.args : "$execWrapper" and process.args : "\"ANSIBLE_BOOTSTRAP_ERROR:") and
  not (process.name : "WerFault.exe" and
       process.parent.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|faultrep.dll|wersvc.dll|*")] by process.parent.Ext.real.entity_id

Stage 2: api

[api where 
  process.executable : "?:\\*" and 
  process.Ext.api.name == "WriteProcessMemory" and process.parent.executable != null and 
  
  not (process.executable : ("?:\\windows\\system32\\svchost.exe", "?:\\Windows\\System32\\sppsvc.exe") and
       process.parent.executable : "?:\\Windows\\System32\\services.exe") and

  not process.executable : ("?:\\Windows\\System32\\RuntimeBroker.exe", 
                            "?:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe", 
                            "?:\\Windows\\SoftwareDistribution\\*.exe",
                            "?:\\Windows\\System32\\WerFaultSecure.exe",
                            "?:\\WINDOWS\\SysWOW64\\WerFaultSecure.exe",
                            "?:\\Program Files\\Macrium\\Common\\MacriumService.exe") and
							 
  not (process.executable : ("*\\Program Files (x86)\\*.exe", "*\\Program Files\\*.exe") and process.code_signature.trusted == true) and 


  not (process.code_signature.subject_name : ("BeyondTrust Software, Inc", "Michael Maltsev", "BeyondTrust Software Inc", "Malwarebytes Inc.", "Malwarebytes Inc", "Proton AG") and
       process.code_signature.trusted == true) and

  not (process.name : ("devenv.exe", "PowerToys.exe", "notification_helper.exe", "cpptools.exe") and process.code_signature.trusted == true and 
       process.code_signature.subject_name : "Microsoft*") and 

  not (process.executable : 
                ("?:\\Windows\\System32\\backgroundTaskHost.exe", 
                 "?:\\Windows\\System32\\SystemSettingsBroker.exe", 
                 "?:\\Windows\\SystemApps\\Microsoft*.exe", 
                 "?:\\WINDOWS\\system32\\OpenWith.exe", 
                 "?:\\WINDOWS\\syswow64\\OpenWith.exe", 
                 "?:\\Windows\\System32\\PickerHost.Exe",
                 "?:\\WINDOWS\\Microsoft.NET\\Framework\\*\\RegAsm.exe") and 
        process.parent.executable : "?:\\Windows\\system32\\svchost.exe") and

  not (process.name : "tailscale-ipn.exe" and
        process.code_signature.subject_name == "Tailscale Inc." and
        (process.code_signature.trusted == true or process.code_signature.status == "errorChaining")) and
	
  not (process.code_signature.subject_name == "Roblox Corporation" and
        (process.code_signature.trusted == true or process.code_signature.status == "errorTimeStamp")) and
  not process.thread.Ext.call_stack_final_user_module.path : ("c:\\program files\\sentinelone\\*.dll") and
  not process.thread.Ext.call_stack_final_user_module.hash.sha256 :
                                        ("07e82c4bc4f48e94a634480ff5140b94b2026a7716473867806355957dc4d291",
                                         "b1179b4476d19f8861c5f331b0805fc47fe86101875abf87ca7805d9d0523db5",
                                         "9ab9db0eb58feb23271a6ecce89bc3de36df95a6304a7f91c02260067d9b88c4",
                                         "74eaa6197dc723f93cdb509a2ce59ffd4b302e9117585d32d56b8c4255253f50",
                                         "97b930b2d7af917d9fba37c03709da1c929cb97ea6c43cda823702ad3f96786e",
                                         "913f3371d4aa9f77d0e7cc480918558aac95f148d77e4f5475c0db4f73194863") and
  not process.thread.Ext.call_stack_final_user_module.path :
                                      ("c:\\program files\\avecto\\privilege guard client\\pghook.dll",
                                       "c:\\program files (x86)\\webroot\\wrsa.exe") and
  not (process.executable : "?:\\Windows\\System32\\wermgr.exe" and
       process.parent.executable : "?:\\Windows\\System32\\svchost.exe" and
       process.thread.Ext.call_stack_final_user_module.path : "c:\\windows\\system32\\windows.storage.dll") and

  not process.executable : "C:\\Program Files (x86)\\IBM\\Client Access\\Emulator\\pcssnd.exe" and

  not (process.executable : "C:\\Windows\\System32\\ShellHost.exe" and process.parent.executable : "C:\\Windows\\System32\\sihost.exe") and
  not (process.name : "FileCoAuth.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\windows.storage.dll" and
       process.Ext.api.summary == "WriteProcessMemory( Self, Data, 0x1 )")
  ] by process.entity_id

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq$execWrapperexcludes:process.args field:"process.args" value:"$execWrapper"
process.argseqInvoke-InProcessStubexcludes:process.args field:"process.args" value:"Invoke-InProcessStub"
process.argseq"ANSIBLE_BOOTSTRAP_ERROR:excludes:process.args
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.nameeqWerFault.exeexcludes:process.name field:"process.name" value:"WerFault.exe"
process.parent.thread.Ext.call_stack_summarystarts_withntdll.dll|kernelbase.dll|faultrep.dll|wersvc.dll|excludes:process.parent.thread.Ext.call_stack_summary field:"process.parent.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|faultrep.dll|wersvc.dll|"
process.code_signature.statuseqerrorChainingexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorChaining"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.code_signature.subject_nameeqTailscale Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Tailscale Inc."
process.nameeqtailscale-ipn.exeexcludes:process.name field:"process.name" value:"tailscale-ipn.exe"
process.code_signature.statuseqerrorTimeStampexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorTimeStamp"
process.code_signature.subject_nameeqRoblox Corporationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Roblox Corporation"
process.Ext.api.summaryeqWriteProcessMemory( Self, Data, 0x1 )excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"WriteProcessMemory( Self, Data, 0x1 )"
process.nameeqFileCoAuth.exeexcludes:process.name field:"process.name" value:"FileCoAuth.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\system32\windows.storage.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\windows.storage.dll"
process.code_signature.subject_nameeqBeyondTrust Software, Inc, Michael Maltsev, BeyondTrust Software Inc, Malwarebytes Inc., Malwarebytes Inc, Proton AGexcludes:process.code_signature.subject_name
process.code_signature.subject_namestarts_withMicrosoftexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft"
process.nameeqdevenv.exe, PowerToys.exe, notification_helper.exe, cpptools.exeexcludes:process.name
process.executablewildcard*\Program Files (x86)\*.exe, *\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"*\Program Files (x86)\*.exe" field:"process.executable" value:"*\Program Files\*.exe"
process.executableeq?:\Windows\System32\wermgr.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\wermgr.exe"
process.parent.executableeq?:\Windows\System32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe"
process.executableeq?:\windows\system32\svchost.exe, ?:\Windows\System32\sppsvc.exeexcludes:process.executable field:"process.executable" value:"?:\windows\system32\svchost.exe" field:"process.executable" value:"?:\Windows\System32\sppsvc.exe"
process.parent.executableeq?:\Windows\System32\services.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\services.exe"
process.executableeqC:\Windows\System32\ShellHost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\ShellHost.exe"
process.parent.executableeqC:\Windows\System32\sihost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\System32\sihost.exe"
process.executablewildcard?:\Windows\System32\backgroundTaskHost.exe, ?:\Windows\System32\SystemSettingsBroker.exe, ?:\Windows\SystemApps\Microsoft*.exe, ?:\WINDOWS\system32\OpenWith.exe, ?:\WINDOWS\syswow64\OpenWith.exe, ?:\Windows\System32\PickerHost.Exe, ?:\WINDOWS\Microsoft.NET\Framework\*\RegAsm.exeexcludes:process.executable
process.parent.executableeq?:\Windows\system32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\system32\svchost.exe"
process.executableeqC:\Program Files (x86)\IBM\Client Access\Emulator\pcssnd.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\IBM\Client Access\Emulator\pcssnd.exe"
process.executablewildcard?:\Windows\System32\RuntimeBroker.exe, ?:\Windows\ImmersiveControlPanel\SystemSettings.exe, ?:\Windows\SoftwareDistribution\*.exe, ?:\Windows\System32\WerFaultSecure.exe, ?:\WINDOWS\SysWOW64\WerFaultSecure.exe, ?:\Program Files\Macrium\Common\MacriumService.exeexcludes:process.executable
process.thread.Ext.call_stack_final_user_module.hash.sha256eq07e82c4bc4f48e94a634480ff5140b94b2026a7716473867806355957dc4d291, b1179b4476d19f8861c5f331b0805fc47fe86101875abf87ca7805d9d0523db5, 9ab9db0eb58feb23271a6ecce89bc3de36df95a6304a7f91c02260067d9b88c4, 74eaa6197dc723f93cdb509a2ce59ffd4b302e9117585d32d56b8c4255253f50, 97b930b2d7af917d9fba37c03709da1c929cb97ea6c43cda823702ad3f96786e, 913f3371d4aa9f77d0e7cc480918558aac95f148d77e4f5475c0db4f73194863excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256
process.thread.Ext.call_stack_final_user_module.patheqc:\program files\avecto\privilege guard client\pghook.dll, c:\program files (x86)\webroot\wrsa.exeexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\avecto\privilege guard client\pghook.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\webroot\wrsa.exe"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\program files\sentinelone\*.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\sentinelone\*.dll"

Suspicious Termination of ESXI Process

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

Identifies instances where VMware processes, such as "vmware-vmx" or "vmx," are terminated on a Linux system by a "kill" command. The rule monitors for the "end" event type, which signifies the termination of a process. The presence of a "kill" command as the parent process for terminating VMware processes may indicate that a threat actor is attempting to interfere with the virtualized environment on the targeted system.

MITRE ATT&CK Coverage

TacticTechniques
Impact

Rule Body

[metadata]
creation_date = "2023/04/11"
integration = ["endpoint", "crowdstrike"]
maturity = "production"
updated_date = "2025/12/19"

[rule]
author = ["Elastic"]
description = """
Identifies instances where VMware processes, such as "vmware-vmx" or "vmx," are terminated on a Linux system by a "kill"
command. The rule monitors for the "end" event type, which signifies the termination of a process. The presence of a
"kill" command as the parent process for terminating VMware processes may indicate that a threat actor is attempting to
interfere with the virtualized environment on the targeted system.
"""
from = "now-9m"
index = ["endgame-*", "logs-endpoint.events.process*", "logs-crowdstrike.fdr*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious Termination of ESXI Process"
note = """## Triage and analysis

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

### Investigating Suspicious Termination of ESXI Process

VMware ESXi is a hypervisor used to create and manage virtual machines on a host system. Adversaries may target ESXi processes like "vmware-vmx" to disrupt virtual environments, often using the "kill" command to terminate these processes. The detection rule identifies such terminations by monitoring for specific process events, helping to uncover potential threats to virtualized infrastructures.

### Possible investigation steps

- Review the alert details to confirm the process name is either "vmware-vmx" or "vmx" and that the parent process is "kill" on a Linux host.
- Check the timeline of events leading up to the termination to identify any preceding suspicious activities or commands executed by the same user or process.
- Investigate the user account associated with the "kill" command to determine if it is authorized to manage VMware processes and if there are any signs of compromise.
- Examine system logs and audit trails for any unauthorized access attempts or anomalies around the time of the process termination.
- Assess the impact on the virtual environment by verifying the status of affected virtual machines and any potential service disruptions.
- Correlate this event with other security alerts or incidents to identify if it is part of a larger attack pattern targeting the virtual infrastructure.

### False positive analysis

- Routine maintenance or administrative tasks may involve terminating VMware processes using the kill command. To manage this, create exceptions for known maintenance scripts or administrative user accounts that regularly perform these actions.
- Automated scripts or monitoring tools might inadvertently terminate VMware processes as part of their operations. Identify and exclude these tools from the detection rule by specifying their process names or user accounts.
- System updates or patches could lead to the termination of VMware processes as part of the update procedure. Exclude these events by correlating them with known update schedules or specific update-related process names.
- Testing environments where VMware processes are frequently started and stopped for development purposes can trigger false positives. Implement exclusions for these environments by using hostnames or IP addresses associated with test systems.

### Response and remediation

- Immediately isolate the affected host system from the network to prevent further malicious activity and potential spread to other systems.
- Terminate any unauthorized or suspicious processes that are still running on the affected host, especially those related to VMware ESXi, to halt any ongoing disruption.
- Conduct a forensic analysis of the affected system to identify any additional indicators of compromise or persistence mechanisms that may have been deployed by the threat actor.
- Restore any terminated VMware processes from a known good backup to ensure the virtual environment is returned to its operational state.
- Review and update access controls and permissions on the affected host to ensure that only authorized personnel can execute critical commands like "kill" on VMware processes.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat is part of a larger attack campaign.
- Implement enhanced monitoring and alerting for similar suspicious activities across the virtualized infrastructure to detect and respond to future threats more effectively."""
references = [
    "https://www.bleepingcomputer.com/news/security/massive-esxiargs-ransomware-attack-targets-vmware-esxi-servers-worldwide/",
]
risk_score = 73
rule_id = "6641a5af-fb7e-487a-adc4-9e6503365318"
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: Impact",
  "Data Source: Elastic Defend",
  "Data Source: Elastic Endgame",
  "Resources: Investigation Guide",
  "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "end" and process.name in ("vmware-vmx", "vmx")
and process.parent.name == "kill"
'''

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

[[rule.threat.technique]]
id = "T1489"
name = "Service Stop"
reference = "https://attack.mitre.org/techniques/T1489/"

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

Stages and Predicates

Stage 1: process

process where host.os.type == "linux" and event.type == "end" and process.name in ("vmware-vmx", "vmx")
and process.parent.name == "kill"

Indicators

These rows show field, operator, and value matches.

Suspicious WMI Image Load from MS Office

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

Identifies a suspicious image load (wmiutils.dll) from Microsoft Office processes. This behavior may indicate adversarial activity where child processes are spawned via Windows Management Instrumentation (WMI). This technique can be used to execute code and evade traditional parent/child processes spawned from Microsoft Office products.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/11/17"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies a suspicious image load (wmiutils.dll) from Microsoft Office processes. This behavior may indicate
adversarial activity where child processes are spawned via Windows Management Instrumentation (WMI). This technique can
be used to execute code and evade traditional parent/child processes spawned from Microsoft Office products.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.library-*", "logs-windows.sysmon_operational-*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious WMI Image Load from MS Office"
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 WMI Image Load from MS Office

Windows Management Instrumentation (WMI) is a powerful framework for managing data and operations on Windows systems. Adversaries exploit WMI to execute code stealthily, bypassing traditional security measures by spawning processes indirectly. The detection rule identifies unusual loading of the `wmiutils.dll` library by Microsoft Office applications, signaling potential misuse of WMI for malicious execution. This rule leverages event categories and process names to pinpoint suspicious activity, aiding in early threat detection.

### Possible investigation steps

- Review the alert details to confirm the specific Microsoft Office process involved (e.g., WINWORD.EXE, EXCEL.EXE) and the associated event category (library, driver, or process).
- Check the process execution history to determine if the process has a legitimate reason to load the wmiutils.dll library, such as recent updates or legitimate automation tasks.
- Investigate the parent process of the flagged Microsoft Office application to identify any unusual or unexpected parent-child process relationships that could indicate malicious activity.
- Analyze recent user activity on the affected system to identify any suspicious behavior or unauthorized access that might correlate with the alert.
- Examine network connections and data transfers initiated by the flagged process to detect any potential data exfiltration or communication with known malicious IP addresses.
- Cross-reference the alert with other security logs and alerts to identify any patterns or additional indicators of compromise that might suggest a broader attack campaign.

### False positive analysis

- Legitimate use of WMI by Microsoft Office applications for automation tasks or system management can trigger the rule. Users should verify if the activity aligns with expected administrative tasks.
- Some third-party plugins or add-ins for Microsoft Office may load wmiutils.dll for legitimate purposes. Users can create exceptions for these known plugins after confirming their benign nature.
- Scheduled tasks or scripts that utilize WMI for legitimate business processes might cause false positives. Review and document these processes, then exclude them from the rule if they are verified as non-threatening.
- Security or monitoring tools that interact with Office applications and use WMI for data collection could be flagged. Ensure these tools are recognized and excluded from the rule after validation.

### Response and remediation

- Isolate the affected system from the network to prevent further malicious activity and lateral movement.
- Terminate any suspicious Microsoft Office processes identified in the alert that are loading the `wmiutils.dll` library.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any malicious code or files.
- Review and analyze the system's WMI repository and scripts for unauthorized or suspicious entries, and remove any that are identified as malicious.
- Restore the system from a known good backup if malicious activity has compromised system integrity or data.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and logging for WMI activity and Microsoft Office processes to detect similar threats in the future."""
references = [
    "https://medium.com/threatpunter/detecting-adversary-tradecraft-with-image-load-event-logging-and-eql-8de93338c16",
]
risk_score = 21
rule_id = "891cb88e-441a-4c3e-be2d-120d99fe7b0d"
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: 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 : "wmiutils.dll" or file.name : "wmiutils.dll")
'''


[[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: 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 : "wmiutils.dll" or file.name : "wmiutils.dll")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • wmiutils.dll corpus 6 (elastic 6)
field:"dll.name" kind:wildcard value:"wmiutils.dll"
event.actionwildcard
  • Image loaded* corpus 10 (elastic 10)
field:"EventType" kind:wildcard value:"Image loaded*"
event.categoryeq
  • process corpus 38 (elastic 38)
field:"event.category" kind:eq value:"process"
event.categorywildcard
  • driver corpus 7 (elastic 7)
  • library corpus 11 (elastic 11)
field:"event.category" kind:wildcard
file.namewildcard
  • wmiutils.dll corpus 2 (elastic 2)
field:"file.name" kind:wildcard value:"wmiutils.dll"
process.namewildcard
  • EXCEL.EXE corpus 34 (elastic 34)
  • MSACCESS.EXE corpus 19 (elastic 19)
  • MSPUB.EXE corpus 15 (elastic 15)
  • POWERPNT.EXE corpus 31 (elastic 31)
  • WINWORD.EXE corpus 35 (elastic 35)
field:"process_basename" kind:wildcard

Untrusted DLL Loaded by Azure AD Connect Authentication Agent

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

Identifies the load of an untrusted DLL by the Azure AD Connect Authentication Agent, which may indicate an attempt to persist or intercept credentials passing through the Pass-through Authentication service.

MITRE ATT&CK Coverage

Telemetry Coverage

ProviderRecord / event type
SysmonEvent ID 7: Image loaded

Rule Body

[metadata]
creation_date = "2024/10/14"
integration = ["endpoint", "windows"]
maturity = "production"
updated_date = "2026/04/24"

[rule]
author = ["Elastic", "Matteo Potito Giorgio"]
description = """
Identifies the load of an untrusted DLL by the Azure AD Connect Authentication Agent, which may
indicate an attempt to persist or intercept credentials passing through the Pass-through Authentication service.
"""
from = "now-9m"
index = ["winlogbeat-*", "logs-endpoint.events.library-*", "logs-windows.sysmon_operational-*"]
language = "eql"
license = "Elastic License v2"
name = "Untrusted DLL Loaded by Azure AD Connect Authentication Agent"
references = [
    "https://blog.xpnsec.com/azuread-connect-for-redteam/",
    "https://medium.com/@breakingmhet/detect-azure-pass-through-authentication-abuse-azure-hybrid-environments-ed4274784252",
    "https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/tshoot-connect-pass-through-authentication",
]
risk_score = 73
rule_id = "f909075d-afc7-42d7-b399-600b94352fd9"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Credential Access",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
library where host.os.type == "windows" and process.name : "AzureADConnectAuthenticationAgentService.exe" and

not dll.code_signature.trusted == true and
not dll.path : (
    "?:\\Windows\\assembly\\NativeImages*",
    "?:\\Windows\\Microsoft.NET\\*",
    "?:\\Windows\\WinSxS\\*",
    "?:\\Windows\\System32\\DriverStore\\FileRepository\\*"
)
'''

note = """## Triage and analysis

### Investigating Untrusted DLL Loaded by Azure AD Connect Authentication Agent

#### Possible investigation steps

- Is the loader the expected Azure AD Connect PTA service on the expected host?
  - Focus: `process.name`, `process.executable`, `process.code_signature.subject_name`, `process.code_signature.trusted`, and `host.id`.
  - Implication: escalate if the loader is not the standard Microsoft PTA service binary or its signer/path differs from the recognized sync-host installation; lower suspicion only when the loader is the expected service on a recognized Entra Connect host. Identity does not clear the DLL load.

- What module loaded, and does its identity and path fit a recognized component?
  - Focus: `dll.path`, `dll.hash.sha256`, `dll.code_signature.subject_name`, `dll.code_signature.trusted`, and `dll.pe.original_file_name`; compare the module path with the service path from step 1 to assess side-loading from temp, download, user-writable, UNC, or paths outside the expected service directory.
  - Implication: escalate when the module is untrusted, renamed, newly signed by an unexpected publisher, or outside the service's expected directory tree; lower suspicion only when hash, original name, signer status, and path fit a recognized agent component or security tool loaded by this service.

- Was the module recently dropped, renamed, or placed by a different process?
  - Focus: `dll.Ext.relative_file_creation_time`, `dll.Ext.relative_file_name_modify_time`, and file events where `file.path` equals the alert `dll.path` on `host.id`. $investigate_2
  - Hint: if recency fields or file events are absent, treat provenance as unresolved rather than benign; expand the time range to the creation or rename time when the recency fields point outside the default pivot.
  - Implication: escalate when a different process recently wrote, renamed, or timestomped the DLL; lower suspicion when provenance shows a recognized updater or tooling writer that explains this maintenance event on the sync host.

- Does the service's startup and lineage context fit normal Azure AD Connect operations?
  - Focus: process start event for `process.entity_id`: `process.parent.executable`, `process.parent.command_line`, and `process.command_line`. $investigate_3
  - Implication: escalate if the service was started, restarted, or manipulated by an unusual parent, script, or interactive admin tool; lower suspicion when lineage matches normal service-control or agent-update activity.

- Was the service handling sign-ins around the load, and which identities may have been exposed?
  - Focus: if Windows Security authentication telemetry is collected, recover the service session from `process.Ext.authentication_id`, then query events on `host.id` where `winlog.event_data.TargetLogonId` matches it.
  - Hint: this exposure pivot depends on an additional data source that may not be collected on every PTA host; read `winlog.event_data.TargetUserName`, `source.ip`, `event.outcome`, and `winlog.event_data.AuthenticationPackageName`. Missing authentication telemetry is unresolved, not benign.
  - Implication: escalate credential exposure when successful sign-ins or repeated attempts overlap the load because a malicious module could access PTA credentials handled by the service; bound exposure as lower only when authentication records show the service was idle and the module, provenance, and lineage evidence also fit benign activity.

- If earlier findings remain suspicious, do additional module loads or related alerts show broader service or host compromise?
  - Focus: related alerts for the same service `process.entity_id`. $investigate_0
  - Hint: review related alerts for `host.id` only if local evidence remains suspicious; test one adjacent variant: signed-but-new DLLs in the same PTA service tree. $investigate_1
  - Implication: escalate scope when the same service process or host has service-tampering, credential-access, persistence, or unusual module-load alerts; keep scope local only when local evidence is benign and related-alert review is clean; preserve and escalate if related-alert coverage is unavailable and the module remains suspicious.

- Escalate when the PTA service loads an unrecognized module, provenance is suspicious, lineage is abnormal, or sign-ins could have been exposed; close only when loader, module, path, writer, and host context all fit a repeatable maintenance pattern on the sync host; preserve and escalate if mixed or incomplete.

### False positive analysis

- Azure AD Connect upgrades, agent reinstallation, or a recognized endpoint-security component can legitimately load modules into the service. Confirm only when `dll.hash.sha256`, `dll.code_signature.subject_name`, `dll.path`, `process.parent.executable`, writer provenance, and `host.id` align with the same maintenance or tooling workflow, and no adjacent service-tampering alerts appear. If this is a first-seen pattern and records are unavailable, keep it unconfirmed rather than closing on a partial match.
- Build exceptions only after the benign workflow is fully confirmed, using `host.id`, exact `dll.path`, stable `dll.hash.sha256`, and the recognized `process.parent.executable` or writer process. Avoid exceptions on `process.name`, `user.id`, or all untrusted modules alone.

### Response and remediation

- If confirmed benign, reverse containment and document `host.id`, `process.entity_id`, `dll.path`, `dll.hash.sha256`, and the recognized maintenance or tooling context. Create an exception only if that same pattern recurs across prior alerts.
- If suspicious but unconfirmed, preserve the alert export, service process identity, loaded DLL sample and hash, writer evidence, and surrounding Windows Security records. Apply reversible containment first, such as removing the host from PTA rotation or restricting administrative access, and escalate to host isolation only if likely credential exposure or broader host tampering is confirmed and the outage impact is acceptable. Do not delete the DLL or stop the service before collecting evidence.
- If confirmed malicious, use endpoint response to isolate the host if it is available; otherwise escalate with `host.id`, `process.entity_id`, module path and hash, writer process, and the potentially exposed identity set to the team that can remove the server from service. Before stopping the service or deleting files, collect the DLL, any feasible memory capture, and related `dll.path` artifacts. Review other PTA or Azure AD Connect hosts and identities that authenticated around the load before eradicating the unauthorized module and persistence artifacts, then rotate or reset confirmed or likely exposed Azure AD Connect, PTA, or user credentials and revalidate the service configuration before returning the host to rotation.
- Post-incident hardening: restrict write access to the Azure AD Connect Authentication Agent directories, review administrative access to the PTA host, retain image-load, file, process, and authentication telemetry, and record which telemetry sources limited the investigation.
"""

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)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.name",
    "host.id",
    "process.entity_id",
    "process.executable",
    "process.command_line",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "process.parent.command_line",
    "process.Ext.authentication_id",
    "dll.path",
    "dll.pe.original_file_name",
    "dll.code_signature.subject_name",
    "dll.code_signature.trusted",
    "dll.Ext.relative_file_creation_time",
]

[[transform.investigate]]
label = "Alerts associated with the same service process instance"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the Azure AD Connect host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "File events for the loaded module"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "file.path", queryType = "phrase", value = "{{dll.path}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" }
  ]
]
relativeFrom = "now-24h"
relativeTo = "now"

[[transform.investigate]]
label = "Process start for the authentication service"
description = ""
providers = [
  [
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

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

[[rule.threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"

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

[[rule.threat.technique.subtechnique]]
id = "T1556.007"
name = "Hybrid Identity"
reference = "https://attack.mitre.org/techniques/T1556/007/"

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

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

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

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

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

Stages and Predicates

Stage 1: library

library where host.os.type == "windows" and process.name : "AzureADConnectAuthenticationAgentService.exe" and

not dll.code_signature.trusted == true and
not dll.path : (
    "?:\\Windows\\assembly\\NativeImages*",
    "?:\\Windows\\Microsoft.NET\\*",
    "?:\\Windows\\WinSxS\\*",
    "?:\\Windows\\System32\\DriverStore\\FileRepository\\*"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.namewildcard
  • AzureADConnectAuthenticationAgentService.exe
field:"process_basename" kind:wildcard value:"AzureADConnectAuthenticationAgentService.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.trustedeqtrueexcludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true"
dll.pathstarts_with?:\Windows\assembly\NativeImages, ?:\Windows\Microsoft.NET\, ?:\Windows\WinSxS\, ?:\Windows\System32\DriverStore\FileRepository\excludes:dll.path

Unusual Launch Service Creation via Unsigned or Untrusted Binary

#
Source
github.com/elastic/protections-artifacts

Detects when an unsigned or untrusted binary creates a launch service where the keepalive and runatload values are set to true and the program arguments are missing. A recent Nim compiled piece of malware was observed doing this in order to persist past reboots.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Detects when an unsigned or untrusted binary creates a launch service where the `keepalive` and `runatload` values are
set to `true` and the program arguments are missing. A recent Nim compiled piece of malware was observed doing this in
order to persist past reboots.
"""
id = "ed6568e0-17d3-4753-bb34-9f86d62acccb"
license = "Elastic License v2"
name = "Unusual Launch Service Creation via Unsigned or Untrusted Binary"
os_list = ["macos"]
reference = ["https://x.com/moonlock_lab/status/1881669277016793184"]
version = "1.0.4"

query = '''
persistence where event.action == "launch_daemon" and (process.code_signature.trusted == false or process.code_signature.exists == false) and 
 (Persistence.keepalive == true and Persistence.runatload == true) and Persistence.args == null
'''

min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
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.001"
name = "Launch Agent"
reference = "https://attack.mitre.org/techniques/T1543/001/"

[[threat.technique.subtechnique]]
id = "T1543.004"
name = "Launch Daemon"
reference = "https://attack.mitre.org/techniques/T1543/004/"


[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"


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


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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

Stage 1: persistence

persistence where event.action == "launch_daemon" and (process.code_signature.trusted == false or process.code_signature.exists == false) and 
 (Persistence.keepalive == true and Persistence.runatload == true) and Persistence.args == null

Indicators

These rows show field, operator, and value matches.

Unusual Linux Process Calling the Metadata Service

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

Looks for anomalous access to the metadata service by an unusual process. The metadata service may be targeted in order to harvest credentials or user data scripts containing secrets.

Known False Positives

  • A newly installed program or one that runs very rarely as part of a monthly or quarterly workflow could trigger this detection rule.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2020/09/22"
integration = ["auditd_manager", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
Looks for anomalous access to the metadata service by an unusual process. The metadata service may be targeted in order
to harvest credentials or user data scripts containing secrets.
"""
false_positives = [
    """
    A newly installed program or one that runs very rarely as part of a monthly or quarterly workflow could trigger this
    detection rule.
    """,
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_linux_rare_metadata_process_ea"]
name = "Unusual Linux Process Calling the Metadata Service"
setup = """## Setup

This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Auditd Manager

### Anomaly Detection Setup

Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).

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

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

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

### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.

#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).

#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
- For this detection rule no additional audit rules are required.
"""
risk_score = 21
rule_id = "9d302377-d226-4e12-b54c-1906b5aec4f6"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Data Source: Elastic Defend",
    "Data Source: Auditd Manager",
    "Use Case: Threat Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis

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

### Investigating Unusual Linux Process Calling the Metadata Service

In cloud environments, the metadata service provides essential instance-specific data, including credentials and configuration scripts. Adversaries may exploit this service by using atypical processes to access sensitive information, potentially leading to credential theft. The detection rule leverages machine learning to identify anomalous process behavior, flagging unusual access patterns indicative of malicious intent.

### Possible investigation steps

- Review the process name and command line arguments associated with the alert to identify any unusual or suspicious activity.
- Check the user account under which the process is running to determine if it has legitimate access to the metadata service.
- Investigate the process's parent process to understand the context of how it was initiated and whether it aligns with expected behavior.
- Analyze network logs to verify if the process made any outbound connections to the metadata service and assess the volume and frequency of these requests.
- Cross-reference the process and user information with recent changes or deployments in the environment to rule out any legitimate use cases.
- Examine system logs for any other suspicious activities or anomalies around the time the alert was triggered, such as unauthorized access attempts or privilege escalations.

### False positive analysis

- Routine system updates or maintenance scripts may access the metadata service, triggering false positives. Users can create exceptions for known update processes to prevent unnecessary alerts.
- Automated backup or monitoring tools might interact with the metadata service as part of their normal operations. Identify these tools and whitelist their processes to reduce false alarms.
- Custom scripts developed in-house for configuration management might access the metadata service. Review these scripts and add them to an exception list if they are verified as non-threatening.
- Cloud management agents provided by the cloud service provider may access the metadata service for legitimate purposes. Verify these agents and exclude them from the detection rule to avoid false positives.
- Development or testing environments often have processes that mimic production behavior, including metadata service access. Ensure these environments are accounted for in the rule configuration to minimize false alerts.

### Response and remediation

- Isolate the affected instance immediately to prevent further unauthorized access to the metadata service and potential lateral movement within the network.
- Terminate the unusual process accessing the metadata service to stop any ongoing data exfiltration or credential harvesting.
- Conduct a thorough review of access logs and process execution history on the affected instance to identify any additional unauthorized activities or compromised credentials.
- Rotate all credentials and secrets that may have been exposed through the metadata service to mitigate the risk of credential theft and unauthorized access.
- Implement network segmentation and access controls to restrict access to the metadata service, ensuring only authorized processes and users can interact with it.
- Escalate the incident to the security operations team for further investigation and to determine if additional instances or services have been compromised.
- Update and enhance monitoring rules to detect similar anomalous behaviors in the future, focusing on unusual process activities and access patterns to the metadata service."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[rule.threat.technique.subtechnique]]
id = "T1552.005"
name = "Cloud Instance Metadata API"
reference = "https://attack.mitre.org/techniques/T1552/005/"



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

Back to all Elastic rules