Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Gamaredon_Stealer_Obfuscation_1

Matches the Gamaredon Stealer obfuscation

APT / threat actorSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-02-04
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Matches the Gamaredon Stealer obfuscation

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

apt-gamaredon-stealer-obfuscation-1.yarDetection Rule License 1.1
rule SEKOIA_Apt_Gamaredon_Stealer_Obfuscation_1 : FILE
{
	meta:
		description = "Matches the Gamaredon Stealer obfuscation"
		author = "Sekoia.io"
		id = "a6197d16-8ed1-410b-8814-d7eff9a8096c"
		date = "2022-02-04"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_gamaredon_stealer_obfuscation_1.yar#L1-L18"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "7f6a5f8af73c4eb7debbadfd22232ad4e3f44e3aae36c3d624ce7a1a050e8782"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = { 76 61 72 20 [5-30] 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 5d 20 7b 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 20 7d 3b }
		$s2 = { 66 6f 72 28 69 6e 74 20 [5-30] 20 3d 20 30 3b 20 [5-30] 20 3c 20 31 30 3b 20 [5-30] 2b 2b 29 }

	condition:
		uint16be( 0 ) == 0x4d5a and filesize > 100MB and ( #s1 > 100 or #s2 > 100 )
}

Strings (2 patterns)

IdentifierTypeValueModifiers
$s1hex{ 76 61 72 20 [5-30] 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 5d 20 7b 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 2c 20 [2-10] 20 7d 3b }
$s2hex{ 66 6f 72 28 69 6e 74 20 [5-30] 20 3d 20 30 3b 20 [5-30] 20 3c 20 31 30 3b 20 [5-30] 2b 2b 29 }

Condition

uint16be( 0 ) == 0x4d5a and filesize > 100MB and ( #s1 > 100 or #s2 > 100 )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be larger than 100MB.
  • Pattern $s1 must occur > 100 times.
  • Pattern $s2 must occur > 100 times.

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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

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: a6197d16-8ed1-410b-8814-d7eff9a8096c

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE