This rule identifies executable files compressed with PECompact versions 168 or 184, a technique often employed by threat actors to reduce binary size and evade static analysis. Proactively hunting for these signatures helps the SOC team uncover potentially obfuscated malware or trojans that may have slipped through initial ingestion controls in the Azure Sentinel environment.
rule PECompactv168v184
{
meta:
author="malware-lu"
strings:
$a0 = { EB 06 68 [4] C3 9C 60 E8 02 [3] 33 C0 8B C4 83 C0 04 93 8B E3 8B 5B FC 81 EB 3F 90 40 87 DD 8B 85 E6 90 40 01 85 33 90 40 66 C7 85 90 40 90 90 01 85 DA 90 40 01 85 DE 90 40 01 85 E2 90 40 BB 7B 11 }
condition:
$a0 at pe.entry_point
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Legacy Application Deployment via Group Policy
C:\Program Files\ directory on multiple endpoints via GPO, triggering the YARA signature on the executable.C:\Program Files\, C:\Program Files (x86)\) if the parent process is a known deployment tool (e.g., gpupdate.exe, mstsc.exe, or specific SCCM agents) or if the file hash matches a known good baseline for that specific application version.Scheduled Maintenance Jobs for Third-Party Utilities
cleanmgr.exe wrapper or a custom script calling a compacted binary like 7z.exe or rar.exe if compiled with PECompact) to archive old logs. The compacted binary is executed from a temp folder or a service directory, matching the PECompact v1.68/1.84 signature.Task Scheduler (svchost.exe with TasksSched service) or schtasks.exe, and the file path contains keywords like logs, backup, archive, or temp. Additionally, whitelist specific known compacted binaries used in maintenance scripts by their SHA-256 hash.Development and Testing Environments