Skip to content

YARA · elceef yara-rulz

ELCEEF_HTA_Wscriptshell_Onenote

Detects suspicious OneNote documents with embedded HTA + WScript.Shell

Suspicious / huntingelceef yara-rulzMIT LicenseCompiles with YARA-X
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

hta-wscriptshell-onenote.yarMIT License
rule ELCEEF_HTA_Wscriptshell_Onenote : FILE
{
	meta:
		description = "Detects suspicious OneNote documents with embedded HTA + WScript.Shell"
		author = "marcin@ulikowski.pl"
		id = "8cebd862-8dfb-5f5d-befb-5c41cde945ff"
		date = "2023-02-01"
		modified = "2023-02-02"
		reference = "https://github.com/elceef/yara-rulz"
		source_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/HTA_OneNote.yara#L1-L17"
		license_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
		hash = "002fe00bc429877ee2a786a1d40b80250fd66e341729c5718fc66f759387c88c"
		logic_hash = "0287ac5d618c9a8332d167f1a05157aa829c7e8a052c35100fcaeb644d452e5c"
		score = 65
		quality = 75
		tags = "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)

IdentifierTypeValueModifiers
$magichex{ ae b1 53 78 d0 29 96 d3 }
$htahex{ 00 04 00 00 00 2e 00 68 00 74 00 61 }
$wshtext"CreateObject(\"WScript.Shell\")"

Condition

filesize < 5MB and $magic at 8 and $wsh and $hta

In 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.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

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

Original rule

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