This rule detects the presence of PECompact v1.22, a legacy executable compressor often used by threat actors to reduce file size and evade basic static analysis. Proactively hunting for this signature helps identify potentially obfuscated or aged malware artifacts that may have been overlooked by standard behavioral detections in the Azure Sentinel environment.
rule PECompactv122
{
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 0F 70 40 ?? 87 DD 8B 85 A6 70 40 ?? 01 85 03 70 40 ?? 66 C7 85 ?? 70 40 ?? 90 90 01 85 9E 70 40 ?? BB F3 08 }
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.
PECompact tool (version 1.22) to reduce the binary size for deployment, resulting in a legitimate executable file on the file system that matches the YARA signature.
C:\Builds\, C:\CI\Artifacts\) or exclude files with a specific hash if the build process is deterministic. Alternatively, allowlist the parent process pecompact.exe if the detection is triggered on the tool itself rather than the output.C:\Program Files\ or C:\Windows\System32\.
C:\Program Files\VendorName\) or exclude files modified within a specific time window following a known software deployment event (e.g., via SCCM or Intune).pecompact to compress log rotation scripts or small utility binaries before moving them to an archive folder, causing the YARA rule to trigger on the compressed artifacts.
C:\Maintenance\Archives\, C:\Logs\Compressed\) or filter based on the file extension if the compressed files are renamed (e.g., .pc or .zip containers, though PECompact usually retains .exe).