YARA · elceef yara-rulz
ELCEEF_HTA_Wscriptshell_Onenote
Detects suspicious OneNote documents with embedded HTA + WScript.Shell
- Author
- marcin@ulikowski.pl
- Date
- 2023-02-01
- Modified
- 2023-02-02
- Score / Quality
- 65 / 75
What this rule detects
Detects suspicious OneNote documents with embedded HTA + WScript.Shell
It defines 3 patterns (1 text, 2 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule ELCEEF_HTA_Wscriptshell_Onenote : FILE
{
meta:
= "Detects suspicious OneNote documents with embedded HTA + WScript.Shell"
= "marcin@ulikowski.pl"
= "8cebd862-8dfb-5f5d-befb-5c41cde945ff"
= "2023-02-01"
= "2023-02-02"
= "https://github.com/elceef/yara-rulz"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/HTA_OneNote.yara#L1-L17"
= "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
= "002fe00bc429877ee2a786a1d40b80250fd66e341729c5718fc66f759387c88c"
= "0287ac5d618c9a8332d167f1a05157aa829c7e8a052c35100fcaeb644d452e5c"
= 65
= 75
= "FILE"
strings:
$magic = { ae b1 53 78 d0 29 96 d3 }
$hta = { 00 04 00 00 00 2e 00 68 00 74 00 61 }
$wsh = "CreateObject(\"WScript.Shell\")"
condition:
filesize < 5MB and $magic at 8 and $wsh and $hta
}
Strings (3 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $magic | hex | { ae b1 53 78 d0 29 96 d3 } | |
| $hta | hex | { 00 04 00 00 00 2e 00 68 00 74 00 61 } | |
| $wsh | text | "CreateObject(\"WScript.Shell\")" |
Condition
filesize < 5MB and $magic at 8 and $wsh and $htaIn plain words (Heuristic)
- The file must be smaller than 5MB (a cheap guard that skips large files).
- Pattern $magic must be found at offset 8.
- Pattern $wsh must be present.
- Pattern $hta 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.
References
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- 002fe00bc429877ee2a786a1d40b80250fd66e341729c5718fc66f759387c88c
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: 8cebd862-8dfb-5f5d-befb-5c41cde945ff
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-01-22
- Suspicious / huntingelceef yara-rulz· marcin@ulikowski.pl· 2023-04-04
- 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