YARA · elceef yara-rulz
ELCEEF_Suspicious_SFX
Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe
- Author
- marcin@ulikowski.pl
- Date
- 2023-04-04
- Score / Quality
- 65 / 73
What this rule detects
Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe
Targets: Windows PE.
It defines 5 patterns (3 text, 2 hex, 0 regex).
YARA-X says: warning[text_as_hex]: hex pattern could be written as text literal
Summary generated from the rule's metadata and condition.
Rule source
rule ELCEEF_Suspicious_SFX : FILE
{
meta:
= "Detects self-extracting archives (SFX) executing cmd.exe or powershell.exe"
= "marcin@ulikowski.pl"
= "78f4ae8b-ba17-5c02-a6f0-66bec873aba8"
= "2023-04-04"
= "2023-04-04"
= "https://www.crowdstrike.com/blog/self-extracting-archives-decoy-files-and-their-hidden-payloads/"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/Suspicious_SFX.yara#L1-L22"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
= "688ed356e2fa936a0e07a8479591c28fb457053ed94351bad4bf367b02f04b0a"
= 65
= 73
= "FILE"
strings:
$rar = { 52 61 72 21 }
$zip = { 50 4b 03 04 }
$setup_cmd = "\nSetup=cmd"
$setup_powershell = "\nSetup=powershell"
$silent = "\nSilent=1"
condition:
filesize < 1MB and uint16be( 0 ) == 0x4d5a and any of ( $zip , $rar ) and any of ( $setup_* ) and $silent
}
Strings (5 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $rar | hex | { 52 61 72 21 } | |
| $zip | hex | { 50 4b 03 04 } | |
| $setup_cmd | text | "\nSetup=cmd" | |
| $setup_powershell | text | "\nSetup=powershell" | |
| $silent | text | "\nSilent=1" |
Condition
filesize < 1MB and uint16be( 0 ) == 0x4d5a and any of ( $zip , $rar ) and any of ( $setup_* ) and $silentIn plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- The file must be smaller than 1MB (a cheap guard that skips large files).
- At least one pattern in ( $zip , $rar ) must match.
- At least one pattern in ( $setup_* ) must match.
- Pattern $silent must be present.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Licence & attribution
Author: marcin@ulikowski.pl
Source repository: elceef yara-rulz @ 5683b294a1
Licence: MIT License (repository licence)
Copyright notice: Copyright (c) 2022 Marcin Ulikowski
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 78f4ae8b-ba17-5c02-a6f0-66bec873aba8
Tags:FILE
Related rules
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-05-01
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-06-02
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-02-01
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-01-22
- Exploitelceef yara-rulz· marcin@ulikowski.pl· 2025-08-18
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2024-04-10
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2023-05-05
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2023-04-17