Skillpedia
الأمان35k · #8353

reverse-engineering-malware-with-ghidra

ما الذي تفعله

تساعد هذه المهارة على فهم طريقة عمل البرمجيات الخبيثة (مثل الفيروسات) من الداخل. تفحص شيفرة البرنامج لتفهم تصرفاته، وكيف يتواصل مع الخادم، وما الأسرار التي يحاول سرقتها، وكيف يخفي نفسه.

متى تستخدمها

  • ✓عندما يحذّر مكافح الفيروسات من برنامج مشبوه وتريد معرفة ما يفعله.
  • ✓عندما تريد اكتشاف كيف يرسل برنامج خبيث المعلومات إلى الخادم.
  • ✓عندما تريد العثور على كلمات مرور أو مفاتيح مخفية داخل البرنامج.

رابط المهارة

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/reverse-engineering-malware-with-ghidra/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/reverse-engineering-malware-with-ghidra/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“ساعدني في تحليل هذا الملف المشبوه لأعرف كيف يتواصل مع خادمه.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تستخدم هذه المهارة أداة Ghidra لقراءة شيفرة البرامج التي تمت ترجمتها بالفعل إلى لغة الآلة. تعرض الشيفرة بصيغة يمكن للإنسان قراءتها، مما يتيح التحليل.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Reverse Engineering Malware with Ghidra

When to Use

  • Static and dynamic analysis have identified suspicious functionality that requires deeper code-level understanding
  • You need to reverse engineer C2 communication protocols, encryption algorithms, or custom obfuscation
  • Understanding the exact exploit mechanism or vulnerability targeted by a malware sample
  • Extracting hardcoded configuration data (C2 addresses, encryption keys, campaign IDs) embedded in compiled code
  • Developing precise YARA rules or detection signatures based on unique code patterns

Do not use for initial triage of unknown samples; perform static analysis with PEStudio and behavioral analysis with Cuckoo first.

Prerequisites

  • Ghidra 11.x installed (download from https://ghidra-sre.org/) with JDK 17+
  • Analysis VM isolated from production network (Windows or Linux host)
  • Familiarity with x86/x64 assembly language and Windows API conventions
  • PDB symbol files for Windows system DLLs to improve decompilation accuracy
  • Ghidra scripts repository (ghidra_scripts) for automated analysis tasks
  • Secondary reference: IDA Free or Binary Ninja for cross-validation of analysis results

Workflow

Step 1: Create Project and Import Binary

Set up a Ghidra project and import the malware sample:

1. Launch Ghidra: ghidraRun (Linux) or ghidraRun.bat (Windows)
2. File -> New Project -> Non-Shared Project -> Select directory
3. File -> Import File -> Select malware binary
4. Ghidra auto-detects format (PE, ELF, Mach-O) and architecture
5. Accept default import options (or specify base address if known)
6. Double-click imported file to open in CodeBrowser
7. When prompted, run Auto Analysis with default analyzers enabled

Headless analysis for automation:

# Run Ghidra headless analysis with decompiler
/opt/ghidra/support/analyzeHeadless /tmp/ghidra_project MalwareProject \
  -import suspect.exe \
  -postScript ExportDecompilation.py \
  -scriptPath /opt/ghidra/scripts/ \
  -deleteProject

Step 2: Identify Key Functions and Entry Points

Navigate the binary to locate critical code sections:

Navigation Strategy:
━━━━━━━━━━━━━━━━━━━
1. Start at entry point (OEP) - follow execution from _start/WinMain
2. Check Symbol Tree for imported functions (Window -> Symbol Tree)
3. Search for cross-references to suspicious APIs:
   - VirtualAlloc/VirtualAllocEx (memory allocation for injection)
   - CreateRemoteThread (remote thread injection)
   - CryptEncrypt/CryptDecrypt (encryption operations)
   - InternetOpen/HttpSendRequest (C2 communication)
   - RegSetValueEx (persistence via registry)
4. Use Search -> For Strings to find embedded URLs, IPs, and paths
5. Check the Functions window sorted by size (large functions often contain core logic)

Ghidra keyboard shortcuts for efficient navigation:

G         - Go to address
Ctrl+E    - Search for strings
X         - Show cross-references to current location
Ctrl+Shift+F - Search memory for byte patterns
L         - Rename label/function
;         - Add comment
T         - Retype variable
Ctrl+L    - Retype return value

Step 3: Analyze Decompiled Code

Use Ghidra's decompiler to understand function logic:

// Example: Ghidra decompiler output for a decryption routine
// Analyst renames variables and adds types for clarity

void decrypt_config(BYTE *encrypted_data, int data_len, BYTE *key, int key_len) {
    // XOR decryption with rolling key
    for (int i = 0; i < data_len; i++) {
        encrypted_data[i] = encrypted_data[i] ^ key[i % key_len];
    }
    return;
}

// Analyst actions in Ghidra:
// 1. Right-click parameters -> Retype to correct types (BYTE*, int)
// 2. Right-click variables -> Rename to meaningful names
// 3. Add comments explaining the algorithm
// 4. Set function signature to propagate types to callers

Step 4: Trace C2 Communication Logic

Follow the network communication code path:

Analysis Steps for C2 Protocol Reverse Engineering:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Find InternetOpenA/WinHttpOpen call -> trace to wrapper function
2. Follow data flow from encrypted config -> URL construction
3. Identify HTTP method (GET/POST), headers, and body format
4. Locate response parsing logic (JSON parsing, custom binary protocol)
5. Map the C2 command dispatcher (switch/case or jump table)
6. Document the command set (download, execute, exfiltrate, update, uninstall)

…

الأسئلة الشائعة

هل أحتاج إلى أن أكون مبرمجاً خبيراً لاستخدامها؟

من المفيد أن تكون لديك معرفة أساسية بطريقة فهم الحواسيب للتعليمات (لغة التجميع) وتفاعل البرامج مع نظام التشغيل، لكن Ghidra يساعد على جعل الشيفرة أسهل للقراءة.

هل يمكنني استخدامها لإنشاء فيروسات؟

هذه المهارة مخصصة لفهم البرمجيات الخبيثة الموجودة وتحليلها، وليست لإنشائها. الهدف هو الدفاع والأمن.

ما هي « الهندسة العكسية »؟

هي عملية تفكيك برنامج ما لفهم طريقة بنائه وعمله، دون أن تملك التصميم الأصلي.

التفاصيل

الوصف الأصلي من المؤلف

Reverse engineers malware binaries using NSA''s Ghidra disassembler and decompiler to study internal logic, cryptographic routines, C2 protocols, and evasion techniques at the assembly and pseudo-C level. Use when static or dynamic analysis flags suspicious functionality needing deeper code review, such as reversing C2 protocols, encryption algorithms, custom obfuscation, or a sample''s exploit me

repo: mukul975/Anthropic-Cybersecurity-Skills

الشعبية

نجوم GitHub
35k
الترتيب
#8353
الترخيص
Apache-2.0
آخر تحديث
31‏/8‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة