Saltar al contenido

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_WEBSHELL_PAS_Webshell_Perlnetworkscript

Detects PERL scripts created by P.A.S. webshell

WebshellSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compila con YARA-X (con avisos)
Autor
FR/ANSSI/SDO
Fecha
2021-02-15
Modificada
2024-05-25
Puntuación / Calidad
90 / 85

Qué detecta esta regla

Detects PERL scripts created by P.A.S. webshell

Define 5 patrones (5 de texto, 0 hex, 0 regex).

YARA-X dice: warning[unintended_pattern_in_set]: pattern `$pl_start` may be unintendedly or redundantly included in pattern set `$pl*`

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

Código de la regla

webshell-pas-webshell-perlnetworkscript.yarDetection Rule License 1.1
rule SIGNATURE_BASE_WEBSHELL_PAS_Webshell_Perlnetworkscript : FILE
{
	meta:
		description = "Detects PERL scripts created by P.A.S. webshell"
		author = "FR/ANSSI/SDO"
		id = "1625b63f-ead7-5712-92b4-0ce6ecc49fd4"
		date = "2021-02-15"
		modified = "2024-05-25"
		reference = "https://www.cert.ssi.gouv.fr/uploads/CERTFR-2021-CTI-005.pdf"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_sandworm_centreon.yar#L44-L62"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "b170c07a005e737c8069f2cc63f869d4d3ff6593b3bfca5bcaf02d7808da6852"
		score = 90
		quality = 85
		tags = "FILE"

	strings:
		$pl_start = "#!/usr/bin/perl\n$SIG{'CHLD'}='IGNORE'; use IO::Socket; use FileHandle;"
		$pl_status = "$o=\" [OK]\";$e=\" Error: \""
		$pl_socket = "socket(SOCKET, PF_INET, SOCK_STREAM,$tcp) or die print \"$l$e$!$l"
		$msg1 = "print \"$l OK! I\\'m successful connected.$l\""
		$msg2 = "print \"$l OK! I\\'m accept connection.$l\""

	condition:
		filesize < 6000 and ( $pl_start at 0 and all of ( $pl* ) ) or any of ( $msg* )
}

Cadenas (5 patrones)

IdentificadorTipoValorModificadores
$pl_starttexto"#!/usr/bin/perl\n$SIG{'CHLD'}='IGNORE'; use IO::Socket; use FileHandle;"
$pl_statustexto"$o=\" [OK]\";$e=\" Error: \""
$pl_sockettexto"socket(SOCKET, PF_INET, SOCK_STREAM,$tcp) or die print \"$l$e$!$l"
$msg1texto"print \"$l OK! I\\'m successful connected.$l\""
$msg2texto"print \"$l OK! I\\'m accept connection.$l\""

Condición

filesize < 6000 and ( $pl_start at 0 and all of ( $pl* ) ) or any of ( $msg* )

En palabras sencillas (Heurística)

  • El archivo debe ocupar menos de 6000 (un límite barato que descarta archivos grandes).
  • Deben coincidir todos los patrones de ( $pl* ).
  • Debe coincidir al menos un patrón de ( $msg* ).
  • El patrón $pl_start debe estar en el offset 0.

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: FR/ANSSI/SDO

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: 1625b63f-ead7-5712-92b4-0ce6ecc49fd4

Etiquetas:FILE