This rule detects the execution of WinRAR self-extracting archives, a common technique adversaries use to deliver payloads or establish initial access by disguising executable code within compressed files. Proactively hunting for these events in Azure Sentinel helps identify potential supply chain compromises or lateral movement attempts that may bypass standard file type restrictions.
rule winrar_sfx : Packer
{
meta:
author="Kevin Falcoz"
date_create="18/03/2013"
description="Winrar SFX Archive"
strings:
$signature1={00 00 53 6F 66 74 77 61 72 65 5C 57 69 6E 52 41 52 20 53 46 58 00}
condition:
$signature1
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Scenario: A system administrator deploys a custom software installer package (e.g., for an internal ERP tool or driver suite) using WinRAR’s “Create SFX archive” feature to bundle multiple files into a single executable that extracts and runs an installer script. This is common in large-scale endpoint deployments where standard MSI/EXE installers are insufficient.
msiexec.exe, setup.exe, or a known deployment tool like PDQ Deploy or SCCM Client. Additionally, exclude SFX archives located in standard application installation directories (e.g., C:\Program Files\, C:\Program Files (x86)\) or created by known admin service accounts.Scenario: A developer or QA engineer creates a self-extracting archive to distribute a large log collection or a test build of an application to a remote team member. The SFX file is executed on a developer workstation to unpack the logs or binaries for analysis.
C:\Users\<username>\) on non-production workstations (e.g., dev/test environments). Also, exclude if the SFX archive is created by a developer-specific tool like 7-Zip (if configured to create SFX) or if the parent process is a code editor or IDE (e.g., code.exe, devenv.exe).Scenario: A scheduled maintenance job or a custom PowerShell script uses a WinRAR SFX archive to clean up temporary files or rotate logs by extracting a cleanup script and executing it. This is often done in legacy applications or custom automation frameworks that rely on SFX for portability.
Task Scheduler service) or a known service account (