मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट35k · #8263

performing-malware-triage-with-yara

यह क्या करती है

यह टूल फ़ाइलों को पहचानने और वर्गीकृत करने में मदद करता है, जैसे कंप्यूटर वायरस (malware)। यह फ़ाइलों की तुलना rules के एक सेट से करता है, ताकि देखा जा सके कि वे ज्ञात खतरों से मेल खाती हैं या नहीं।

कब इस्तेमाल करें

  • ✓जब आपके पास बहुत सारी संदिग्ध फ़ाइलें हों जिन्हें जल्दी जांचना हो।
  • ✓किसी खास तरह के खतरे को पहचानने के लिए नए rules बनाते समय।
  • ✓कंप्यूटरों या फ़ाइलों में ज्ञात खतरों को खोजने के लिए।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-malware-triage-with-yara/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इन 100 फ़ाइलों को known ransomware rules से जांचो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल YARA नाम के प्रोग्राम का इस्तेमाल करता है, जो फ़ाइलों के अंदर patterns (जैसे byte sequences या text) को पहले से तय rules से मिलाता है। अगर कोई फ़ाइल किसी rule से मेल खाती है, तो उसे ज्ञात खतरे के रूप में वर्गीकृत किया जाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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

…
अक्सर पूछे जाने वाले सवाल

'YARA rules' क्या होते हैं?

ये डिजिटल सिग्नेचर जैसे होते हैं जो खतरनाक फ़ाइलों की खासियतें बताते हैं, जैसे कुछ खास text strings, byte patterns या फ़ाइल की संरचना की जानकारी।

क्या यह टूल हर तरह का malware ढूंढ सकता है?

नहीं, यह आपके दिए गए rules के आधार पर ज्ञात खतरों को पहचानने में अच्छा है। यह अपने आप नए प्रकार के malware नहीं खोजता।

क्या इसे इस्तेमाल करने के लिए कोडिंग आनी चाहिए?

बुनियादी scanning के लिए नहीं। लेकिन अपने खुद के detection rules बनाने के लिए फ़ाइलों के काम करने के तरीके और थोड़ी programming logic की समझ ज़रूरी है।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8263
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills