Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_HAFNIUM_Forensicartefacts_Cab_Recon_Mar21_1

Detects suspicious CAB files used by HAFNIUM for recon activity

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

What this rule detects

Detects suspicious CAB files used by HAFNIUM for recon activity

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

Summary generated from the rule's metadata and condition.

Rule source

apt-hafnium-forensicartefacts-cab-recon-mar21-1.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_HAFNIUM_Forensicartefacts_Cab_Recon_Mar21_1 : FILE
{
	meta:
		description = "Detects suspicious CAB files used by HAFNIUM for recon activity"
		author = "Florian Roth (Nextron Systems)"
		id = "b0caf9d9-af0a-5181-85e4-6091cd6699e3"
		date = "2021-03-11"
		modified = "2023-12-05"
		reference = "https://discuss.elastic.co/t/detection-and-response-for-hafnium-activity/266289/3?u=dstepanic"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L252-L273"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "de3acb2d01ad14d73263af9e62ef7c715cde259e3f2fbbcbbb41d55589c3f0ab"
		score = 70
		quality = 85
		tags = "FILE"

	strings:
		$s1 = "ip.txt" ascii fullword
		$s2 = "arp.txt" ascii fullword
		$s3 = "system" ascii fullword
		$s4 = "security" ascii fullword

	condition:
		uint32( 0 ) == 0x4643534d and filesize < 10000KB and ( $s1 in ( 0 .. 200 ) and $s2 in ( 0 .. 200 ) and $s3 in ( 0 .. 200 ) and $s4 in ( 0 .. 200 ) )
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$s1text"ip.txt"ascii fullword
$s2text"arp.txt"ascii fullword
$s3text"system"ascii fullword
$s4text"security"ascii fullword

Condition

uint32( 0 ) == 0x4643534d and filesize < 10000KB and ( $s1 in ( 0 .. 200 ) and $s2 in ( 0 .. 200 ) and $s3 in ( 0 .. 200 ) and $s4 in ( 0 .. 200 ) )

In plain words (Heuristic)

  • The file must be smaller than 10000KB (a cheap guard that skips large files).
  • Pattern $s1 must be found within the range 0 .. 200.
  • Pattern $s2 must be found within the range 0 .. 200.
  • Pattern $s3 must be found within the range 0 .. 200.
  • Pattern $s4 must be found within the range 0 .. 200.

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: b0caf9d9-af0a-5181-85e4-6091cd6699e3

Tags:FILE