Skip to content

YARA · elceef yara-rulz

ELCEEF_HTML_Windows_Search_Abuse

Detects HTML files abusing Windows system functionalities to redirect and download malicious payloads

Genericelceef yara-rulzMIT LicenseCompiles with YARA-X
Author
marcin@ulikowski.pl
Date
2024-06-15
Modified
2024-06-16
Score / Quality
75 / 73

What this rule detects

Detects HTML files abusing Windows system functionalities to redirect and download malicious payloads

It defines 9 patterns (9 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

html-windows-search-abuse.yarMIT License
rule ELCEEF_HTML_Windows_Search_Abuse
{
	meta:
		description = "Detects HTML files abusing Windows system functionalities to redirect and download malicious payloads"
		author = "marcin@ulikowski.pl"
		id = "537cb46e-4cfc-517c-8d6d-0019f2c3e5ef"
		date = "2024-06-15"
		modified = "2024-06-16"
		reference = "https://github.com/elceef/yara-rulz"
		source_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/rules/HTML_Windows_Search.yara#L1-L22"
		license_url = "https://github.com/elceef/yara-rulz/blob/5683b294a12cf0c875b624933586029ae43a852f/LICENSE"
		hash = "d136dcfc355885c502ff2c3be229791538541b748b6c07df3ced95f9a7eb2f30"
		logic_hash = "6a0d490cf08ab0aad3c535645abe9ebc26d12768cf2a2e932cdb7ec93cf3e2bd"
		score = 75
		quality = 73
		tags = ""

	strings:
		$location1 = "location.href" wide ascii
		$location2 = "location.replace(" wide ascii
		$location3 = "location.assign(" wide ascii
		$metarefresh = "<meta http-equiv=\"refresh\"" nocase wide ascii
		$search1 = "\"search-ms:query=" wide ascii
		$search2 = "\"search:query=" wide ascii
		$search3 = "URL=search:query=" wide ascii
		$crumb1 = "&crumb=location:" wide ascii
		$crumb2 = "&amp;crumb=location:" wide ascii

	condition:
		( any of ( $location* ) or $metarefresh ) and any of ( $search* ) and any of ( $crumb* )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$location1text"location.href"wide ascii
$location2text"location.replace("wide ascii
$location3text"location.assign("wide ascii
$metarefreshtext"<meta http-equiv=\"refresh\""nocase wide ascii
$search1text"\"search-ms:query="wide ascii
$search2text"\"search:query="wide ascii
$search3text"URL=search:query="wide ascii
$crumb1text"&crumb=location:"wide ascii
$crumb2text"&amp;crumb=location:"wide ascii

Condition

( any of ( $location* ) or $metarefresh ) and any of ( $search* ) and any of ( $crumb* )

In plain words (Heuristic)

  • At least one pattern in ( $location* ) must match.
  • At least one pattern in ( $search* ) must match.
  • At least one pattern in ( $crumb* ) must match.
  • Pattern $metarefresh 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).

  • d136dcfc355885c502ff2c3be229791538541b748b6c07df3ced95f9a7eb2f30

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: 537cb46e-4cfc-517c-8d6d-0019f2c3e5ef