Saltar al contenido

YARA · dr4k0nia yara-rules

DR4K0NIA_MAL_Msil_Net_Niximports_Loader

Detects NixImports .NET loader

Malwaredr4k0nia yara-rulesDetection Rule License 1.1Compila con YARA-X
Autor
dr4k0nia
Fecha
2023-05-21
Modificada
2023-05-22
Puntuación / Calidad
75 / 85

Qué detecta esta regla

Detects NixImports .NET loader

Objetivos: PE de Windows.

Define 6 patrones (4 de texto, 2 hex, 0 regex).

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

Código de la regla

mal-msil-net-niximports-loader.yarDetection Rule License 1.1
rule DR4K0NIA_MAL_Msil_Net_Niximports_Loader : FILE
{
	meta:
		description = "Detects NixImports .NET loader"
		author = "dr4k0nia"
		id = "ba0d072d-674a-5790-9381-4dac98204268"
		date = "2023-05-21"
		modified = "2023-05-22"
		reference = "https://github.com/dr4k0nia/NixImports"
		source_url = "https://github.com/dr4k0nia/yara-rules/blob/4b10f9b79a4cfb3ec9cb5675f32cc7ee6885fbd8/dotnet/msil_mal_niximports_loader.yar#L1-L21"
		license_url = "https://github.com/dr4k0nia/yara-rules/blob/4b10f9b79a4cfb3ec9cb5675f32cc7ee6885fbd8/LICENSE.md"
		logic_hash = "79421b2677705852f893fa53478deb2e4aa8bd354ac05cbf5438a3a2a15d70bf"
		score = 75
		quality = 85
		tags = "FILE"

	strings:
		$op_pe = {C2 95 C2 97 C2 B2 C2 92 C2 82 C2 82 C2 8E C2 82 C2 82 C2 82 C2 82 C2 86 C2 82}
		$op_delegate = {20 F0 C7 FF 80 20 83 BF 7F 1F 14 14}
		$a1 = "GetRuntimeProperties" ascii fullword
		$a2 = "GetTypes" ascii fullword
		$a3 = "GetRuntimeMethods" ascii fullword
		$a4 = "netstandard" ascii fullword

	condition:
		uint16( 0 ) == 0x5a4d and filesize < 3MB and all of ( $a* ) and 2 of ( $op* )
}

Cadenas (6 patrones)

IdentificadorTipoValorModificadores
$op_pehex{C2 95 C2 97 C2 B2 C2 92 C2 82 C2 82 C2 8E C2 82 C2 82 C2 82 C2 82 C2 86 C2 82}
$op_delegatehex{20 F0 C7 FF 80 20 83 BF 7F 1F 14 14}
$a1texto"GetRuntimeProperties"ascii fullword
$a2texto"GetTypes"ascii fullword
$a3texto"GetRuntimeMethods"ascii fullword
$a4texto"netstandard"ascii fullword

Condición

uint16( 0 ) == 0x5a4d and filesize < 3MB and all of ( $a* ) and 2 of ( $op* )

En palabras sencillas (Heurística)

  • El archivo debe empezar por «MZ»: un ejecutable de Windows (PE).
  • El archivo debe ocupar menos de 3MB (un límite barato que descarta archivos grandes).
  • Deben coincidir todos los patrones de ( $a* ).
  • Deben coincidir al menos 2 patrones de ( $op* ).

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

Repositorio de origen: dr4k0nia yara-rules @ 4b10f9b79a

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: ba0d072d-674a-5790-9381-4dac98204268

Etiquetas:FILE