Zum Inhalt springen

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Mars_Stealer

Detect Mars Stealer based on specific strings

MalwareMars StealerSEKOIA.IO CommunityDetection Rule License 1.1Kompiliert mit YARA-X (mit Warnungen)
Autor
Sekoia.io
Datum
2022-02-03
Geändert
2024-12-19
Score / Qualität
75 / 80

Was diese Regel erkennt

Detect Mars Stealer based on specific strings

Zugehörige Malware-Familie: Mars Stealer.

Ziele: Windows-PE.

Sie definiert 18 Muster (17 Text, 1 Hex, 0 Regex). Verwendete YARA-Module: pe.

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

Zusammenfassung aus den Metadaten und der Bedingung der Regel erzeugt.

Regelquelltext

Enthält die Imports, die zum eigenständigen Kompilieren nötig sind.

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

Strings (18 Muster)

BezeichnerTypWertModifikatoren
$decHex{a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??}
$api00Text"LoadLibrary"ascii
$api01Text"GetProcAddress"ascii
$api02Text"ExitProcess"ascii
$api03Text"advapi32.dll"ascii
$api04Text"crypt32.dll"ascii
$api05Text"GetTickCount"ascii
$api06Text"Sleep"ascii
$api07Text"GetUserDefaultLangID"ascii
$api08Text"CreateMutex"ascii
$api09Text"GetLastError"ascii
$api10Text"HeapAlloc"ascii
$api11Text"GetProcessHeap"ascii
$api12Text"GetComputerName"ascii
$api13Text"VirtualProtect"ascii
$api14Text"GetUserName"ascii
$api15Text"CryptStringToBinary"ascii
$str0Text"JohnDoe"ascii

Bedingung

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 )

In Worten (Heuristik)

  • Die Datei muss mit „MZ“ beginnen — eine Windows-Programmdatei (PE).
  • Mindestens 12 Muster aus ( $api* ) müssen treffen.
  • Muster $dec muss > 400-mal vorkommen.
  • Eine for-Schleife prüft eine Eigenschaft über mehrere Treffer oder Elemente.
  • Muster $str0 muss vorhanden sein.
  • Nutzt das Modul pe.
  • Prüft PE-Sektionen (Namen, Anzahl oder Eigenschaften).

Diese Regel im Browser testen

Legen Sie eine Datei ab, um sie mit dieser Regel und YARA-X als WebAssembly zu scannen. Nichts wird hochgeladen.

Datei hier ablegen oder klicken zum AuswählenLokal mit YARA-X gescannt. Dateien bis 200 MB.

Im Editor öffnen

Referenzen

Lizenz & Namensnennung

Autor: Sekoia.io

Quell-Repository: SEKOIA.IO Community @ a438a5901a

Lizenz: Detection Rule License 1.1 (Repository-Lizenz)

Originalregel

Gespiegelt über YARA Forge 20260927, das Regelnamen mit der Quelle präfixiert und normalisierte Meta-Felder ergänzt.

Regel-ID: 3e2c7440b2fc9e4b039e6fa8152ac8fd

Metadaten

version1.0
modification_date2022-02-14
classificationTLP:CLEAR

Tags:FILE

Weitere Mars Stealer-Regeln