Saltar al contenido

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Blackcap

Finds BlackCap Grabber samples (Python code obfuscated using Py-Fuscate)

Sospechoso / huntingSEKOIA.IO CommunityDetection Rule License 1.1Compila con YARA-X
Autor
Sekoia.io
Fecha
2023-03-06
Modificada
2024-12-19
Puntuación / Calidad
75 / 80

Qué detecta esta regla

Finds BlackCap Grabber samples (Python code obfuscated using Py-Fuscate)

Define 3 patrones (3 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

infostealer-win-blackcap.yarDetection Rule License 1.1
rule SEKOIA_Infostealer_Win_Blackcap : FILE
{
	meta:
		description = "Finds BlackCap Grabber samples (Python code obfuscated using Py-Fuscate)"
		author = "Sekoia.io"
		id = "1aa1fadb-3413-46e2-b733-1ad2134f7be2"
		date = "2023-03-06"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/infostealer_win_blackcap.yar#L1-L19"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "b826c88d557ea0a516534946ad9531eda1a875cb9c4ddf92d9b98f8c7b86623e"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$imp01 = "import asyncio, json, ntpath, random, re, shutil, sqlite3, subprocess, threading, winreg, zipfile, httpx, psutil, win32gui, win32con, pyperclip, base64, requests, ctypes, time" ascii
		$imp02 = "from ctypes import windll, wintypes, byref, cdll, Structure, POINTER, c_char, c_buffer;from Crypto.Cipher import AES;from PIL import ImageGrab;from win32crypt import CryptUnprotectData" ascii
		$pyf01 = "import marshal,lzma,gzip,bz2,binascii,zlib;exec(marshal.loads(binascii.a2b_base64(b'YwAAAAAA" ascii

	condition:
		($imp01 in ( 0 .. 500 ) and $pyf01 in ( @imp01 + 200 .. @imp01 + 1000 ) or $imp02 in ( 0 .. 1000 ) and $pyf01 in ( @imp02 + 100 .. @imp02 + 500 ) ) and filesize > 100KB and filesize < 500KB
}

Cadenas (3 patrones)

IdentificadorTipoValorModificadores
$imp01texto"import asyncio, json, ntpath, random, re, shutil, sqlite3, subprocess, threading, winreg, zipfile, httpx, psutil, win32gui, win32con, pyperclip, base64, reques …ascii
$imp02texto"from ctypes import windll, wintypes, byref, cdll, Structure, POINTER, c_char, c_buffer;from Crypto.Cipher import AES;from PIL import ImageGrab;from win32crypt …ascii
$pyf01texto"import marshal,lzma,gzip,bz2,binascii,zlib;exec(marshal.loads(binascii.a2b_base64(b'YwAAAAAA"ascii

Condición

($imp01 in ( 0 .. 500 ) and $pyf01 in ( @imp01 + 200 .. @imp01 + 1000 ) or $imp02 in ( 0 .. 1000 ) and $pyf01 in ( @imp02 + 100 .. @imp02 + 500 ) ) and filesize > 100KB and filesize < 500KB

En palabras sencillas (Heurística)

  • El archivo debe ocupar menos de 500KB (un límite barato que descarta archivos grandes).
  • El archivo debe ocupar más de 100KB.
  • El patrón $imp01 debe estar en el rango 0 .. 500.
  • El patrón $pyf01 debe estar en el rango @imp01 + 200 .. @imp01 + 1000.
  • El patrón $imp02 debe estar en el rango 0 .. 1000.
  • El patrón $pyf01 debe estar en el rango @imp02 + 100 .. @imp02 + 500.

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: 1aa1fadb-3413-46e2-b733-1ad2134f7be2

Metadatos

version1.0
classificationTLP:CLEAR

Etiquetas:FILE