Hunt Hypothesis
This hypothesis targets adversaries who employ executable packing techniques to compress or obfuscate their payloads, thereby reducing their file size and evading static analysis tools. Proactively hunting for these packed binaries in Azure Sentinel allows the SOC to identify suspicious processes or files that deviate from expected size or structural norms, potentially uncovering stealthy malware or trojans before they execute their full payload.
YARA Rule
rule PRO_PACK_v208_emphasis_on_packed_size_locked_additional: PEiD
{
strings:
$a = { 83 EC ?? 8B EC BE ?? ?? FC E8 ?? ?? 05 ?? ?? 8B C8 E8 ?? ?? 8B }
condition:
$a at pe.entry_point
}
Deployment Notes
This YARA rule can be deployed in the following contexts:
- Microsoft Defender for Endpoint — Custom indicators / advanced hunting
- Email Gateway — Attachment scanning
- File Share Monitoring — Periodic scanning of shared drives
- YARA CLI — Manual threat hunting on endpoints
This rule contains 1 string patterns in its detection logic.
False Positive Guidance
- Scenario: A developer or DevOps engineer uses UPX to compress a custom C++ utility or Python script wrapper to reduce binary size for distribution or container image optimization. The resulting executable retains the UPX header and packed structure, triggering the “packed size” and “locked” heuristics.
- Filter/Exclusion: Exclude binaries located in specific development directories (e.g.,
C:\dev\builds\, /opt/app/bin/) or match against known UPX magic bytes (UPX!) if the rule allows for header inspection, or whitelist specific file hashes generated by the CI/CD pipeline.
- Scenario: An IT administrator deploys a signed, compressed installer or agent using 7-Zip or NSIS (Nullsoft Scriptable Install System) for software distribution. The installer stub is often packed to minimize download size, and the “additional” emphasis in the rule may flag the extra metadata or lock structures used by the installer framework.
- Filter/Exclusion: Exclude files with extensions
.exe or .msi that are signed by trusted corporate certificate authorities (e.g., CN=Corp-IT-Deploy) and located in standard installation paths (e.g., C:\Program Files\, C:\Windows\Installer\).
- Scenario: A scheduled task runs a Java JAR file wrapped in a native launcher (e.g., JSmooth or Launch4j) that has been packed with PECompact or similar tools to reduce memory footprint on legacy endpoints. The packed nature of the launcher triggers the detection, even though the underlying Java bytecode is unmodified.
- Filter/Exclusion: Exclude processes or files where the parent process is
java.exe or javaw.exe, or whitelist specific launcher executables (e.g., app-launcher.exe) that are