Files
S12cybersecurity-YaraRules/Win_ProcessInjection_QueueUserAPC2_Special.yar
S12cybersecurity 9e12d6c614 Add YARA rule for detecting QueueUserAPC2 injection
This rule detects potential remote process injection using QueueUserAPC2 with Special User APC flags by looking for specific API calls and flags in PE files.
2026-01-29 09:50:04 +01:00

32 lines
1.1 KiB
Plaintext

rule Win_ProcessInjection_QueueUserAPC2_Special {
meta:
description = "Detects potential remote process injection using QueueUserAPC2 with Special User APC flags"
author = "0x12 Dark Development"
technique = "APC Injection"
threat_level = "High"
strings:
// Core APIs for thread/process enumeration
$api1 = "CreateToolhelp32Snapshot" ascii wide
$api2 = "Thread32First" ascii wide
$api3 = "Thread32Next" ascii wide
// The injection/execution functions
$apc1 = "QueueUserAPC2" ascii wide
$apc2 = "NtTestAlert" ascii wide
$apc3 = "QueueUserAPC" ascii wide
// The specific flag for Special User APCs (QUEUE_USER_APC_FLAGS_SPECIAL_USER_APC = 0x00000001)
// We look for the hex representation or common surrounding code patterns
$flag_hex = { 01 00 00 00 }
condition:
uint16(0) == 0x5A4D and // Check for PE header
(
// Logic: Must have enumeration capability + the specific APC call
(2 of ($api*)) and
($apc1 or ($apc2 and $apc3)) and
$flag_hex
)
}