Saltar al contenido

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_MAL_APT27_Rshell_Jul24

YARA rule to detect RSHELL of APT27

APT / actorRSHELL / SYSUPDATESignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compila con YARA-X
Autor
Bundesamt fuer Verfassungsschutz, modified by Florian Roth
Fecha
2024-07-11
Modificada
2024-12-12
Puntuación / Calidad
75 / 85

Qué detecta esta regla

YARA rule to detect RSHELL of APT27

Familia de malware asociada: RSHELL / SYSUPDATE.

Objetivos: ELF de Linux, Mach-O de macOS.

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

apt-mal-apt27-rshell-jul24.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_MAL_APT27_Rshell_Jul24 : MALWARE RSHELL___SYSUPDATE FILE
{
	meta:
		description = "YARA rule to detect RSHELL of APT27"
		author = "Bundesamt fuer Verfassungsschutz, modified by Florian Roth"
		id = "67c8ac4e-8e2f-5cca-90cb-5d5fdf6f86b5"
		date = "2024-07-11"
		modified = "2024-12-12"
		reference = "https://x.com/bfv_bund/status/1811364839656185985?s=12&t=C0_T_re0wRP_NfKa27Xw9w"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_apt27_rshell.yar#L2-L41"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "0433edfad648e1e29be54101abaded690302dc7e49ad916cfbbddf99b3ade12c"
		hash = "10bb89fdf25c88d3c5623e8d68573124c9a42549750014e3675e2ca342aeba4a"
		hash = "2603e1f61363451891c97b0c4ce8acfbfb680d3df4282f9d151ecce3a5679616"
		hash = "70dac42491f8f19568a5d7b1d10b29f732a88d75e7f2bfa07b23202bacadf56f"
		hash = "b988a6583ce40f07e5fc8e890ae2b1c84a93db8a2e3ca8769241b94bea332a7a"
		hash = "c4fe1e56f601d411e2385352606524fb8bbf773bc2ba14889a8de605c2d14da0"
		hash = "c787144d285fcca8a542f7a5525a37bcd089b39068b9a4db7fe3554ee6c08301"
		hash = "ddaa4d23e4651a517fffbd29f0924607ba6b6253171144da5e49237afe91666b"
		logic_hash = "be5f6281d722bd07e53acd459c794fe3ae870a05ed8979de4c28d357110617bd"
		score = 75
		quality = 85
		tags = "MALWARE, RSHELL / SYSUPDATE, FILE"
		sharing = "TLP:WHITE"
		category = "MALWARE"
		malware = "RSHELL / SYSUPDATE"

	strings:
		$a1 = "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%" ascii
		$a2 = "/proc/self/exe" ascii
		$s1 = "HISTFILE" ascii fullword
		$s2 = "/tmp/guid" ascii fullword
		$sop1 = { e8 ?? ?? ?? ?? c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? }
		$sop2 = { c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? f7 d8 }

	condition:
		( uint32be( 0 ) == 0x7f454c46 or ( uint32be( 0 ) == 0xcafebabe and uint32be( 4 ) < 0x20 ) or uint32( 0 ) == 0xfeedface or uint32( 0 ) == 0xfeedfacf ) and filesize < 2MB and all of ( $a* ) and 2 of ( $s* ) or 3 of ( $s* )
}

Cadenas (6 patrones)

IdentificadorTipoValorModificadores
$a1texto"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%"ascii
$a2texto"/proc/self/exe"ascii
$s1texto"HISTFILE"ascii fullword
$s2texto"/tmp/guid"ascii fullword
$sop1hex{ e8 ?? ?? ?? ?? c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? }
$sop2hex{ c7 43 04 00 00 00 00 8b 3b 85 ff 7e 2? e8 ?? ?? 0? 00 85 c0 7e 0? f7 d8 }

Condición

( uint32be( 0 ) == 0x7f454c46 or ( uint32be( 0 ) == 0xcafebabe and uint32be( 4 ) < 0x20 ) or uint32( 0 ) == 0xfeedface or uint32( 0 ) == 0xfeedfacf ) and filesize < 2MB and all of ( $a* ) and 2 of ( $s* ) or 3 of ( $s* )

En palabras sencillas (Heurística)

  • El archivo debe empezar por la cabecera ELF: un ejecutable de Linux/Unix.
  • El archivo debe empezar por una firma Mach-O / fat: un ejecutable de macOS.
  • El archivo debe ocupar menos de 2MB (un límite barato que descarta archivos grandes).
  • Deben coincidir todos los patrones de ( $a* ).
  • Deben coincidir al menos 2 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

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

  • 0433edfad648e1e29be54101abaded690302dc7e49ad916cfbbddf99b3ade12c
  • 10bb89fdf25c88d3c5623e8d68573124c9a42549750014e3675e2ca342aeba4a
  • 2603e1f61363451891c97b0c4ce8acfbfb680d3df4282f9d151ecce3a5679616
  • 70dac42491f8f19568a5d7b1d10b29f732a88d75e7f2bfa07b23202bacadf56f
  • b988a6583ce40f07e5fc8e890ae2b1c84a93db8a2e3ca8769241b94bea332a7a
  • c4fe1e56f601d411e2385352606524fb8bbf773bc2ba14889a8de605c2d14da0
  • c787144d285fcca8a542f7a5525a37bcd089b39068b9a4db7fe3554ee6c08301
  • ddaa4d23e4651a517fffbd29f0924607ba6b6253171144da5e49237afe91666b

Licencia y atribución

Autor: Bundesamt fuer Verfassungsschutz, modified by Florian Roth

Repositorio de origen: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

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: 67c8ac4e-8e2f-5cca-90cb-5d5fdf6f86b5

Metadatos

sharingTLP:WHITE
categoryMALWARE
malwareRSHELL / SYSUPDATE

Etiquetas:MALWARERSHELL___SYSUPDATEFILE