Saltar al contenido

YARA · SEKOIA.IO Community

SEKOIA_Tool_Gsocket_Strings

Detects Gsocket based on strings

Herramienta ofensivaSEKOIA.IO CommunityDetection Rule License 1.1Compila con YARA-X
Autor
Sekoia.io
Fecha
2024-06-10
Modificada
2024-12-19
Puntuación / Calidad
75 / 80

Qué detecta esta regla

Detects Gsocket based on strings

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

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

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

Código de la regla

tool-gsocket-strings.yarDetection Rule License 1.1
rule SEKOIA_Tool_Gsocket_Strings : FILE
{
	meta:
		description = "Detects Gsocket based on strings"
		author = "Sekoia.io"
		id = "55fb2f2b-1074-4b6d-9113-48eaeb0e1e27"
		date = "2024-06-10"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/tool_gsocket_strings.yar#L1-L28"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "c54308293a9f64b571282eac9fba01e4671ba6b0cd45936fab92d4d9af904bbb"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "proxy. It allows multiple gs-netcat clients to (securely) relay"
		$ = "GS-NETCAT(1)            General Commands Manual          GS-NETCAT(1)"
		$ = "-T      Use TOR. The gs-netcat tool will connect via TOR to the GSRN."
		$ = "-D      Daemon & Watchdog mode. Start gs-netcat as a background process"
		$ = "gs-netcat [-rlgvqwCTSDiu] [-s secret] [-k keyfile] [-L logfile] [-d IP]"
		$ = "The gs-netcat utility is a re-implementation of netcat."

	condition:
		( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a or uint32be( 0 ) == 0xfeedface or uint32be( 0 ) == 0xcffaedfe or uint32be( 0 ) == 0xcafebabe ) and filesize > 2MB and filesize < 6MB and 2 of them
}

Cadenas (6 patrones)

IdentificadorTipoValorModificadores
$texto"proxy. It allows multiple gs-netcat clients to (securely) relay"
$texto"GS-NETCAT(1) General Commands Manual GS-NETCAT(1)"
$texto"-T Use TOR. The gs-netcat tool will connect via TOR to the GSRN."
$texto"-D Daemon & Watchdog mode. Start gs-netcat as a background process"
$texto"gs-netcat [-rlgvqwCTSDiu] [-s secret] [-k keyfile] [-L logfile] [-d IP]"
$texto"The gs-netcat utility is a re-implementation of netcat."

Condición

( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a or uint32be( 0 ) == 0xfeedface or uint32be( 0 ) == 0xcffaedfe or uint32be( 0 ) == 0xcafebabe ) and filesize > 2MB and filesize < 6MB and 2 of them

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 empezar por una firma Mach-O / fat: un ejecutable de macOS.
  • El archivo debe ocupar menos de 6MB (un límite barato que descarta archivos grandes).
  • El archivo debe ocupar más de 2MB.
  • Deben coincidir al menos 2 patrones de la regla.

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: 55fb2f2b-1074-4b6d-9113-48eaeb0e1e27

Metadatos

version1.0
classificationTLP:CLEAR

Etiquetas:FILE