Saltar al contenido

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Mars_Stealer

Detect Mars Stealer based on specific strings

MalwareMars StealerSEKOIA.IO CommunityDetection Rule License 1.1Compila con YARA-X (con avisos)
Autor
Sekoia.io
Fecha
2022-02-03
Modificada
2024-12-19
Puntuación / Calidad
75 / 80

Qué detecta esta regla

Detect Mars Stealer based on specific strings

Familia de malware asociada: Mars Stealer.

Objetivos: PE de Windows.

Define 18 patrones (17 de texto, 1 hex, 0 regex). Módulos YARA usados: pe.

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

Resumen generado a partir de los metadatos y la condición de la regla.

Código de la regla

Incluye los imports necesarios para compilarla por sí sola.

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

Cadenas (18 patrones)

IdentificadorTipoValorModificadores
$dechex{a3 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? 00 00 83 c4 ??}
$api00texto"LoadLibrary"ascii
$api01texto"GetProcAddress"ascii
$api02texto"ExitProcess"ascii
$api03texto"advapi32.dll"ascii
$api04texto"crypt32.dll"ascii
$api05texto"GetTickCount"ascii
$api06texto"Sleep"ascii
$api07texto"GetUserDefaultLangID"ascii
$api08texto"CreateMutex"ascii
$api09texto"GetLastError"ascii
$api10texto"HeapAlloc"ascii
$api11texto"GetProcessHeap"ascii
$api12texto"GetComputerName"ascii
$api13texto"VirtualProtect"ascii
$api14texto"GetUserName"ascii
$api15texto"CryptStringToBinary"ascii
$str0texto"JohnDoe"ascii

Condición

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 palabras sencillas (Heurística)

  • El archivo debe empezar por «MZ»: un ejecutable de Windows (PE).
  • Deben coincidir al menos 12 patrones de ( $api* ).
  • El patrón $dec debe aparecer > 400 veces.
  • Un bucle for comprueba una propiedad sobre varias coincidencias o elementos.
  • El patrón $str0 debe estar presente.
  • Usa el módulo pe.
  • Comprueba secciones PE (nombres, número o propiedades).

Prueba esta regla en tu navegador

Arrastra un archivo para escanearlo con esta regla usando YARA-X compilado a WebAssembly. No se sube nada.

Arrastra un archivo aquí o haz clic para elegirSe escanea en local con YARA-X. Archivos de hasta 200 MB.

Abrir en el editor

Referencias

Licencia y atribución

Autor: Sekoia.io

Repositorio de origen: SEKOIA.IO Community @ a438a5901a

Licencia: Detection Rule License 1.1 (licencia del repositorio)

Regla original

Obtenida a través de YARA Forge 20260927, que añade a los nombres el prefijo de la fuente y campos meta normalizados.

Id de la regla: 3e2c7440b2fc9e4b039e6fa8152ac8fd

Metadatos

version1.0
modification_date2022-02-14
classificationTLP:CLEAR

Etiquetas:FILE

Más reglas de Mars Stealer