Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Gamaredon_Gamaredon_Lnk_Usb_Spreader_Encoded

Detects encoded version of Gamaredon LNK USB Spreader

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

What this rule detects

Detects encoded version of Gamaredon LNK USB Spreader

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

Summary generated from the rule's metadata and condition.

Rule source

apt-gamaredon-gamaredon-lnk-usb-spreader-encoded.yarDetection Rule License 1.1
rule SEKOIA_Apt_Gamaredon_Gamaredon_Lnk_Usb_Spreader_Encoded : FILE
{
	meta:
		description = "Detects encoded version of Gamaredon LNK USB Spreader"
		author = "Sekoia.io"
		id = "e42bb654-d1aa-4219-b3da-dd4053d59a83"
		date = "2023-06-19"
		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_gamaredon_lnk_usb_spreader_encoded.yar#L1-L19"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "28358a4a6acdcdfc6d41ea642220ef98c63b9c3ef2268449bb02d2e2e71e7c01"
		logic_hash = "81ab55330b3003cb698ade7e14eaea5fb03e5d2d3dd310b7db682aeef9b51f6e"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(" ascii
		$s2 = " 1000000){" base64
		$s3 = "+\"\\$" base64
		$s4 = ",3\";" base64

	condition:
		$s1 at 0 and 3 of them and filesize < 4000
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$s1text"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("ascii
$s2text" 1000000){"base64
$s3text"+\"\\$"base64
$s4text",3\";"base64

Condition

$s1 at 0 and 3 of them and filesize < 4000

In plain words (Heuristic)

  • The file must be smaller than 4000 (a cheap guard that skips large files).
  • At least 3 patterns in the rule must match.
  • Pattern $s1 must be found at offset 0.

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).

  • 28358a4a6acdcdfc6d41ea642220ef98c63b9c3ef2268449bb02d2e2e71e7c01

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: e42bb654-d1aa-4219-b3da-dd4053d59a83

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE