Aller au contenu

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Blackcap

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

Suspect / chasseSEKOIA.IO CommunityDetection Rule License 1.1Compile avec YARA-X
Auteur
Sekoia.io
Date
2023-03-06
Modifiée
2024-12-19
Score / Qualité
75 / 80

Ce que détecte cette règle

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

Elle définit 3 motifs (3 texte, 0 hex, 0 regex).

Résumé généré à partir des métadonnées et de la condition de la règle.

Source de la règle

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
}

Chaînes (3 motifs)

IdentifiantTypeValeurModificateurs
$imp01texte"import asyncio, json, ntpath, random, re, shutil, sqlite3, subprocess, threading, winreg, zipfile, httpx, psutil, win32gui, win32con, pyperclip, base64, reques …ascii
$imp02texte"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
$pyf01texte"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

En clair (Heuristique)

  • Le fichier doit faire moins de 500KB (garde-fou peu coûteux qui écarte les gros fichiers).
  • Le fichier doit faire plus de 100KB.
  • Le motif $imp01 doit se trouver dans la plage 0 .. 500.
  • Le motif $pyf01 doit se trouver dans la plage @imp01 + 200 .. @imp01 + 1000.
  • Le motif $imp02 doit se trouver dans la plage 0 .. 1000.
  • Le motif $pyf01 doit se trouver dans la plage @imp02 + 100 .. @imp02 + 500.

Tester cette règle dans votre navigateur

Déposez un fichier pour le scanner avec cette règle grâce à YARA-X compilé en WebAssembly. Rien n’est envoyé.

Déposez un fichier ici ou cliquez pour choisirScanné localement avec YARA-X. Fichiers jusqu’à 200 Mo.

Ouvrir dans l’éditeur

Références

Licence et attribution

Auteur : Sekoia.io

Dépôt source : SEKOIA.IO Community @ a438a5901a

Licence : Detection Rule License 1.1 (licence du dépôt)

Règle d’origine

Reprise via YARA Forge 20260927, qui préfixe les noms de règles par la source et ajoute des champs meta normalisés.

Identifiant de règle: 1aa1fadb-3413-46e2-b733-1ad2134f7be2

Métadonnées

version1.0
classificationTLP:CLEAR

Tags:FILE