Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Sapphirestealer

Detects SapphireStealer

MalwareSapphirestealerditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 75

What this rule detects

Detects SapphireStealer

Associated malware family: Sapphirestealer.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-sapphirestealer.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Sapphirestealer : FILE
{
	meta:
		description = "Detects SapphireStealer"
		author = "ditekSHen"
		id = "ed6cffe4-23f1-5791-b07d-75abb698c899"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L11172-L11190"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "97088c0decf158d45a02571bd50b5f370c139339c19b8071f38c0f9816232d1f"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "Sapphire.Modules." ascii
		$s2 = "sapphire\\" wide
		$s3 = "by r3vengerx0" wide
		$s4 = "Sapphire\\obj\\" ascii
		$s5 = "[ERROR_GETSECRETKEY_METHOD]" fullword wide
		$s6 = "[ERROR_CANT_GET_PASSWORD]" fullword wide
		$s7 = "<h2>------NEW LOGS------</h2>" wide
		$s8 = "[ERROR] can't create grab directory" wide
		$s9 = "<UploadToTelegram>d__" ascii
		$s10 = "UploadToTelegram" ascii
		$s11 = ".SendLog+<UploadToTelegram>d__" ascii

	condition:
		uint16( 0 ) == 0x5a4d and 5 of them
}

Strings (11 patterns)

IdentifierTypeValueModifiers
$s1text"Sapphire.Modules."ascii
$s2text"sapphire\\"wide
$s3text"by r3vengerx0"wide
$s4text"Sapphire\\obj\\"ascii
$s5text"[ERROR_GETSECRETKEY_METHOD]"fullword wide
$s6text"[ERROR_CANT_GET_PASSWORD]"fullword wide
$s7text"<h2>------NEW LOGS------</h2>"wide
$s8text"[ERROR] can't create grab directory"wide
$s9text"<UploadToTelegram>d__"ascii
$s10text"UploadToTelegram"ascii
$s11text".SendLog+<UploadToTelegram>d__"ascii

Condition

uint16( 0 ) == 0x5a4d and 5 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 5 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: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

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

Rule id: ed6cffe4-23f1-5791-b07d-75abb698c899

Tags:FILE