This rule detects the presence of the Petite packer, a tool frequently used by adversaries to compress and obfuscate malicious executables to evade static analysis and signature-based detection. Proactively hunting for this indicator in Azure Sentinel allows the SOC team to identify potentially hidden payloads in memory or on disk, reducing the risk of undetected malware execution in Azure-hosted workloads.
rule Petitev212
{
meta:
author="malware-lu"
strings:
$a0 = { B8 [4] 6A 00 68 [4] 64 [6] 64 [6] 66 9C 60 50 }
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.
Scenario: A developer or sysadmin uses 7-Zip or WinRAR to compress a large log directory or backup set on a file server. The resulting archive contains many small, repetitive files (e.g., .log, .txt, or .csv files) that, when decompressed or scanned in memory, exhibit high entropy and repetitive byte patterns that mimic the “Petite” packing signature.
7z.exe, WinRAR.exe, or WinRAR.exe from the detection if the file extension is .7z, .rar, or .zip. Additionally, exclude files located in known backup directories (e.g., C:\Backups\, \\fileserver\backups\) from real-time scanning.Scenario: An IT support technician runs NirCmd or a custom PowerShell script to extract embedded resources (icons, DLLs, or manifests) from a legitimate application binary (e.g., notepad.exe or explorer.exe) for troubleshooting purposes. The extraction process loads the resource into memory, where the YARA rule may match the structured, repetitive layout of the resource table or icon data.
NirCmd.exe, powershell.exe, or pwsh.exe when the target file path contains \Resources\, \Embedded\, or matches known application directories like C:\Program Files\Microsoft\Windows\.Scenario: A scheduled Windows Task or cron job runs a Python or Node.js script that generates a large JSON or XML report (e.g., daily inventory scan, compliance check). The script writes a large, structured text file to disk. If the file is scanned while being written or immediately after, the repetitive key-value pairs or XML tags can trigger the Y