Detection rules › Splunk

Windows Handle Duplication in Known UAC-Bypass Binaries

Status
production
Severity
low
Group by
CallTrace, GrantedAccess, Guid, Opcode, PROCESS_DUP_HANDLE, SecurityID, SourceProcessGUID, TargetProcessGUID, dest, dup_handle_set, g_access_decimal, parent_process_guid, parent_process_id, parent_process_name, process_guid, process_id, process_name, signature, signature_id, source_process_name, target_process_name, user, user_id, vendor_product
Author
Teoderick Contreras, Splunk
Source
github.com/splunk/security_content

The following analytic detects suspicious handle duplication activity targeting known Windows utilities such as ComputerDefaults.exe, Eventvwr.exe, and others. This technique is commonly used to escalate privileges or bypass UAC by inheriting or injecting elevated tokens or handles. The detection focuses on non-standard use of DuplicateHandle or token duplication where process, thread, or token handles are copied into the context of trusted, signed utilities. Such behavior may indicate attempts to execute with elevated rights without user consent. Alerts enable rapid triage using process trees, handle data, token attributes, command-lines, and binary hashes.

Known false positives

  • It is possible legitimate applications will request access to list of know abused Windows UAC binaries process, filter as needed.

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 10: ProcessAccess

Rule body

name: Windows Handle Duplication in Known UAC-Bypass Binaries
id: d7369bf5-1315-4138-b927-2dd8bb8c1da7
version: 4
creation_date: '2025-11-07'
modification_date: '2026-05-13'
author: Teoderick Contreras, Splunk
status: production
type: Anomaly
description: The following analytic detects suspicious handle duplication activity targeting known Windows utilities such as ComputerDefaults.exe, Eventvwr.exe, and others. This technique is commonly used to escalate privileges or bypass UAC by inheriting or injecting elevated tokens or handles. The detection focuses on non-standard use of DuplicateHandle or token duplication where process, thread, or token handles are copied into the context of trusted, signed utilities. Such behavior may indicate attempts to execute with elevated rights without user consent. Alerts enable rapid triage using process trees, handle data, token attributes, command-lines, and binary hashes.
data_source:
    - Sysmon EventID 10
search: '`sysmon` EventCode=10 TargetImage IN("*\\ComputerDefaults.exe", "*\\eventvwr.exe*", "*\\fodhelper.exe","*\\slui.exe","*\\sdclt.exe","*\\mmc.exe", "*\\colorcpl.exe","*\\wsreset.exe","*\\esentutl.exe", "*\PkgMgr.exe") AND NOT (SourceImage IN ("*C:\\Windows\\system32\\*","*C:\\Windows\\syswow64\\*","*C:\\Program Files\\*", "*C:\\Program Files (x86)\\*","%systemroot%\\*")) | eval g_access_decimal = tonumber(replace(GrantedAccess,"0x",""),16) | eval PROCESS_DUP_HANDLE = 64 | eval dup_handle_set = bit_and (g_access_decimal, PROCESS_DUP_HANDLE) | where dup_handle_set == PROCESS_DUP_HANDLE | stats count min(_time) as firstTime max(_time) as lastTime by SourceImage TargetImage GrantedAccess PROCESS_DUP_HANDLE g_access_decimal dup_handle_set Guid Opcode ProcessID SecurityID SourceProcessGUID SourceProcessId  TargetProcessGUID TargetProcessId UserID dest granted_access parent_process_exec parent_process_guid parent_process_id parent_process_name parent_process_path process_exec process_guid process_id process_name process_path signature signature_id user_id vendor_product CallTrace EventID | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_handle_duplication_in_known_uac_bypass_binaries_filter`'
how_to_implement: To successfully implement this search, you must be ingesting data that records process activity from your hosts to populate the endpoint data model in the processes node. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA.
known_false_positives: It is possible legitimate applications will request access to list of know abused Windows UAC binaries process, filter as needed.
references:
    - https://www.recordedfuture.com/research/from-castleloader-to-castlerat-tag-150-advances-operations
intermediate_findings:
    entities:
        - field: dest
          type: system
          score: 20
          message: A process $SourceImage$ is duplicating the handle token of $TargetImage$ on $dest$
threat_objects:
    - field: parent_process_name
      type: parent_process_name
analytic_story:
    - Castle RAT
asset_type: Endpoint
mitre_attack_id:
    - T1134.001
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`sysmon` EventCode=10 TargetImage IN("*\\ComputerDefaults.exe", "*\\eventvwr.exe*", "*\\fodhelper.exe","*\\slui.exe","*\\sdclt.exe","*\\mmc.exe", "*\\colorcpl.exe","*\\wsreset.exe","*\\esentutl.exe", "*\PkgMgr.exe") AND NOT (SourceImage IN ("*C:\\Windows\\system32\\*","*C:\\Windows\\syswow64\\*","*C:\\Program Files\\*", "*C:\\Program Files (x86)\\*","%systemroot%\\*"))

Stage 2: eval

| eval g_access_decimal = tonumber(replace(GrantedAccess,"0x",""),16)

Stage 3: eval

| eval PROCESS_DUP_HANDLE = 64

Stage 4: eval

| eval dup_handle_set = bit_and (g_access_decimal, PROCESS_DUP_HANDLE)

Stage 5: where

| where dup_handle_set == PROCESS_DUP_HANDLE

Stage 6: stats

| stats count min(_time) as firstTime max(_time) as lastTime by SourceImage TargetImage GrantedAccess PROCESS_DUP_HANDLE g_access_decimal dup_handle_set Guid Opcode ProcessID SecurityID SourceProcessGUID SourceProcessId  TargetProcessGUID TargetProcessId UserID dest granted_access parent_process_exec parent_process_guid parent_process_id parent_process_name parent_process_path process_exec process_guid process_id process_name process_path signature signature_id user_id vendor_product CallTrace EventID

Stage 7: search

| `security_content_ctime(firstTime)`

Stage 8: search

| `security_content_ctime(lastTime)`

Stage 9: search

| `windows_handle_duplication_in_known_uac_bypass_binaries_filter`

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
SourceImagein"%systemroot%\\*", "*C:\\Program Files (x86)\\*", "*C:\\Program Files\\*", "*C:\\Windows\\system32\\*", "*C:\\Windows\\syswow64\\*"excludes:SourceImage

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 10 corpus 23 (splunk 16, elastic 6, kusto 1)
field:"EventID" kind:eq value:"10"
TargetImagein
  • "*\PkgMgr.exe"
  • "*\\ComputerDefaults.exe"
  • "*\\colorcpl.exe"
  • "*\\esentutl.exe"
  • "*\\eventvwr.exe*"
  • "*\\fodhelper.exe"
  • "*\\mmc.exe"
  • "*\\sdclt.exe"
  • "*\\slui.exe"
  • "*\\wsreset.exe"
field:"TargetImage" kind:in
dup_handle_setcross_field_compare
  • PROCESS_DUP_HANDLE transforms: op:eq
field:"dup_handle_set" kind:cross_field_compare value:"PROCESS_DUP_HANDLE"