Saltar al contenido

YARA · SEKOIA.IO Community

SEKOIA_Wiper_Win_Caddywiper

Detect CaddyWiper

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

Qué detecta esta regla

Detect CaddyWiper

Familia de malware asociada: Caddywiper.

Objetivos: PE de Windows.

Define 2 patrones (2 de texto, 0 hex, 0 regex). Módulos YARA usados: pe, hash.

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.

wiper-win-caddywiper.yarDetection Rule License 1.1
import "pe"
import "hash"

rule SEKOIA_Wiper_Win_Caddywiper : FILE
{
	meta:
		description = "Detect CaddyWiper"
		author = "Sekoia.io"
		id = "869d44ff-79fc-403d-a45d-d33712da5bd0"
		date = "2022-03-15"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/wiper_win_caddywiper.yar#L4-L37"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "b66b179eac03afafdc69f62c207819eceecfbf994c9efa464fda0d2ba44fe2d7"
		hash = "ea6a416b320f32261da8dafcf2faf088924f99a3a84f7b43b964637ea87aef72"
		hash = "a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea"
		logic_hash = "01a9910b42f402398bbe84546074256f56b10fe0f8524a9a9723aebe43b26a14"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "NETAPI32.dll" ascii
		$ = "DsRoleGetPrimaryDomainInformation" ascii

	condition:
		uint16( 0 ) == 0x5A4D and filesize > 5KB and filesize < 20KB and pe.number_of_sections == 3 and pe.number_of_resources == 0 and all of them or pe.imphash ( ) == "ea8609d4dad999f73ec4b6f8e7b28e55" or pe.imphash ( ) == "bae2d138abe43164fb5e95f313de3d14" or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "f0d4c11521fc3891965534e6c52e128b" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "6be6e878d1e8fed277c5feaf60b57a19" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "11f22fc72c3ca7dd6b874bda37c1fe82" )
}

Cadenas (2 patrones)

IdentificadorTipoValorModificadores
$texto"NETAPI32.dll"ascii
$texto"DsRoleGetPrimaryDomainInformation"ascii

Condición

uint16( 0 ) == 0x5A4D and filesize > 5KB and filesize < 20KB and pe.number_of_sections == 3 and pe.number_of_resources == 0 and all of them or pe.imphash ( ) == "ea8609d4dad999f73ec4b6f8e7b28e55" or pe.imphash ( ) == "bae2d138abe43164fb5e95f313de3d14" or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "f0d4c11521fc3891965534e6c52e128b" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "6be6e878d1e8fed277c5feaf60b57a19" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "11f22fc72c3ca7dd6b874bda37c1fe82" )

En palabras sencillas (Heurística)

  • El archivo debe empezar por «MZ»: un ejecutable de Windows (PE).
  • El archivo debe ocupar menos de 20KB (un límite barato que descarta archivos grandes).
  • El archivo debe ocupar más de 5KB.
  • Deben coincidir todos los patrones de la regla.
  • Un bucle for comprueba una propiedad sobre varias coincidencias o elementos.
  • Usa el módulo pe.
  • Usa el módulo hash.
  • Compara un hash del archivo o de una parte.
  • Comprueba el hash de importaciones PE (imphash).
  • 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

Hashes de muestras

Hashes de las muestras que el autor lista en los metadatos de la regla (búscalos en tu plataforma de threat intelligence).

  • b66b179eac03afafdc69f62c207819eceecfbf994c9efa464fda0d2ba44fe2d7
  • ea6a416b320f32261da8dafcf2faf088924f99a3a84f7b43b964637ea87aef72
  • a294620543334a721a2ae8eaaf9680a0786f4b9a216d75b55cfd28f39e9430ea

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: 869d44ff-79fc-403d-a45d-d33712da5bd0

Metadatos

version1.0
classificationTLP:CLEAR

Etiquetas:FILE

Más reglas de Caddywiper