Skip to content

YARA · elceef yara-rulz

ELCEEF_HTML_Smuggling_C

Generic detection for HTML smuggling (T1027.006)

Genericelceef yara-rulzMIT LicenseCompiles with YARA-X
Author
marcin@ulikowski.pl
Date
2023-04-17
Score / Quality
75 / 75

What this rule detects

Generic detection for HTML smuggling (T1027.006)

It defines 4 patterns (2 text, 2 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

html-smuggling-c.yarMIT License
rule ELCEEF_HTML_Smuggling_C : T1027 FILE
{
	meta:
		description = "Generic detection for HTML smuggling (T1027.006)"
		author = "marcin@ulikowski.pl"
		id = "ea1eafad-905b-571e-a016-8774e65bd976"
		date = "2023-04-17"
		modified = "2023-04-17"
		reference = "https://github.com/elceef/yara-rulz"
		source_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/HTML_Smuggling.yara#L62-L82"
		license_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
		hash = "0b4cdfc8ae8ae17d7b6786050f1962c19858b91febb18f61f553083f57d96fea"
		hash = "2b99bf97f3d02ba3b44406cedd1ab31824723b56a8aae8057256cc87870c199e"
		hash = "904ea1ada62cfd4b964a6a3eb9bab5b98022ab000f77b75eb265a2ac44b45b37"
		logic_hash = "83409b0b173980975f6349e448e72fe1b2115fc7dbdec8ee7ad1826a65db17d3"
		score = 75
		quality = 75
		tags = "T1027, FILE"

	strings:
		$blob = "new Blob("
		$array = "new Uint8Array("
		$mssave = { ( 2e | 22 | 27 ) 6d 73 53 61 76 65 }
		$loop = { ?? 5b 69 5d ( 3d | 20 3d | 3d 20 | 20 3d 20 ) ?? 5b 69 5d ( 2d | 20 2d | 2d 20 | 20 2d 20 ) 3? 3b }

	condition:
		filesize < 5MB and $mssave and #blob == 1 and #array == 1 and #loop == 1
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$blobtext"new Blob("
$arraytext"new Uint8Array("
$mssavehex{ ( 2e | 22 | 27 ) 6d 73 53 61 76 65 }
$loophex{ ?? 5b 69 5d ( 3d | 20 3d | 3d 20 | 20 3d 20 ) ?? 5b 69 5d ( 2d | 20 2d | 2d 20 | 20 2d 20 ) 3? 3b }

Condition

filesize < 5MB and $mssave and #blob == 1 and #array == 1 and #loop == 1

In plain words (Heuristic)

  • The file must be smaller than 5MB (a cheap guard that skips large files).
  • Pattern $blob must occur == 1 times.
  • Pattern $array must occur == 1 times.
  • Pattern $loop must occur == 1 times.
  • Pattern $mssave 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

MITRE ATT&CK

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 0b4cdfc8ae8ae17d7b6786050f1962c19858b91febb18f61f553083f57d96fea
  • 2b99bf97f3d02ba3b44406cedd1ab31824723b56a8aae8057256cc87870c199e
  • 904ea1ada62cfd4b964a6a3eb9bab5b98022ab000f77b75eb265a2ac44b45b37

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: ea1eafad-905b-571e-a016-8774e65bd976

Tags:T1027FILE