This rule targets specific malicious or suspicious patterns within Portable Executable (PE) files, potentially indicating the presence of custom malware, trojans, or exploit payloads that evade standard signature-based detection. Proactively hunting for these indicators in Azure Sentinel allows the SOC team to identify low-severity threats that may be used for initial access or lateral movement before they escalate into more complex attack chains.
rule PEtitev14
{
meta:
author="malware-lu"
strings:
$a0 = { 66 9C 60 50 8B D8 03 ?? 68 54 BC [2] 6A ?? FF 50 14 8B CC }
$a1 = { 66 9C 60 50 8B D8 03 00 68 54 BC 00 00 6A 00 FF 50 14 8B CC }
condition:
$a0 at pe.entry_point or $a1 at pe.entry_point
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Scenario: A legacy .NET application (e.g., a custom internal inventory management tool) is compiled with an older version of the .NET Framework (v2.0 or v3.5) and uses System.Reflection.Emit to dynamically generate IL code at runtime for performance optimization or plugin loading.
C:\Program Files\InternalTools\* AND the parent process is a known service host (e.g., svchost.exe or a specific service name like InventorySvc.exe). Alternatively, exclude if the process command line contains --legacy-mode or if the binary’s .NET metadata indicates a target framework < 4.0.Scenario: A scheduled maintenance job runs a PowerShell script that uses Add-Type to load a small C# helper class for parsing CSV logs, which internally uses reflection to invoke methods on the loaded type. This is common in DevOps automation pipelines running on jump hosts.
powershell.exe or pwsh.exe AND the command line contains Add-Type AND the working directory is under C:\Scripts\ or C:\Automation\. Additionally, exclude if the process is initiated by a scheduled task with a name matching *Maintenance* or *LogCleanup*.Scenario: A Java-based application (e.g., a Kafka consumer or Spring Boot service) uses a native library or a JNI bridge that interacts with .NET components via a mixed-mode assembly, triggering reflection-based calls during initialization. This often occurs in hybrid cloud environments where .NET and Java services coexist.
java.exe or dotnet.exe AND the parent process is a known container runtime (e.g., `