Aller au contenu

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Mars_Stealer

Detect Mars Stealer based on specific strings

MalwareMars StealerSEKOIA.IO CommunityDetection Rule License 1.1Compile avec YARA-X (avertissements)
Auteur
Sekoia.io
Date
2022-02-03
Modifiée
2024-12-19
Score / Qualité
75 / 80

Ce que détecte cette règle

Detect Mars Stealer based on specific strings

Famille de malware associée : Mars Stealer.

Cibles : PE Windows.

Elle définit 18 motifs (17 texte, 1 hex, 0 regex). Modules YARA utilisés : pe.

YARA-X indique : warning[deprecated_field]: field `number_of_sections` is deprecated

Résumé généré à partir des métadonnées et de la condition de la règle.

Source de la règle

Inclut les imports nécessaires pour la compiler seule.

infostealer-win-mars-stealer.yarDetection Rule License 1.1
import "pe"

rule SEKOIA_Infostealer_Win_Mars_Stealer : FILE
{
	meta:
		description = "Detect Mars Stealer based on specific strings"
		author = "Sekoia.io"
		id = "3e2c7440b2fc9e4b039e6fa8152ac8fd"
		date = "2022-02-03"
		modified = "2024-12-19"
		reference = "https://3xp0rt.com/posts/mars-stealer"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/infostealer_win_mars_stealer.yar#L3-L44"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "b2b36a280c3c6cbbb8cbb9f1dd3eb48a4943ebbddb48eba2ac3d0db03924cafd"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		modification_date = "2022-02-14"
		classification = "TLP:CLEAR"

	strings:
		$dec = {a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??}
		$api00 = "LoadLibrary" ascii
		$api01 = "GetProcAddress" ascii
		$api02 = "ExitProcess" ascii
		$api03 = "advapi32.dll" ascii
		$api04 = "crypt32.dll" ascii
		$api05 = "GetTickCount" ascii
		$api06 = "Sleep" ascii
		$api07 = "GetUserDefaultLangID" ascii
		$api08 = "CreateMutex" ascii
		$api09 = "GetLastError" ascii
		$api10 = "HeapAlloc" ascii
		$api11 = "GetProcessHeap" ascii
		$api12 = "GetComputerName" ascii
		$api13 = "VirtualProtect" ascii
		$api14 = "GetUserName" ascii
		$api15 = "CryptStringToBinary" ascii
		$str0 = "JohnDoe" ascii

	condition:
		uint16( 0 ) == 0x5A4D and ( #dec > 400 and 12 of ( $api* ) and $str0 ) or for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == "LLCPPC" and pe.sections [ i ] . raw_data_size < 5000 )
}

Chaînes (18 motifs)

IdentifiantTypeValeurModificateurs
$dechex{a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??}
$api00texte"LoadLibrary"ascii
$api01texte"GetProcAddress"ascii
$api02texte"ExitProcess"ascii
$api03texte"advapi32.dll"ascii
$api04texte"crypt32.dll"ascii
$api05texte"GetTickCount"ascii
$api06texte"Sleep"ascii
$api07texte"GetUserDefaultLangID"ascii
$api08texte"CreateMutex"ascii
$api09texte"GetLastError"ascii
$api10texte"HeapAlloc"ascii
$api11texte"GetProcessHeap"ascii
$api12texte"GetComputerName"ascii
$api13texte"VirtualProtect"ascii
$api14texte"GetUserName"ascii
$api15texte"CryptStringToBinary"ascii
$str0texte"JohnDoe"ascii

Condition

uint16( 0 ) == 0x5A4D and ( #dec > 400 and 12 of ( $api* ) and $str0 ) or for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == "LLCPPC" and pe.sections [ i ] . raw_data_size < 5000 )

En clair (Heuristique)

  • Le fichier doit commencer par « MZ » — un exécutable Windows (PE).
  • Au moins 12 motifs de ( $api* ) doivent être trouvés.
  • Le motif $dec doit apparaître > 400 fois.
  • Une boucle for vérifie une propriété sur plusieurs occurrences ou éléments.
  • Le motif $str0 doit être présent.
  • Utilise le module pe.
  • Vérifie les sections PE (noms, nombre ou propriétés).

Tester cette règle dans votre navigateur

Déposez un fichier pour le scanner avec cette règle grâce à YARA-X compilé en WebAssembly. Rien n’est envoyé.

Déposez un fichier ici ou cliquez pour choisirScanné localement avec YARA-X. Fichiers jusqu’à 200 Mo.

Ouvrir dans l’éditeur

Références

Licence et attribution

Auteur : Sekoia.io

Dépôt source : SEKOIA.IO Community @ a438a5901a

Licence : Detection Rule License 1.1 (licence du dépôt)

Règle d’origine

Reprise via YARA Forge 20260927, qui préfixe les noms de règles par la source et ajoute des champs meta normalisés.

Identifiant de règle: 3e2c7440b2fc9e4b039e6fa8152ac8fd

Métadonnées

version1.0
modification_date2022-02-14
classificationTLP:CLEAR

Tags:FILE

Plus de règles Mars Stealer