Hunt Hypothesis
This rule identifies the presence of UPX-packed executables, a common technique used by adversaries to compress and obfuscate malware payloads to evade static analysis. Proactively hunting for these artifacts in Azure Sentinel helps detect potential stealthy implantations or compromised binaries that may be leveraging compression to hide their true functionality from standard security tools.
YARA Rule
rule UPXScramblerRCv1x
{
meta:
author="malware-lu"
strings:
$a0 = { 90 61 BE [4] 8D BE [4] 57 83 CD FF }
condition:
$a0 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
- Legitimate Application Deployment via MSI/EXE Installers: Many commercial software packages (e.g., Adobe Creative Cloud, JetBrains IDEs, or legacy enterprise apps) use UPX to compress executables to reduce download size and disk footprint. When these installers run or when the compressed binaries are extracted to disk, they trigger the YARA rule.
- Filter/Exclusion: Exclude known vendor directories (e.g.,
C:\Program Files\Adobe\, C:\Program Files\JetBrains\) or specific executable names associated with major vendors from the YARA scan scope. Alternatively, whitelist the specific SHA256 hashes of known-good compressed binaries.
- Development and Build Artifacts in CI/CD Pipelines: In development environments or build agents, developers often use UPX to compress test binaries, microservices, or local development tools to speed up startup times or reduce memory footprint. These files reside in temporary build directories or local dev folders.
- Filter/Exclusion: Exclude paths associated with build agents or development workspaces (e.g.,
C:\builds\, C:\dev\, C:\Users\<user>\AppData\Local\Temp\) from detection. Ensure that production deployment paths are monitored while development/staging paths are filtered.
- Legacy or Third-Party Utility Tools: Some older or niche system utilities, antivirus definition updaters, or backup agents may bundle UPX-compressed components. For example, certain versions of backup software or disk cleanup tools may use compressed executables for efficiency.
- Filter/Exclusion: Maintain a whitelist of known third-party utility executables that are confirmed to use UPX compression. Use process parent-child relationships to exclude these if they are launched by a known trusted service (e.g.,
vssadmin.exe, wbadmin.exe, or specific backup agent services).