Saltar al contenido

YARA · SEKOIA.IO Community

SEKOIA_Plugx_Final_Payload

Detects encrypted plugx config with a specific size

MalwarePlugxSEKOIA.IO CommunityDetection Rule License 1.1Compila con YARA-X (con avisos)
Autor
Sekoia.io
Fecha
2023-07-04
Modificada
2024-12-19
Puntuación / Calidad
75 / 80

Qué detecta esta regla

Detects encrypted plugx config with a specific size

Familia de malware asociada: Plugx.

Objetivos: PE de Windows, ELF de Linux.

Define 1 patrones (0 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.

plugx-final-payload.yarDetection Rule License 1.1
import "pe"

rule SEKOIA_Plugx_Final_Payload : FILE
{
	meta:
		description = "Detects encrypted plugx config with a specific size"
		author = "Sekoia.io"
		id = "a4047324-81a7-4c17-be84-c0fa479d2f89"
		date = "2023-07-04"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/plugx_final_payload.yar#L3-L23"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "bf5035eb7ed620edcf7a0e8e8be220451ce268fc49310f28059b60576d8c5182"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = {30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 88 13 00 00 60 ea 00 00 ?? ?? ?? ?? 00 00 00 00}

	condition:
		( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 8MB and for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == ".data" and $s1 in ( pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size ) )
}

Cadenas (1 patrones)

IdentificadorTipoValorModificadores
$s1hex{30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 88 13 00 00 60 ea 00 00 ?? ?? ?? ?? 00 00 00 00}

Condición

( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 8MB and for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == ".data" and $s1 in ( pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size ) )

En palabras sencillas (Heurística)

  • El archivo debe empezar por «MZ»: un ejecutable de Windows (PE).
  • El archivo debe empezar por la cabecera ELF: un ejecutable de Linux/Unix.
  • El archivo debe ocupar menos de 8MB (un límite barato que descarta archivos grandes).
  • El patrón $s1 debe estar en el rango pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size.
  • Un bucle for comprueba una propiedad sobre varias coincidencias o elementos.
  • 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: a4047324-81a7-4c17-be84-c0fa479d2f89

Metadatos

version1.0
classificationTLP:CLEAR

Etiquetas:FILE

Más reglas de Plugx