Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_MAL_ASPX_HAFNIUM_Chopper_Mar21_4

Detects HAFNIUM ASPX files dropped on compromised servers

APT / threat actorSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Florian Roth (Nextron Systems)
Date
2021-03-07
Modified
2023-12-05
Score / Quality
85 / 79

What this rule detects

Detects HAFNIUM ASPX files dropped on compromised servers

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

Summary generated from the rule's metadata and condition.

Rule source

apt-mal-aspx-hafnium-chopper-mar21-4.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_MAL_ASPX_HAFNIUM_Chopper_Mar21_4 : FILE
{
	meta:
		description = "Detects HAFNIUM ASPX files dropped on compromised servers"
		author = "Florian Roth (Nextron Systems)"
		id = "93f5b682-642d-5edf-84a9-296bf12cd72b"
		date = "2021-03-07"
		modified = "2023-12-05"
		reference = "https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L218-L233"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "933ab74a0e30e2a728444d491c9eb0ff134db05d905aeb48efe3ba65674a3730"
		score = 85
		quality = 79
		tags = "FILE"

	strings:
		$s1 = "<%@Page Language=\"Jscript\"%>" ascii wide nocase
		$s2 = ".FromBase64String(" ascii wide nocase
		$s3 = "eval(System.Text.Encoding." ascii wide nocase

	condition:
		filesize < 850 and all of them
}

Strings (3 patterns)

IdentifierTypeValueModifiers
$s1text"<%@Page Language=\"Jscript\"%>"ascii wide nocase
$s2text".FromBase64String("ascii wide nocase
$s3text"eval(System.Text.Encoding."ascii wide nocase

Condition

filesize < 850 and all of them

In plain words (Heuristic)

  • The file must be smaller than 850 (a cheap guard that skips large files).
  • All patterns in the rule must match.

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

Licence & attribution

Author: Florian Roth (Nextron Systems)

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 93f5b682-642d-5edf-84a9-296bf12cd72b

Tags:FILE