YARA · elceef yara-rulz
ELCEEF_ZIP_High_Ratio_Single_Doc
Detects ZIP archives containing single MS Word document with unusually high compression ratio
- Author
- marcin@ulikowski.pl
- Date
- 2023-03-08
- Score / Quality
- 75 / 75
What this rule detects
Detects ZIP archives containing single MS Word document with unusually high compression ratio
It defines 2 patterns (1 text, 1 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule ELCEEF_ZIP_High_Ratio_Single_Doc : FILE
{
meta:
= "Detects ZIP archives containing single MS Word document with unusually high compression ratio"
= "marcin@ulikowski.pl"
= "0fbe89d9-1bf5-50a9-b6c1-1d739162a2ba"
= "2023-03-08"
= "2023-03-08"
= "https://github.com/elceef/yara-rulz"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/ZIP_High_Ratio_Single_Doc.yara#L8-L27"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
= "4d9a6dfca804989d40eeca9bb2d90ef33f3980eb07ca89bbba06d0ef4b37634b"
= "4bc2d14585c197ad3aa5836b3f7d9d784d7afe79856e0ddf850fc3c676b6ecb1"
= "470300b8d6356cff43a1e2be3a23a97be5d1e2ce5a76f2fb2eccdbbb47a4d327"
= 75
= 75
= "FILE"
strings:
$magic = { 50 4b 03 04 }
$ext = ".doc"
condition:
filesize < 1MB and $magic at 0 and #magic == 1 and uint32( 22 ) > 1024 * 1024 * 100 and $ext at ( uint16( 26 ) + 26 )
}
Strings (2 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $magic | hex | { 50 4b 03 04 } | |
| $ext | text | ".doc" |
Condition
filesize < 1MB and $magic at 0 and #magic == 1 and uint32( 22 ) > 1024 * 1024 * 100 and $ext at ( uint16( 26 ) + 26 )In plain words (Heuristic)
- The file must be smaller than 1MB (a cheap guard that skips large files).
- Pattern $magic must occur == 1 times.
- Pattern $magic must be found at offset 0.
- Pattern $ext must be found at offset (.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
References
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- 4d9a6dfca804989d40eeca9bb2d90ef33f3980eb07ca89bbba06d0ef4b37634b
- 4bc2d14585c197ad3aa5836b3f7d9d784d7afe79856e0ddf850fc3c676b6ecb1
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: 0fbe89d9-1bf5-50a9-b6c1-1d739162a2ba
Tags:FILE
Related rules
- 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
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-05-01
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2023-04-17
- Exploitelceef yara-rulz· marcin@ulikowski.pl· 2023-09-23
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2022-10-25
- Genericelceef yara-rulz· marcin@ulikowski.pl· 2022-12-02