Saltar al contenido
Skillpedia
Análisis y hojas de cálculo35 mil · #8263

performing-malware-triage-with-yara

Qué hace

Esta herramienta ayuda a identificar y clasificar archivos sospechosos, como los virus informáticos (malware). Compara los archivos con un conjunto de reglas para ver si coinciden con amenazas conocidas.

Cuándo usarla

  • ✓Cuando tienes muchos archivos sospechosos que revisar rápidamente.
  • ✓Cuando creas nuevas reglas para identificar un tipo específico de amenaza.
  • ✓Para buscar amenazas conocidas en ordenadores o en archivos.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-malware-triage-with-yara/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-malware-triage-with-yara/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Comprueba estos 100 archivos con las reglas conocidas de ransomware.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta usa un programa llamado YARA para buscar patrones dentro de los archivos (como secuencias de bytes o texto) y compararlos con reglas predefinidas. Si un archivo coincide con una regla, se clasifica como una amenaza conocida.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Performing Malware Triage with YARA

When to Use

  • Rapidly classifying a large batch of malware samples against known family signatures
  • Writing detection rules for a newly analyzed malware family based on unique byte patterns
  • Scanning file shares, endpoints, or memory dumps for indicators of a specific threat
  • Building automated triage pipelines that classify samples before manual analysis
  • Hunting for variants of a known threat across an enterprise using YARA scans

Do not use as the sole analysis method; YARA triage identifies known patterns but does not reveal new or unknown malware behaviors.

Prerequisites

  • YARA 4.x installed (apt install yara or pip install yara-python)
  • YARA rule repositories (YARA-Rules, awesome-yara, Malpedia rules, Florian Roth's signature-base)
  • Python 3.8+ with yara-python for scripted scanning
  • Sample collection organized in a directory structure for batch scanning
  • Understanding of PE file format, hex patterns, and regular expressions for rule writing

Workflow

Step 1: Scan Samples with Existing Rule Sets

Apply community and commercial YARA rules to classify samples:

# Scan a single file
yara -s malware_rules.yar suspect.exe

# Scan a directory of samples
yara -r malware_rules.yar /path/to/samples/

# Scan with multiple rule files
yara -r rules/apt_rules.yar rules/ransomware_rules.yar rules/trojan_rules.yar suspect.exe

# Scan with timeout (prevent hanging on large files)
yara -t 30 malware_rules.yar suspect.exe

# Scan and show matching strings
yara -s -r malware_rules.yar suspect.exe

# Scan with compiled rules (faster for repeated scans)
yarac malware_rules.yar compiled_rules.yarc
yara compiled_rules.yarc suspect.exe
# Download community rule sets
git clone https://github.com/Yara-Rules/rules.git yara-community-rules
git clone https://github.com/Neo23x0/signature-base.git signature-base

# Scan with signature-base
yara -r signature-base/yara/*.yar suspect.exe

Step 2: Write Rules for Unique String Patterns

Create YARA rules based on strings extracted during malware analysis:

rule MalwareX_Strings {
    meta:
        description = "Detects MalwareX based on unique strings"
        author = "analyst"
        date = "2025-09-15"
        reference = "Internal Analysis Report #1547"
        hash = "e3b0c44298fc1c149afbf4c8996fb924"
        tlp = "WHITE"

    strings:
        // C2 URL pattern
        $url1 = "/gate.php?id=" ascii
        $url2 = "/panel/connect.php" ascii

        // Unique mutex name
        $mutex = "Global\\CryptLocker_2025" ascii wide

        // User-Agent string
        $ua = "Mozilla/5.0 (compatible; MSIE 10.0)" ascii

        // Registry persistence path
        $reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Run\\WindowsUpdate" ascii

        // Campaign identifier
        $campaign = "campaign_2025_q3" ascii

    condition:
        uint16(0) == 0x5A4D and      // PE file (MZ header)
        filesize < 500KB and          // Size constraint
        ($url1 or $url2) and          // At least one C2 URL
        ($mutex or $campaign) and     // Campaign identifier
        $ua                           // Specific User-Agent
}

Step 3: Write Rules for Byte Patterns

Create rules matching specific code sequences:

rule MalwareX_Decryptor {
    meta:
        description = "Detects MalwareX XOR decryption routine"
        author = "analyst"
        date = "2025-09-15"

    strings:
        // XOR decryption loop (x86 assembly)
        // mov al, [esi+ecx]
        // xor al, [edi+ecx]
        // mov [esi+ecx], al
        // inc ecx
        // cmp ecx, edx
        // jl loop
        $xor_loop = { 8A 04 0E 32 04 0F 88 04 0E 41 3B CA 7C F3 }

        // RC4 KSA initialization (256-byte loop)
        $rc4_ksa = { 33 C0 88 04 ?8 40 3D 00 01 00 00 7? }

        // Embedded RSA public key marker
        $rsa_key = { 06 02 00 00 00 A4 00 00 52 53 41 31 }  // PUBLICKEYBLOB

    condition:
        uint16(0) == 0x5A4D and
        ($xor_loop or $rc4_ksa) and
        $rsa_key
}

Step 4: Write Rules with PE Module

Leverage YARA's PE module for structural detection:

import "pe"
import "hash"
import "math"

rule MalwareX_PE_Characteristics {
    meta:
        description = "Detects MalwareX by PE structure and imports"
        author = "analyst"

    condition:
        pe.is_pe and

        // Compiled within specific timeframe

…
Preguntas frecuentes

¿Qué son las 'reglas YARA'?

Son como firmas digitales que describen características de los archivos maliciosos, como cadenas de texto específicas, patrones de bytes o información sobre su estructura.

¿Esta herramienta encuentra todos los tipos de malware?

No. Es buena para identificar amenazas conocidas según las reglas que le proporciones. Por sí sola no descubre nuevos tipos de malware.

¿Necesito saber programar para usarla?

Para las funciones básicas de escaneo, no. Pero para crear tus propias reglas de detección, necesitarás entender cómo funcionan los archivos y tener algo de lógica de programación.

Detalles

Descripción original del autor

Performs rapid malware triage and classification using YARA rules that match file patterns, strings, byte sequences, and structural characteristics against known malware families and suspicious indicators, covering rule writing, scanning, and integration into analysis pipelines. Use when classifying a batch of malware samples against known family signatures, writing detection rules for a newly ana

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8263
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas