[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DB68AP5S9WPH4AN08HMWQN":3,"skill-same:01M7DB68AP5S9WPH4AN08HMWQN":62},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7DB68AP5S9WPH4AN08HMWQN","reverse-engineering-malware-with-ghidra",null,"alicewe1\u002Falice_skill","alicewe1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F102134151?v=4","01M7D9STCM8HAESM958JP0989K","Alice_we","01M7D9STDR22MTD9FTTWPAZNV8",64,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Freverse-engineering-malware-with-ghidra\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Freverse-engineering-malware-with-ghidra\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: reverse-engineering-malware-with-ghidra\ndescription: >\n  Reverse engineers malware binaries using NSA's Ghidra disassembler and decompiler to\n  understand internal logic, cryptographic routines, C2 protocols, and evasion techniques\n  at the assembly and pseudo-C level. Activates for requests involving malware reverse\n  engineering, disassembly analysis, decompilation, binary analysis, or understanding\n  malware internals.\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags: [malware, reverse-engineering, Ghidra, disassembly, decompilation]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nx-alice-class: reverse\n---# Reverse Engineering Malware with Ghidra\n\n## When to Use\n\n- Static and dynamic analysis have identified suspicious functionality that requires deeper code-level understanding\n- You need to reverse engineer C2 communication protocols, encryption algorithms, or custom obfuscation\n- Understanding the exact exploit mechanism or vulnerability targeted by a malware sample\n- Extracting hardcoded configuration data (C2 addresses, encryption keys, campaign IDs) embedded in compiled code\n- Developing precise YARA rules or detection signatures based on unique code patterns\n\n**Do not use** for initial triage of unknown samples; perform static analysis with PEStudio and behavioral analysis with Cuckoo first.\n\n## Prerequisites\n\n- Ghidra 11.x installed (download from https:\u002F\u002Fghidra-sre.org\u002F) with JDK 17+\n- Analysis VM isolated from production network (Windows or Linux host)\n- Familiarity with x86\u002Fx64 assembly language and Windows API conventions\n- PDB symbol files for Windows system DLLs to improve decompilation accuracy\n- Ghidra scripts repository (ghidra_scripts) for automated analysis tasks\n- Secondary reference: IDA Free or Binary Ninja for cross-validation of analysis results\n\n## Workflow\n\n### Step 1: Create Project and Import Binary\n\nSet up a Ghidra project and import the malware sample:\n\n```\n1. Launch Ghidra: ghidraRun (Linux) or ghidraRun.bat (Windows)\n2. File -> New Project -> Non-Shared Project -> Select directory\n3. File -> Import File -> Select malware binary\n4. Ghidra auto-detects format (PE, ELF, Mach-O) and architecture\n5. Accept default import options (or specify base address if known)\n6. Double-click imported file to open in CodeBrowser\n7. When prompted, run Auto Analysis with default analyzers enabled\n```\n\n**Headless analysis for automation:**\n```bash\n# Run Ghidra headless analysis with decompiler\n\u002Fopt\u002Fghidra\u002Fsupport\u002FanalyzeHeadless \u002Ftmp\u002Fghidra_project MalwareProject \\\n  -import suspect.exe \\\n  -postScript ExportDecompilation.py \\\n  -scriptPath \u002Fopt\u002Fghidra\u002Fscripts\u002F \\\n  -deleteProject\n```\n\n### Step 2: Identify Key Functions and Entry Points\n\nNavigate the binary to locate critical code sections:\n\n```\nNavigation Strategy:\n━━━━━━━━━━━━━━━━━━━\n1. Start at entry point (OEP) - follow execution from _start\u002FWinMain\n2. Check Symbol Tree for imported functions (Window -> Symbol Tree)\n3. Search for cross-references to suspicious APIs:\n   - VirtualAlloc\u002FVirtualAllocEx (memory allocation for injection)\n   - CreateRemoteThread (remote thread injection)\n   - CryptEncrypt\u002FCryptDecrypt (encryption operations)\n   - InternetOpen\u002FHttpSendRequest (C2 communication)\n   - RegSetValueEx (persistence via registry)\n4. Use Search -> For Strings to find embedded URLs, IPs, and paths\n5. Check the Functions window sorted by size (large functions often contain core logic)\n```\n\n**Ghidra keyboard shortcuts for efficient navigation:**\n```\nG         - Go to address\nCtrl+E    - Search for strings\nX         - Show cross-references to current location\nCtrl+Shift+F - Search memory for byte patterns\nL         - Rename label\u002Ffunction\n;         - Add comment\nT         - Retype variable\nCtrl+L    - Retype return value\n```\n\n### Step 3: Analyze Decompiled Code\n\nUse Ghidra's decompiler to understand function logic:\n\n```c\n\u002F\u002F Example: Ghidra decompiler output for a decryption routine\n\u002F\u002F Analyst renames variables and adds types for clarity\n\nvoid decrypt_config(BYTE *encrypted_data, int data_len, BYTE *key, int key_len) {\n    \u002F\u002F XOR decryption with rolling key\n    for (int i = 0; i \u003C data_len; i++) {\n        encrypted_data[i] = encrypted_data[i] ^ key[i % key_len];\n    }\n    return;\n}\n\n\u002F\u002F Analyst actions in Ghidra:\n\u002F\u002F 1. Right-click parameters -> Retype to correct types (BYTE*, int)\n\u002F\u002F 2. Right-click variables -> Rename to meaningful names\n\u002F\u002F 3. Add comments explaining the algorithm\n\u002F\u002F 4. Set function signature to propagate types to callers\n```\n\n### Step 4: Trace C2 Communication Logic\n\nFollow the network communication code path:\n\n```\nAnalysis Steps for C2 Protocol Reverse Engineering:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n1. Find InternetOpenA\u002FWinHttpOpen call -> trace to wrapper function\n2. Follow data flow from encrypted config -> URL construction\n3. Identify HTTP method (GET\u002FPOST), headers, and body format\n4. Locate response parsing logic (JSON parsing, custom binary protocol)\n5. Map the C2 command dispatcher (switch\u002Fcase or jump table)\n6. Document the command set (download, execute, exfiltrate, update, uninstall)\n```\n\n**Ghidra Script for extracting C2 configuration:**\n```python\n# Ghidra Python script: extract_c2_config.py\n# Run via Script Manager in Ghidra\n\nfrom ghidra.program.model.data import StringDataType\nfrom ghidra.program.model.symbol import SourceType\n\n# Search for XOR decryption patterns\nlisting = currentProgram.getListing()\nmemory = currentProgram.getMemory()\n\n# Find references to InternetOpenA\nsymbol_table = currentProgram.getSymbolTable()\nfor symbol in symbol_table.getExternalSymbols():\n    if \"InternetOpen\" in symbol.getName():\n        refs = getReferencesTo(symbol.getAddress())\n        for ref in refs:\n            print(\"C2 init at: {}\".format(ref.getFromAddress()))\n```\n\n### Step 5: Analyze Encryption and Obfuscation\n\nIdentify and document cryptographic routines:\n\n```\nCommon Malware Encryption Patterns:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nXOR Cipher:     Loop with XOR operation, often single-byte or rolling key\nRC4:            Two loops (KSA + PRGA), 256-byte S-box initialization\nAES:            Look for S-box constants (0x63, 0x7C, 0x77...) or calls to CryptEncrypt\nBase64:         Lookup table with A-Za-z0-9+\u002F= characters\nCustom:         Combination of arithmetic operations (ADD, SUB, ROL, ROR with XOR)\n\nIdentification Tips:\n- Search for constants: AES S-box, CRC32 table, MD5 init values\n- Look for loop structures operating on byte arrays\n- Check for Windows Crypto API usage (CryptAcquireContext -> CryptCreateHash -> CryptEncrypt)\n- FindCrypt Ghidra plugin automatically identifies crypto constants\n```\n\n### Step 6: Document Findings and Create Detection Signatures\n\nProduce actionable intelligence from reverse engineering:\n\n```bash\n# Generate YARA rule from unique code patterns found in Ghidra\ncat \u003C\u003C 'EOF' > malware_family_x.yar\nrule MalwareFamilyX_Decryptor {\n    meta:\n        description = \"Detects MalwareX decryption routine\"\n        author = \"analyst\"\n        date = \"2025-09-15\"\n    strings:\n        \u002F\u002F XOR decryption loop with hardcoded key\n        $decrypt = { 8A 04 0E 32 04 0F 88 04 0E 41 3B CA 7C F3 }\n        \u002F\u002F C2 URL pattern after decryption\n        $c2_pattern = \"\u002Fgate.php?id=\" ascii\n    condition:\n        uint16(0) == 0x5A4D and $decrypt and $c2_pattern\n}\nEOF\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Disassembly** | Converting machine code bytes into human-readable assembly language instructions; Ghidra's Listing view shows disassembled code |\n| **Decompilation** | Lifting assembly code to pseudo-C representation for easier analysis; Ghidra's Decompile window provides this view |\n| **Cross-Reference (XREF)** | Reference showing where a function or data address is called from or used; essential for tracing code execution flow |\n| **Control Flow Graph (CFG)** | Visual representation of all possible execution paths through a function; reveals branching logic and loops |\n| **Original Entry Point (OEP)** | The actual start address of the malware code after unpacking; packers redirect execution through an unpacking stub first |\n| **Function Signature** | The return type, name, and parameter types of a function; applying correct signatures improves decompiler output quality |\n| **Ghidra Script** | Python or Java automation script executed within Ghidra to perform batch analysis, pattern searching, or data extraction |\n\n## Tools & Systems\n\n- **Ghidra**: NSA's open-source software reverse engineering suite with disassembler, decompiler, and scripting support for multiple architectures\n- **IDA Pro\u002FFree**: Industry-standard interactive disassembler; IDA Free provides x86\u002Fx64 cloud-based decompilation\n- **Binary Ninja**: Commercial reverse engineering platform with modern UI and extensive API for plugin development\n- **x64dbg**: Open-source x64\u002Fx32 debugger for Windows used alongside Ghidra for dynamic debugging of malware\n- **FindCrypt (Ghidra Plugin)**: Plugin that identifies cryptographic constants and algorithms in binary code\n\n## Common Scenarios\n\n### Scenario: Reversing Custom C2 Protocol\n\n**Context**: Behavioral analysis shows encrypted traffic to an external IP on a non-standard port. Network signatures cannot detect variants because the protocol is proprietary. Deep reverse engineering is needed to understand the protocol structure.\n\n**Approach**:\n1. Import the unpacked sample into Ghidra and run full auto-analysis\n2. Locate socket\u002FWinHTTP API calls and trace backwards to the calling function\n3. Identify the encryption routine called before data is sent (follow data flow from send\u002FHttpSendRequest)\n4. Reverse the encryption (XOR key extraction, RC4 key derivation, AES key location)\n5. Map the command structure by analyzing the response parsing function (switch\u002Fcase on command IDs)\n6. Document the protocol format (header structure, command bytes, encryption method)\n7. Create a protocol decoder script for network monitoring tools\n\n**Pitfalls**:\n- Not running the full auto-analysis before starting manual analysis (missing function boundaries and type propagation)\n- Ignoring indirect calls through function pointers or vtables (use cross-references to data holding function addresses)\n- Spending time on library code that Ghidra's Function ID (FID) or FLIRT signatures should have identified\n- Not saving Ghidra project progress frequently (analysis state can be lost on crashes)\n\n## Output Format\n\n```\nREVERSE ENGINEERING ANALYSIS REPORT\n=====================================\nSample:           unpacked_payload.exe\nSHA-256:          abc123def456...\nArchitecture:     x86 (32-bit PE)\nGhidra Project:   MalwareX_Analysis\n\nFUNCTION MAP\n0x00401000  main()              - Entry point, initializes config\n0x00401200  decrypt_config()    - XOR decryption with 16-byte key\n0x00401400  init_c2()           - WinHTTP initialization, URL construction\n0x00401800  c2_beacon()         - HTTP POST beacon with system info\n0x00401C00  cmd_dispatcher()    - Switch on 12 command codes\n0x00402000  inject_process()    - Process hollowing into svchost.exe\n0x00402400  persist_registry()  - HKCU Run key persistence\n0x00402800  exfil_data()        - File collection and encrypted upload\n\nC2 PROTOCOL\nMethod:           HTTPS POST to \u002Fgate.php\nEncryption:       RC4 with derived key (MD5 of bot_id + campaign_key)\nBot ID Format:    MD5(hostname + username + volume_serial)\nBeacon Interval:  60 seconds with 10% jitter\nCommand Set:\n  0x01 - Download and execute file\n  0x02 - Execute shell command\n  0x03 - Upload file to C2\n  0x04 - Update configuration\n  0x05 - Uninstall and remove traces\n\nENCRYPTION DETAILS\nAlgorithm:        RC4\nKey Derivation:   MD5(bot_id + \"campaign_2025_q3\")\nHardcoded Seed:   \"campaign_2025_q3\" at offset 0x00405A00\n\nEXTRACTED IOCs\nC2 URLs:          hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\n                  hxxps:\u002F\u002Fbackup.evil[.]net\u002Fgate.php (failover)\nCampaign ID:      campaign_2025_q3\nRC4 Key Material: [see encryption details above]\n```\n","## When to Use\n\n- Static and dynamic analysis have identified suspicious functionality that requires deeper code-level understanding\n- You need to reverse engineer C2 communication protocols, encryption algorithms, or custom obfuscation\n- Understanding the exact exploit mechanism or vulnerability targeted by a malware sample\n- Extracting hardcoded configuration data (C2 addresses, encryption keys, campaign IDs) embedded in compiled code\n- Developing precise YARA rules or detection signatures based on unique code patterns\n\n**Do not use** for initial triage of unknown samples; perform static analysis with PEStudio and behavioral analysis with Cuckoo first.\n\n## Prerequisites\n\n- Ghidra 11.x installed (download from https:\u002F\u002Fghidra-sre.org\u002F) with JDK 17+\n- Analysis VM isolated from production network (Windows or Linux host)\n- Familiarity with x86\u002Fx64 assembly language and Windows API conventions\n- PDB symbol files for Windows system DLLs to improve decompilation accuracy\n- Ghidra scripts repository (ghidra_scripts) for automated analysis tasks\n- Secondary reference: IDA Free or Binary Ninja for cross-validation of analysis results\n\n## Workflow\n\n### Step 1: Create Project and Import Binary\n\nSet up a Ghidra project and import the malware sample:\n\n```\n1. Launch Ghidra: ghidraRun (Linux) or ghidraRun.bat (Windows)\n2. File -> New Project -> Non-Shared Project -> Select directory\n3. File -> Import File -> Select malware binary\n4. Ghidra auto-detects format (PE, ELF, Mach-O) and architecture\n5. Accept default import options (or specify base address if known)\n6. Double-click imported file to open in CodeBrowser\n7. When prompted, run Auto Analysis with default analyzers enabled\n```\n\n**Headless analysis for automation:**\n```bash\n# Run Ghidra headless analysis with decompiler\n\u002Fopt\u002Fghidra\u002Fsupport\u002FanalyzeHeadless \u002Ftmp\u002Fghidra_project MalwareProject \\\n  -import suspect.exe \\\n  -postScript ExportDecompilation.py \\\n  -scriptPath \u002Fopt\u002Fghidra\u002Fscripts\u002F \\\n  -deleteProject\n```\n\n### Step 2: Identify Key Functions and Entry Points\n\nNavigate the binary to locate critical code sections:\n\n```\nNavigation Strategy:\n━━━━━━━━━━━━━━━━━━━\n1. Start at entry point (OEP) - follow execution from _start\u002FWinMain\n2. Check Symbol Tree for imported functions (Window -> Symbol Tree)\n3. Search for cross-references to suspicious APIs:\n   - VirtualAlloc\u002FVirtualAllocEx (memory allocation for injection)\n   - CreateRemoteThread (remote thread injection)\n   - CryptEncrypt\u002FCryptDecrypt (encryption operations)\n   - InternetOpen\u002FHttpSendRequest (C2 communication)\n   - RegSetValueEx (persistence via registry)\n4. Use Search -> For Strings to find embedded URLs, IPs, and paths\n5. Check the Functions window sorted by size (large functions often contain core logic)\n```\n\n**Ghidra keyboard shortcuts for efficient navigation:**\n```\nG         - Go to address\nCtrl+E    - Search for strings\nX         - Show cross-references to current location\nCtrl+Shift+F - Search memory for byte patterns\nL         - Rename label\u002Ffunction\n;         - Add comment\nT         - Retype variable\nCtrl+L    - Retype return value\n```\n\n### Step 3: Analyze Decompiled Code\n\nUse Ghidra's decompiler to understand function logic:\n\n```c\n\u002F\u002F Example: Ghidra decompiler output for a decryption routine\n\u002F\u002F Analyst renames variables and adds types for clarity\n\nvoid decrypt_config(BYTE *encrypted_data, int data_len, BYTE *key, int key_len) {\n    \u002F\u002F XOR decryption with rolling key\n    for (int i = 0; i \u003C data_len; i++) {\n        encrypted_data[i] = encrypted_data[i] ^ key[i % key_len];\n    }\n    return;\n}\n\n\u002F\u002F Analyst actions in Ghidra:\n\u002F\u002F 1. Right-click parameters -> Retype to correct types (BYTE*, int)\n\u002F\u002F 2. Right-click variables -> Rename to meaningful names\n\u002F\u002F 3. Add comments explaining the algorithm\n\u002F\u002F 4. Set function signature to propagate types to callers\n```\n\n### Step 4: Trace C2 Communication Logic\n\nFollow the network communication code path:\n\n```\nAnalysis Steps for C2 Protocol Reverse Engineering:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n1. Find InternetOpenA\u002FWinHttpOpen call -> trace to wrapper function\n2. Follow data flow from encrypted config -> URL construction\n3. Identify HTTP method (GET\u002FPOST), headers, and body format\n4. Locate response parsing logic (JSON parsing, custom binary protocol)\n5. Map the C2 command dispatcher (switch\u002Fcase or jump table)\n6. Document the command set (download, execute, exfiltrate, update, uninstall)\n```\n\n**Ghidra Script for extracting C2 configuration:**\n```python\n# Ghidra Python script: extract_c2_config.py\n# Run via Script Manager in Ghidra\n\nfrom ghidra.program.model.data import StringDataType\nfrom ghidra.program.model.symbol import SourceType\n\n# Search for XOR decryption patterns\nlisting = currentProgram.getListing()\nmemory = currentProgram.getMemory()\n\n# Find references to InternetOpenA\nsymbol_table = currentProgram.getSymbolTable()\nfor symbol in symbol_table.getExternalSymbols():\n    if \"InternetOpen\" in symbol.getName():\n        refs = getReferencesTo(symbol.getAddress())\n        for ref in refs:\n            print(\"C2 init at: {}\".format(ref.getFromAddress()))\n```\n\n### Step 5: Analyze Encryption and Obfuscation\n\nIdentify and document cryptographic routines:\n\n```\nCommon Malware Encryption Patterns:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nXOR Cipher:     Loop with XOR operation, often single-byte or rolling key\nRC4:            Two loops (KSA + PRGA), 256-byte S-box initialization\nAES:            Look for S-box constants (0x63, 0x7C, 0x77...) or calls to CryptEncrypt\nBase64:         Lookup table with A-Za-z0-9+\u002F= characters\nCustom:         Combination of arithmetic operations (ADD, SUB, ROL, ROR with XOR)\n\nIdentification Tips:\n- Search for constants: AES S-box, CRC32 table, MD5 init values\n- Look for loop structures operating on byte arrays\n- Check for Windows Crypto API usage (CryptAcquireContext -> CryptCreateHash -> CryptEncrypt)\n- FindCrypt Ghidra plugin automatically identifies crypto constants\n```\n\n### Step 6: Document Findings and Create Detection Signatures\n\nProduce actionable intelligence from reverse engineering:\n\n```bash\n# Generate YARA rule from unique code patterns found in Ghidra\ncat \u003C\u003C 'EOF' > malware_family_x.yar\nrule MalwareFamilyX_Decryptor {\n    meta:\n        description = \"Detects MalwareX decryption routine\"\n        author = \"analyst\"\n        date = \"2025-09-15\"\n    strings:\n        \u002F\u002F XOR decryption loop with hardcoded key\n        $decrypt = { 8A 04 0E 32 04 0F 88 04 0E 41 3B CA 7C F3 }\n        \u002F\u002F C2 URL pattern after decryption\n        $c2_pattern = \"\u002Fgate.php?id=\" ascii\n    condition:\n        uint16(0) == 0x5A4D and $decrypt and $c2_pattern\n}\nEOF\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Disassembly** | Converting machine code bytes into human-readable assembly language instructions; Ghidra's Listing view shows disassembled code |\n| **Decompilation** | Lifting assembly code to pseudo-C representation for easier analysis; Ghidra's Decompile window provides this view |\n| **Cross-Reference (XREF)** | Reference showing where a function or data address is called from or used; essential for tracing code execution flow |\n| **Control Flow Graph (CFG)** | Visual representation of all possible execution paths through a function; reveals branching logic and loops |\n| **Original Entry Point (OEP)** | The actual start address of the malware code after unpacking; packers redirect execution through an unpacking stub first |\n| **Function Signature** | The return type, name, and parameter types of a function; applying correct signatures improves decompiler output quality |\n| **Ghidra Script** | Python or Java automation script executed within Ghidra to perform batch analysis, pattern searching, or data extraction |\n\n## Tools & Systems\n\n- **Ghidra**: NSA's open-source software reverse engineering suite with disassembler, decompiler, and scripting support for multiple architectures\n- **IDA Pro\u002FFree**: Industry-standard interactive disassembler; IDA Free provides x86\u002Fx64 cloud-based decompilation\n- **Binary Ninja**: Commercial reverse engineering platform with modern UI and extensive API for plugin development\n- **x64dbg**: Open-source x64\u002Fx32 debugger for Windows used alongside Ghidra for dynamic debugging of malware\n- **FindCrypt (Ghidra Plugin)**: Plugin that identifies cryptographic constants and algorithms in binary code\n\n## Common Scenarios\n\n### Scenario: Reversing Custom C2 Protocol\n\n**Context**: Behavioral analysis shows encrypted traffic to an external IP on a non-standard port. Network signatures cannot detect variants because the protocol is proprietary. Deep reverse engineering is needed to understand the protocol structure.\n\n**Approach**:\n1. Import the unpacked sample into Ghidra and run full auto-analysis\n2. Locate socket\u002FWinHTTP API calls and trace backwards to the calling function\n3. Identify the encryption routine called before data is sent (follow data flow from send\u002FHttpSendRequest)\n4. Reverse the encryption (XOR key extraction, RC4 key derivation, AES key location)\n5. Map the command structure by analyzing the response parsing function (switch\u002Fcase on command IDs)\n6. Document the protocol format (header structure, command bytes, encryption method)\n7. Create a protocol decoder script for network monitoring tools\n\n**Pitfalls**:\n- Not running the full auto-analysis before starting manual analysis (missing function boundaries and type propagation)\n- Ignoring indirect calls through function pointers or vtables (use cross-references to data holding function addresses)\n- Spending time on library code that Ghidra's Function ID (FID) or FLIRT signatures should have identified\n- Not saving Ghidra project progress frequently (analysis state can be lost on crashes)\n\n## Output Format\n\n```\nREVERSE ENGINEERING ANALYSIS REPORT\n=====================================\nSample:           unpacked_payload.exe\nSHA-256:          abc123def456...\nArchitecture:     x86 (32-bit PE)\nGhidra Project:   MalwareX_Analysis\n\nFUNCTION MAP\n0x00401000  main()              - Entry point, initializes config\n0x00401200  decrypt_config()    - XOR decryption with 16-byte key\n0x00401400  init_c2()           - WinHTTP initialization, URL construction\n0x00401800  c2_beacon()         - HTTP POST beacon with system info\n0x00401C00  cmd_dispatcher()    - Switch on 12 command codes\n0x00402000  inject_process()    - Process hollowing into svchost.exe\n0x00402400  persist_registry()  - HKCU Run key persistence\n0x00402800  exfil_data()        - File collection and encrypted upload\n\nC2 PROTOCOL\nMethod:           HTTPS POST to \u002Fgate.php\nEncryption:       RC4 with derived key (MD5 of bot_id + campaign_key)\nBot ID Format:    MD5(hostname + username + volume_serial)\nBeacon Interval:  60 seconds with 10% jitter\nCommand Set:\n  0x01 - Download and execute file\n  0x02 - Execute shell command\n  0x03 - Upload file to C2\n  0x04 - Update configuration\n  0x05 - Uninstall and remove traces\n\nENCRYPTION DETAILS\nAlgorithm:        RC4\nKey Derivation:   MD5(bot_id + \"campaign_2025_q3\")\nHardcoded Seed:   \"campaign_2025_q3\" at offset 0x00405A00\n\nEXTRACTED IOCs\nC2 URLs:          hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\n                  hxxps:\u002F\u002Fbackup.evil[.]net\u002Fgate.php (failover)\nCampaign ID:      campaign_2025_q3\nRC4 Key Material: [see encryption details above]\n```\n",{},"main","19a54ac988e9929160334271f5c1924ddd9b227e","_modules\u002Freverse-engineering-malware-with-ghidra",19,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill","https:\u002F\u002Fgithub.com\u002Falicewe1","写一些自己用得上的工具，能自动化就绝不手动 · 自动化 \u002F 工程效率 \u002F Agent 技能生态 · 保持好奇，持续构建","2026-09-30 00:41:20",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add alicewe1\u002Falice_skill --skill reverse-engineering-malware-with-ghidra",{"tool":38,"command":39},"bunx","bunx skills add alicewe1\u002Falice_skill --skill reverse-engineering-malware-with-ghidra",{"tool":41,"command":42},"pnpm","pnpm dlx skills add alicewe1\u002Falice_skill --skill reverse-engineering-malware-with-ghidra","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Freverse-engineering-malware-with-ghidra\u002FSKILL.md",true,[46,50,56],{"path":47,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fapi-reference.md","REFERENCE","参考文档",2658,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Freverse-engineering-malware-with-ghidra\u002Freferences\u002Fapi-reference.md",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"scripts\u002Fagent.py","SCRIPT","脚本",8433,"https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002F_modules\u002Freverse-engineering-malware-with-ghidra\u002Fscripts\u002Fagent.py",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7DBMD9P6R27SWQCW5HYVWG0","alice","Alice 六类技能总路由。用户输入 Alice 或要求查看 Alice 技能菜单时，严格输出固定菜单；输入攻\u002F防模式、六类入口或直接描述任务时，按类别→领域→模块渐进路由。","GPL-3.0","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Faliceskill\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DBM8X5M7YXPYBVFMWF8HRC","alice-reverse","逆向分析渐进路由（二进制 \u002F 移动端 \u002F 协议 \u002F 取证 \u002F 保护机制 \u002F 运行时观测）。触发词：二进制\u002F移动端\u002F反编译\u002FFrida\u002FIDA\u002FGhidra\u002FPE\u002FELF\u002FAPK\u002F协议\u002F取证；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-reverse\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DBM630E2YKQP29194TT7HC","alice-pentest","web安全渐进路由（Web \u002F API \u002F 资产发现 \u002F 漏洞验证 \u002F 云与网络安全）。触发词：Web\u002FAPI\u002F资产发现\u002F端口\u002F漏洞验证\u002F云与网络安全；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-pentest\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DBM20M2VDYV5D3MYDGBTQX","alice-game","游戏攻防渐进路由（游戏客户端 \u002F 内存 \u002F 图形 \u002F 反作弊 \u002F 安全研究）。触发词：游戏客户端\u002F内存\u002F图形\u002F偏移\u002F反作弊\u002F模拟器\u002F覆盖层；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-game\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DBKXVEKB8931MZG23VACFN","alice-crack","卡密授权渐进路由（卡密 \u002F 激活 \u002F 授权验证 \u002F 许可证管理 \u002F 本地授权分析）。触发词：卡密\u002F激活\u002F授权验证\u002Flicense\u002F机器码\u002F试用状态；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-crack\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DBKTMT90MGV2WP8K73TMQD","alice-assist","技能指令渐进路由（技能路由 \u002F 评分 \u002F 吸收 \u002F 迁移 \u002F 自动化 \u002F 文档与平台集成）。触发词：技能创建\u002F吸收\u002F评分\u002F迁移\u002F自动化\u002F文档\u002F平台指令；先选领域索引，再按任务匹配度与评分选模块，禁止一次读取全部领域。","https:\u002F\u002Fgithub.com\u002Falicewe1\u002Falice_skill\u002Fblob\u002Fmain\u002Falice-assist\u002FSKILL.md",[],[]]