This rule identifies executable files where the entry point offset (OEP) is located within the PE header, a characteristic often exploited by malware stubs or packers to obscure the true code execution flow. Proactively hunting for these anomalies in Azure Sentinel allows the SOC team to detect low-severity, potentially obfuscated payloads that may evade standard signature-based detections before they establish a foothold in the environment.
rule PeStubOEPv1x
{
meta:
author="malware-lu"
strings:
$a0 = { 90 33 C9 33 D2 B8 [3] 00 B9 FF }
$a1 = { E8 05 00 00 00 33 C0 40 48 C3 E8 05 }
condition:
$a0 or $a1
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Scenario: Execution of legacy 16-bit Windows applications (e.g., old ERP clients, specialized industrial control software, or legacy POS systems) that rely on the NTVDM.EXE (Nt Virtual DOS Machine) stub to run in 32/64-bit environments. These executables often contain specific stub patterns that match the PeStubOEPv1x signature due to their minimal, compressed, or packed nature.
C:\Program Files (x86)\LegacyERP\bin\) or exclude processes where the parent process is NTVDM.EXE and the file extension is .EXE or .COM.Scenario: Execution of installer stubs or bootstrappers from major enterprise software vendors (e.g., Microsoft Office Click-to-Run, Adobe Creative Cloud, or Java JRE installers). These installers frequently use small, packed stub executables to download and deploy the full application, which can trigger PE stub detection rules.
C:\Program Files (x86)\Common Files\Microsoft Shared\ClickToRun\ or C:\Program Files (x86)\Adobe\Adobe Creative Cloud\ACC\, and exclude processes with names like setup.exe, install.exe, or bootstrapper.exe when the parent process is a known installer service (e.g., msiexec.exe or wuaexer.exe).Scenario: Execution of compressed or packed executables generated by enterprise build tools or CI/CD pipelines (e.g., .NET single-file publish outputs, Go binaries compiled with -ldflags="-s -w", or Java JARs wrapped in native launchers like jpackage). These binaries often