Saltar al contenido

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Mercurial

Detects Mercurial infostealer

MalwareMercurialditekSHen detectionBSD 2-Clause LicenseCompila con YARA-X
Autor
ditekSHen
Fecha
2020-11-06
Modificada
2024-11-01
Puntuación / Calidad
75 / 75

Qué detecta esta regla

Detects Mercurial infostealer

Familia de malware asociada: Mercurial.

Objetivos: PE de Windows.

Define 13 patrones (12 de texto, 0 hex, 1 regex).

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

Código de la regla

malware-win-mercurial.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Mercurial : FILE
{
	meta:
		description = "Detects Mercurial infostealer"
		author = "ditekSHen"
		id = "c262ada2-01ca-5fc1-adef-987908514019"
		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#L6573-L6593"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "400f8f717a4e07bf4de508c02bbcd9e82bf21f3df84c989fc622378f33e192f0"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$x1 = "mercurial grabber" wide nocase
		$x2 = "\"text\":\"Mercurial Grabber |" wide
		$x3 = "/nightfallgt/mercurial-grabber" wide
		$s1 = "/LimerBoy/Adamantium-Thief/" ascii
		$s2 = "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0" fullword wide
		$s3 = "StealCookies" fullword ascii
		$s4 = "StealPasswords" fullword ascii
		$s5 = "DetectDebug" fullword ascii
		$s6 = "CaptureScreen" fullword ascii
		$s7 = "WebhookContent" fullword ascii
		$s8 = /Grab(Token|Product|IP|Hardware)/ fullword ascii
		$p1 = "[\\w-]{24}\\.[\\w-]{6}\\.[\\w-]{27}" fullword ascii wide
		$p2 = "mfa\\.[\\w-]{84}" fullword ascii wide

	condition:
		uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 5 of ( $s* ) or ( all of ( $p* ) and 3 of ( $s* ) ) )
}

Cadenas (13 patrones)

IdentificadorTipoValorModificadores
$x1texto"mercurial grabber"wide nocase
$x2texto"\"text\":\"Mercurial Grabber |"wide
$x3texto"/nightfallgt/mercurial-grabber"wide
$s1texto"/LimerBoy/Adamantium-Thief/"ascii
$s2texto"Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0"fullword wide
$s3texto"StealCookies"fullword ascii
$s4texto"StealPasswords"fullword ascii
$s5texto"DetectDebug"fullword ascii
$s6texto"CaptureScreen"fullword ascii
$s7texto"WebhookContent"fullword ascii
$s8regex/Grab(Token|Product|IP|Hardware)/fullword ascii
$p1texto"[\\w-]{24}\\.[\\w-]{6}\\.[\\w-]{27}"fullword ascii wide
$p2texto"mfa\\.[\\w-]{84}"fullword ascii wide

Condición

uint16( 0 ) == 0x5a4d and ( 1 of ( $x* ) or 5 of ( $s* ) or ( all of ( $p* ) and 3 of ( $s* ) ) )

En palabras sencillas (Heurística)

  • El archivo debe empezar por «MZ»: un ejecutable de Windows (PE).
  • Deben coincidir todos los patrones de ( $p* ).
  • Deben coincidir al menos 1 patrones de ( $x* ).
  • Deben coincidir al menos 5 patrones de ( $s* ).
  • Deben coincidir al menos 3 patrones de ( $s* ).

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: ditekSHen

Repositorio de origen: ditekSHen detection @ e76c93dcde

Licencia: BSD 2-Clause License (licencia del repositorio)

Aviso de copyright: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

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: c262ada2-01ca-5fc1-adef-987908514019

Etiquetas:FILE