[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B97HCXNNZQSJF1RDEAW3N8":3,"skill-same:01M7B97HCXNNZQSJF1RDEAW3N8":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"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":45,"commitSha":46,"skillDirectory":47,"forksCount":13,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M7B97HCXNNZQSJF1RDEAW3N8","reverse-engineering-dotnet-malware-with-dnspy",null,"Reverse engineers .NET malware samples using the dnSpy decompiler and debugger to read C#\u002FVB.NET source, deobfuscate code protected by tools like ConfuserEx or SmartAssembly, and extract hardcoded C2 configurations, keys, and credentials. Use when a sample is identified as a .NET assembly (e.g. AgentTesla, AsyncRAT, RedLine Stealer, Quasar RAT) and needs decompilation, deobfuscation, or config extraction.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: reverse-engineering-dotnet-malware-with-dnspy\ndescription: 'Reverse engineers .NET malware samples using the dnSpy decompiler and\n  debugger to read C#\u002FVB.NET source, deobfuscate code protected by tools like ConfuserEx\n  or SmartAssembly, and extract hardcoded C2 configurations, keys, and credentials.\n  Use when a sample is identified as a .NET assembly (e.g. AgentTesla, AsyncRAT, RedLine\n  Stealer, Quasar RAT) and needs decompilation, deobfuscation, or config extraction.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- dotnet\n- reverse-engineering\n- dnSpy\n- decompilation\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.AE-02\n- RS.AN-03\n- ID.RA-01\n- DE.CM-01\nmitre_attack:\n- T1027\n- T1055\n- T1140\n- T1497\n---\n\n# Reverse Engineering .NET Malware with dnSpy\n\n## When to Use\n\n- A malware sample is identified as a .NET assembly (C#, VB.NET, F#) requiring decompilation\n- Analyzing .NET-based malware families (AgentTesla, AsyncRAT, RedLine Stealer, Quasar RAT)\n- Deobfuscating .NET code protected by ConfuserEx, SmartAssembly, or custom obfuscators\n- Extracting hardcoded C2 configurations, encryption keys, and credentials from managed assemblies\n- Debugging .NET malware at runtime to observe decryption routines and dynamic behavior\n\n**Do not use** for native (unmanaged) PE binaries; use Ghidra or IDA for native code analysis.\n\n## Prerequisites\n\n- dnSpy or dnSpyEx installed (https:\u002F\u002Fgithub.com\u002FdnSpyEx\u002FdnSpy - community maintained fork)\n- de4dot for automated .NET deobfuscation (`https:\u002F\u002Fgithub.com\u002Fde4dot\u002Fde4dot`)\n- ILSpy as an alternative decompiler for cross-validation\n- .NET SDK installed for recompiling modified assemblies during analysis\n- Isolated Windows VM for running dnSpy debugger on live malware\n- Detect It Easy (DIE) for identifying the .NET obfuscator used\n\n## Workflow\n\n### Step 1: Identify .NET Assembly and Obfuscator\n\nVerify the sample is a .NET binary and detect protection:\n\n```bash\n# Check if file is .NET assembly\nfile suspect.exe\n# Output should contain \"PE32 executable\" with .NET metadata\n\n# Detect obfuscator with Detect It Easy\ndiec suspect.exe\n\n# Python-based .NET detection\npython3 \u003C\u003C 'PYEOF'\nimport pefile\n\npe = pefile.PE(\"suspect.exe\")\n\n# Check for .NET COM descriptor\nif hasattr(pe, 'DIRECTORY_ENTRY_COM_DESCRIPTOR'):\n    print(\"[*] .NET assembly detected\")\n    print(f\"    Runtime version: {pe.DIRECTORY_ENTRY_COM_DESCRIPTOR}\")\nelse:\n    # Check for mscoree.dll import (alternative detection)\n    for entry in pe.DIRECTORY_ENTRY_IMPORT:\n        if entry.dll.decode().lower() == \"mscoree.dll\":\n            print(\"[*] .NET assembly detected (mscoree.dll import)\")\n            break\n    else:\n        print(\"[!] Not a .NET assembly\")\n\n# Check section names for .NET indicators\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    if name in ['.text', '.rsrc', '.reloc']:\n        print(f\"    Section: {name} (typical .NET)\")\nPYEOF\n```\n\n### Step 2: Deobfuscate with de4dot\n\nRemove common .NET obfuscation before manual analysis:\n\n```bash\n# Run de4dot to identify and remove obfuscation\nde4dot suspect.exe -o suspect_cleaned.exe\n\n# Force specific deobfuscator\nde4dot suspect.exe -p cf  # ConfuserEx\nde4dot suspect.exe -p sa  # SmartAssembly\nde4dot suspect.exe -p dr  # Dotfuscator\nde4dot suspect.exe -p rv  # Reactor\nde4dot suspect.exe -p bl  # Babel.NET\n\n# Verbose output for debugging\nde4dot -v suspect.exe -o suspect_cleaned.exe\n\n# Handle multi-file assemblies\nde4dot suspect.exe suspect_helper.dll -o cleaned\u002F\n```\n\n```\nCommon .NET Obfuscators:\n━━━━━━━━━━━━━━━━━━━━━━━\nConfuserEx:      String encryption, control flow, anti-debug, anti-tamper\nSmartAssembly:   String encoding, flow obfuscation, pruning\nDotfuscator:     Renaming, string encryption, control flow\n.NET Reactor:    Native code generation, necrobit, anti-debug\nBabel.NET:       String encryption, resource encryption, code virtualization\nCrypto Obfuscator: String encryption, anti-debug, watermarking\nCustom:          Malware-specific obfuscation (manual de4dot configuration needed)\n```\n\n### Step 3: Open in dnSpy and Analyze Code\n\nLoad the deobfuscated assembly in dnSpy for source-level analysis:\n\n```\ndnSpy Analysis Workflow:\n━━━━━━━━━━━━━━━━━━━━━━━\n1. File -> Open -> Select cleaned assembly\n2. Navigate to the entry point:\n   - Assembly Explorer -> \u003Cnamespace> -> Program class -> Main method\n   - Or: Right-click assembly -> Go to Entry Point\n\n3. Key areas to examine:\n   - Entry point (Main) for initialization and execution flow\n   - Form classes for UI-based malware (RATs, stealers)\n   - Network\u002FHTTP classes for C2 communication\n   - Crypto\u002Fencryption classes for data protection\n   - Resource access for embedded payloads\n   - Timer\u002FThread classes for persistence and scheduling\n\n4. Navigation shortcuts:\n   Ctrl+G       - Go to token\u002Faddress\n   Ctrl+Shift+K - Search assemblies\n   F12          - Go to definition\n   Ctrl+R       - Analyze (find usages)\n   F5           - Start debugging\n   F9           - Toggle breakpoint\n```\n\n### Step 4: Extract Configuration and C2 Data\n\nLocate hardcoded configuration in the decompiled source:\n\n```csharp\n\u002F\u002F Common .NET malware configuration patterns:\n\n\u002F\u002F Pattern 1: Static class with hardcoded values\npublic static class Config {\n    public static string Host = \"185.220.101.42\";\n    public static int Port = 4782;\n    public static string Key = \"GhOsT_RaT_2025\";\n    public static string Mutex = \"AsyncMutex_6SI8OkPnk\";\n    public static bool Install = true;\n    public static string InstallFolder = \"%AppData%\";\n}\n\n\u002F\u002F Pattern 2: Encrypted strings decrypted at runtime\npublic static string Decrypt(string input) {\n    byte[] data = Convert.FromBase64String(input);\n    byte[] key = Encoding.UTF8.GetBytes(\"SecretKey123\");\n    for (int i = 0; i \u003C data.Length; i++) {\n        data[i] ^= key[i % key.Length];\n    }\n    return Encoding.UTF8.GetString(data);\n}\n\n\u002F\u002F Pattern 3: Resource-embedded configuration\nbyte[] configData = Properties.Resources.config;\nstring config = AES.Decrypt(configData, derivedKey);\n```\n\n```python\n# Python script to extract .NET resource strings\nimport subprocess\nimport re\nimport base64\n\n# Use monodis (Mono) or ildasm (.NET SDK) to dump IL\nresult = subprocess.run(\n    [\"monodis\", \"--output=il_dump.il\", \"suspect_cleaned.exe\"],\n    capture_output=True, text=True\n)\n\n# Search for string literals in IL dump\nwith open(\"il_dump.il\", errors=\"ignore\") as f:\n    il_code = f.read()\n\n# Find ldstr (load string) instructions\nstrings = re.findall(r'ldstr\\s+\"([^\"]+)\"', il_code)\nfor s in strings:\n    # Check for Base64 encoded strings\n    try:\n        decoded = base64.b64decode(s).decode('utf-8', errors='ignore')\n        if len(decoded) > 3 and decoded.isprintable():\n            print(f\"  Base64: {s[:40]}... -> {decoded[:100]}\")\n    except:\n        pass\n    # Check for URLs\u002FIPs\n    if re.match(r'https?:\u002F\u002F', s) or re.match(r'\\d+\\.\\d+\\.\\d+\\.\\d+', s):\n        print(f\"  Network: {s}\")\n```\n\n### Step 5: Debug with dnSpy\n\nSet breakpoints and debug the malware to observe runtime behavior:\n\n```\ndnSpy Debugging Workflow:\n━━━━━━━━━━━━━━━━━━━━━━━\n1. Set breakpoints on key methods:\n   - String decryption functions (to capture decrypted values)\n   - Network connection methods (to capture C2 URLs)\n   - File write operations (to see what is dropped)\n   - Registry modification methods (to see persistence)\n\n2. Debug -> Start Debugging (F5)\n   - Select the assembly to debug\n   - Set command-line arguments if needed\n   - Configure exception handling (break on all CLR exceptions)\n\n3. At each breakpoint:\n   - Inspect local variables (Locals window)\n   - Evaluate expressions (Immediate window)\n   - View call stack to understand execution context\n   - Step over (F10) \u002F Step into (F11) \u002F Step out (Shift+F11)\n\n4. Capture decrypted strings:\n   - Set breakpoint after decryption function returns\n   - Read the return value from the Locals window\n   - Document all decrypted configuration values\n```\n\n### Step 6: Document Findings\n\nCompile analysis results into a structured report:\n\n```\nAnalysis documentation should include:\n- .NET assembly metadata (CLR version, target framework, compilation info)\n- Obfuscator identified and deobfuscation method used\n- Complete C2 configuration (hosts, ports, encryption keys, mutex names)\n- Malware capabilities (keylogging, screen capture, file theft, etc.)\n- Persistence mechanisms (registry, scheduled tasks, startup folder)\n- Anti-analysis techniques (VM detection, debugger detection, sandbox evasion)\n- Extracted IOCs (C2 IPs\u002Fdomains, file hashes, mutex names, registry keys)\n- YARA rule based on unique code patterns or strings\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **CIL\u002FMSIL** | Common Intermediate Language; the bytecode format .NET assemblies compile to, which can be decompiled back to high-level C#\u002FVB.NET |\n| **Metadata Token** | Unique identifier for .NET types, methods, and fields within the assembly metadata tables; used for navigation in dnSpy |\n| **de4dot** | Open-source .NET deobfuscator that identifies and removes protection from many commercial and malware-specific obfuscators |\n| **ConfuserEx** | Popular open-source .NET obfuscator frequently used by malware authors for string encryption and control flow obfuscation |\n| **String Encryption** | Obfuscation technique replacing string literals with encrypted data and runtime decryption calls to hide IOCs from static analysis |\n| **Resource Embedding** | Storing configuration, payloads, or additional assemblies in .NET embedded resources, often encrypted with a key derived from assembly metadata |\n| **Assembly.Load** | .NET method loading assemblies from byte arrays in memory, enabling fileless execution of embedded payloads |\n\n## Tools & Systems\n\n- **dnSpy\u002FdnSpyEx**: Open-source .NET assembly editor, decompiler, and debugger supporting C# and VB.NET decompilation\n- **de4dot**: Automated .NET deobfuscator supporting ConfuserEx, SmartAssembly, Dotfuscator, Reactor, and many other protectors\n- **ILSpy**: Open-source .NET decompiler providing C#, VB.NET, and IL views of assembly code\n- **dotPeek**: JetBrains' free .NET decompiler with symbol server and cross-reference navigation\n- **Detect It Easy (DIE)**: Multi-format file analyzer identifying .NET framework version, obfuscator, and compiler information\n\n## Common Scenarios\n\n### Scenario: Analyzing an AgentTesla Information Stealer\n\n**Context**: A phishing email delivers a .NET executable identified as AgentTesla. The sample needs analysis to determine what credentials it steals, how it exfiltrates data, and its C2 configuration.\n\n**Approach**:\n1. Run Detect It Easy to identify the obfuscator (commonly ConfuserEx or custom)\n2. Deobfuscate with de4dot to restore readable class\u002Fmethod names and decrypt strings\n3. Open in dnSpy and navigate to the entry point to understand initialization\n4. Locate the credential harvesting modules (browser, email, FTP, VPN password theft classes)\n5. Find the exfiltration method (SMTP email, FTP upload, HTTP POST, Telegram bot API)\n6. Extract C2 configuration (SMTP server, credentials, recipient email, or HTTP URL)\n7. Set debugger breakpoints on the decryption function to capture all decrypted strings at once\n\n**Pitfalls**:\n- Analyzing without de4dot first (ConfuserEx makes manual analysis extremely difficult)\n- Not checking for multi-stage loading (initial .NET executable may load additional assemblies from resources)\n- Missing configuration stored in .NET resources rather than hardcoded strings\n- Running the debugger without network isolation (AgentTesla will attempt to exfiltrate immediately)\n\n## Output Format\n\n```\n.NET MALWARE ANALYSIS REPORT\n================================\nSample:           invoice_scanner.exe\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nType:             .NET Assembly (C#)\nFramework:        .NET Framework 4.8\nObfuscator:       ConfuserEx v1.6\nDeobfuscated:     Yes (de4dot -p cf)\n\nCLASSIFICATION\nFamily:           AgentTesla v3\nType:             Information Stealer \u002F Keylogger\nCompile Date:     2025-09-10\n\nC2 CONFIGURATION\nExfil Method:     SMTP (Email)\nSMTP Server:      smtp.yandex[.]com:587\nSMTP User:        exfil.account@yandex[.]com\nSMTP Pass:        Str0ngP@ssw0rd2025\nRecipient:        operator@protonmail[.]com\nInterval:         30 minutes\nEncryption:       AES-256 with key \"AgentTesla_2025_key\"\n\nCAPABILITIES\n[*] Browser credential theft (Chrome, Firefox, Edge, Opera)\n[*] Email client passwords (Outlook, Thunderbird)\n[*] FTP client credentials (FileZilla, WinSCP)\n[*] VPN credentials (NordVPN, OpenVPN)\n[*] Keylogging (SetWindowsHookEx)\n[*] Screenshot capture (every 30 seconds)\n[*] Clipboard monitoring\n\nPERSISTENCE\nMethod:           Registry Run key + Scheduled Task\nRegistry:         HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\WindowsUpdate\nTask:             \\Microsoft\\Windows\\WindowsUpdate\\Updater\n\nEXTRACTED IOCs\nSMTP Server:      smtp.yandex[.]com\nExfil Email:      exfil.account@yandex[.]com\nRecipient:        operator@protonmail[.]com\nMutex:            AgentTesla_2025_Q3_MUTEX\nInstall Path:     %AppData%\\Microsoft\\Windows\\svchost.exe\n```\n","# Reverse Engineering .NET Malware with dnSpy\n\n## When to Use\n\n- A malware sample is identified as a .NET assembly (C#, VB.NET, F#) requiring decompilation\n- Analyzing .NET-based malware families (AgentTesla, AsyncRAT, RedLine Stealer, Quasar RAT)\n- Deobfuscating .NET code protected by ConfuserEx, SmartAssembly, or custom obfuscators\n- Extracting hardcoded C2 configurations, encryption keys, and credentials from managed assemblies\n- Debugging .NET malware at runtime to observe decryption routines and dynamic behavior\n\n**Do not use** for native (unmanaged) PE binaries; use Ghidra or IDA for native code analysis.\n\n## Prerequisites\n\n- dnSpy or dnSpyEx installed (https:\u002F\u002Fgithub.com\u002FdnSpyEx\u002FdnSpy - community maintained fork)\n- de4dot for automated .NET deobfuscation (`https:\u002F\u002Fgithub.com\u002Fde4dot\u002Fde4dot`)\n- ILSpy as an alternative decompiler for cross-validation\n- .NET SDK installed for recompiling modified assemblies during analysis\n- Isolated Windows VM for running dnSpy debugger on live malware\n- Detect It Easy (DIE) for identifying the .NET obfuscator used\n\n## Workflow\n\n### Step 1: Identify .NET Assembly and Obfuscator\n\nVerify the sample is a .NET binary and detect protection:\n\n```bash\n# Check if file is .NET assembly\nfile suspect.exe\n# Output should contain \"PE32 executable\" with .NET metadata\n\n# Detect obfuscator with Detect It Easy\ndiec suspect.exe\n\n# Python-based .NET detection\npython3 \u003C\u003C 'PYEOF'\nimport pefile\n\npe = pefile.PE(\"suspect.exe\")\n\n# Check for .NET COM descriptor\nif hasattr(pe, 'DIRECTORY_ENTRY_COM_DESCRIPTOR'):\n    print(\"[*] .NET assembly detected\")\n    print(f\"    Runtime version: {pe.DIRECTORY_ENTRY_COM_DESCRIPTOR}\")\nelse:\n    # Check for mscoree.dll import (alternative detection)\n    for entry in pe.DIRECTORY_ENTRY_IMPORT:\n        if entry.dll.decode().lower() == \"mscoree.dll\":\n            print(\"[*] .NET assembly detected (mscoree.dll import)\")\n            break\n    else:\n        print(\"[!] Not a .NET assembly\")\n\n# Check section names for .NET indicators\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    if name in ['.text', '.rsrc', '.reloc']:\n        print(f\"    Section: {name} (typical .NET)\")\nPYEOF\n```\n\n### Step 2: Deobfuscate with de4dot\n\nRemove common .NET obfuscation before manual analysis:\n\n```bash\n# Run de4dot to identify and remove obfuscation\nde4dot suspect.exe -o suspect_cleaned.exe\n\n# Force specific deobfuscator\nde4dot suspect.exe -p cf  # ConfuserEx\nde4dot suspect.exe -p sa  # SmartAssembly\nde4dot suspect.exe -p dr  # Dotfuscator\nde4dot suspect.exe -p rv  # Reactor\nde4dot suspect.exe -p bl  # Babel.NET\n\n# Verbose output for debugging\nde4dot -v suspect.exe -o suspect_cleaned.exe\n\n# Handle multi-file assemblies\nde4dot suspect.exe suspect_helper.dll -o cleaned\u002F\n```\n\n```\nCommon .NET Obfuscators:\n━━━━━━━━━━━━━━━━━━━━━━━\nConfuserEx:      String encryption, control flow, anti-debug, anti-tamper\nSmartAssembly:   String encoding, flow obfuscation, pruning\nDotfuscator:     Renaming, string encryption, control flow\n.NET Reactor:    Native code generation, necrobit, anti-debug\nBabel.NET:       String encryption, resource encryption, code virtualization\nCrypto Obfuscator: String encryption, anti-debug, watermarking\nCustom:          Malware-specific obfuscation (manual de4dot configuration needed)\n```\n\n### Step 3: Open in dnSpy and Analyze Code\n\nLoad the deobfuscated assembly in dnSpy for source-level analysis:\n\n```\ndnSpy Analysis Workflow:\n━━━━━━━━━━━━━━━━━━━━━━━\n1. File -> Open -> Select cleaned assembly\n2. Navigate to the entry point:\n   - Assembly Explorer -> \u003Cnamespace> -> Program class -> Main method\n   - Or: Right-click assembly -> Go to Entry Point\n\n3. Key areas to examine:\n   - Entry point (Main) for initialization and execution flow\n   - Form classes for UI-based malware (RATs, stealers)\n   - Network\u002FHTTP classes for C2 communication\n   - Crypto\u002Fencryption classes for data protection\n   - Resource access for embedded payloads\n   - Timer\u002FThread classes for persistence and scheduling\n\n4. Navigation shortcuts:\n   Ctrl+G       - Go to token\u002Faddress\n   Ctrl+Shift+K - Search assemblies\n   F12          - Go to definition\n   Ctrl+R       - Analyze (find usages)\n   F5           - Start debugging\n   F9           - Toggle breakpoint\n```\n\n### Step 4: Extract Configuration and C2 Data\n\nLocate hardcoded configuration in the decompiled source:\n\n```csharp\n\u002F\u002F Common .NET malware configuration patterns:\n\n\u002F\u002F Pattern 1: Static class with hardcoded values\npublic static class Config {\n    public static string Host = \"185.220.101.42\";\n    public static int Port = 4782;\n    public static string Key = \"GhOsT_RaT_2025\";\n    public static string Mutex = \"AsyncMutex_6SI8OkPnk\";\n    public static bool Install = true;\n    public static string InstallFolder = \"%AppData%\";\n}\n\n\u002F\u002F Pattern 2: Encrypted strings decrypted at runtime\npublic static string Decrypt(string input) {\n    byte[] data = Convert.FromBase64String(input);\n    byte[] key = Encoding.UTF8.GetBytes(\"SecretKey123\");\n    for (int i = 0; i \u003C data.Length; i++) {\n        data[i] ^= key[i % key.Length];\n    }\n    return Encoding.UTF8.GetString(data);\n}\n\n\u002F\u002F Pattern 3: Resource-embedded configuration\nbyte[] configData = Properties.Resources.config;\nstring config = AES.Decrypt(configData, derivedKey);\n```\n\n```python\n# Python script to extract .NET resource strings\nimport subprocess\nimport re\nimport base64\n\n# Use monodis (Mono) or ildasm (.NET SDK) to dump IL\nresult = subprocess.run(\n    [\"monodis\", \"--output=il_dump.il\", \"suspect_cleaned.exe\"],\n    capture_output=True, text=True\n)\n\n# Search for string literals in IL dump\nwith open(\"il_dump.il\", errors=\"ignore\") as f:\n    il_code = f.read()\n\n# Find ldstr (load string) instructions\nstrings = re.findall(r'ldstr\\s+\"([^\"]+)\"', il_code)\nfor s in strings:\n    # Check for Base64 encoded strings\n    try:\n        decoded = base64.b64decode(s).decode('utf-8', errors='ignore')\n        if len(decoded) > 3 and decoded.isprintable():\n            print(f\"  Base64: {s[:40]}... -> {decoded[:100]}\")\n    except:\n        pass\n    # Check for URLs\u002FIPs\n    if re.match(r'https?:\u002F\u002F', s) or re.match(r'\\d+\\.\\d+\\.\\d+\\.\\d+', s):\n        print(f\"  Network: {s}\")\n```\n\n### Step 5: Debug with dnSpy\n\nSet breakpoints and debug the malware to observe runtime behavior:\n\n```\ndnSpy Debugging Workflow:\n━━━━━━━━━━━━━━━━━━━━━━━\n1. Set breakpoints on key methods:\n   - String decryption functions (to capture decrypted values)\n   - Network connection methods (to capture C2 URLs)\n   - File write operations (to see what is dropped)\n   - Registry modification methods (to see persistence)\n\n2. Debug -> Start Debugging (F5)\n   - Select the assembly to debug\n   - Set command-line arguments if needed\n   - Configure exception handling (break on all CLR exceptions)\n\n3. At each breakpoint:\n   - Inspect local variables (Locals window)\n   - Evaluate expressions (Immediate window)\n   - View call stack to understand execution context\n   - Step over (F10) \u002F Step into (F11) \u002F Step out (Shift+F11)\n\n4. Capture decrypted strings:\n   - Set breakpoint after decryption function returns\n   - Read the return value from the Locals window\n   - Document all decrypted configuration values\n```\n\n### Step 6: Document Findings\n\nCompile analysis results into a structured report:\n\n```\nAnalysis documentation should include:\n- .NET assembly metadata (CLR version, target framework, compilation info)\n- Obfuscator identified and deobfuscation method used\n- Complete C2 configuration (hosts, ports, encryption keys, mutex names)\n- Malware capabilities (keylogging, screen capture, file theft, etc.)\n- Persistence mechanisms (registry, scheduled tasks, startup folder)\n- Anti-analysis techniques (VM detection, debugger detection, sandbox evasion)\n- Extracted IOCs (C2 IPs\u002Fdomains, file hashes, mutex names, registry keys)\n- YARA rule based on unique code patterns or strings\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **CIL\u002FMSIL** | Common Intermediate Language; the bytecode format .NET assemblies compile to, which can be decompiled back to high-level C#\u002FVB.NET |\n| **Metadata Token** | Unique identifier for .NET types, methods, and fields within the assembly metadata tables; used for navigation in dnSpy |\n| **de4dot** | Open-source .NET deobfuscator that identifies and removes protection from many commercial and malware-specific obfuscators |\n| **ConfuserEx** | Popular open-source .NET obfuscator frequently used by malware authors for string encryption and control flow obfuscation |\n| **String Encryption** | Obfuscation technique replacing string literals with encrypted data and runtime decryption calls to hide IOCs from static analysis |\n| **Resource Embedding** | Storing configuration, payloads, or additional assemblies in .NET embedded resources, often encrypted with a key derived from assembly metadata |\n| **Assembly.Load** | .NET method loading assemblies from byte arrays in memory, enabling fileless execution of embedded payloads |\n\n## Tools & Systems\n\n- **dnSpy\u002FdnSpyEx**: Open-source .NET assembly editor, decompiler, and debugger supporting C# and VB.NET decompilation\n- **de4dot**: Automated .NET deobfuscator supporting ConfuserEx, SmartAssembly, Dotfuscator, Reactor, and many other protectors\n- **ILSpy**: Open-source .NET decompiler providing C#, VB.NET, and IL views of assembly code\n- **dotPeek**: JetBrains' free .NET decompiler with symbol server and cross-reference navigation\n- **Detect It Easy (DIE)**: Multi-format file analyzer identifying .NET framework version, obfuscator, and compiler information\n\n## Common Scenarios\n\n### Scenario: Analyzing an AgentTesla Information Stealer\n\n**Context**: A phishing email delivers a .NET executable identified as AgentTesla. The sample needs analysis to determine what credentials it steals, how it exfiltrates data, and its C2 configuration.\n\n**Approach**:\n1. Run Detect It Easy to identify the obfuscator (commonly ConfuserEx or custom)\n2. Deobfuscate with de4dot to restore readable class\u002Fmethod names and decrypt strings\n3. Open in dnSpy and navigate to the entry point to understand initialization\n4. Locate the credential harvesting modules (browser, email, FTP, VPN password theft classes)\n5. Find the exfiltration method (SMTP email, FTP upload, HTTP POST, Telegram bot API)\n6. Extract C2 configuration (SMTP server, credentials, recipient email, or HTTP URL)\n7. Set debugger breakpoints on the decryption function to capture all decrypted strings at once\n\n**Pitfalls**:\n- Analyzing without de4dot first (ConfuserEx makes manual analysis extremely difficult)\n- Not checking for multi-stage loading (initial .NET executable may load additional assemblies from resources)\n- Missing configuration stored in .NET resources rather than hardcoded strings\n- Running the debugger without network isolation (AgentTesla will attempt to exfiltrate immediately)\n\n## Output Format\n\n```\n.NET MALWARE ANALYSIS REPORT\n================================\nSample:           invoice_scanner.exe\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nType:             .NET Assembly (C#)\nFramework:        .NET Framework 4.8\nObfuscator:       ConfuserEx v1.6\nDeobfuscated:     Yes (de4dot -p cf)\n\nCLASSIFICATION\nFamily:           AgentTesla v3\nType:             Information Stealer \u002F Keylogger\nCompile Date:     2025-09-10\n\nC2 CONFIGURATION\nExfil Method:     SMTP (Email)\nSMTP Server:      smtp.yandex[.]com:587\nSMTP User:        exfil.account@yandex[.]com\nSMTP Pass:        Str0ngP@ssw0rd2025\nRecipient:        operator@protonmail[.]com\nInterval:         30 minutes\nEncryption:       AES-256 with key \"AgentTesla_2025_key\"\n\nCAPABILITIES\n[*] Browser credential theft (Chrome, Firefox, Edge, Opera)\n[*] Email client passwords (Outlook, Thunderbird)\n[*] FTP client credentials (FileZilla, WinSCP)\n[*] VPN credentials (NordVPN, OpenVPN)\n[*] Keylogging (SetWindowsHookEx)\n[*] Screenshot capture (every 30 seconds)\n[*] Clipboard monitoring\n\nPERSISTENCE\nMethod:           Registry Run key + Scheduled Task\nRegistry:         HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\WindowsUpdate\nTask:             \\Microsoft\\Windows\\WindowsUpdate\\Updater\n\nEXTRACTED IOCs\nSMTP Server:      smtp.yandex[.]com\nExfil Email:      exfil.account@yandex[.]com\nRecipient:        operator@protonmail[.]com\nMutex:            AgentTesla_2025_Q3_MUTEX\nInstall Path:     %AppData%\\Microsoft\\Windows\\svchost.exe\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":14,"version":32,"nist_csf":33,"subdomain":38,"description":39,"mitre_attack":40},[25,26,27,28,29],"malware","dotnet","reverse-engineering","dnSpy","decompilation","mahipal","cybersecurity","1.0.0",[34,35,36,37],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","Reverse engineers .NET malware samples using the dnSpy decompiler and debugger to read C#\u002FVB.NET source, deobfuscate code protected by tools like ConfuserEx or SmartAssembly, and extract hardcoded C2 configurations, keys, and credentials. Use when a sample is identified as a .NET assembly (e.g. AgentTesla, AsyncRAT, RedLine Stealer, Quasar RAT) and needs decompilation, deobfuscation, or config extraction.\n",[41,42,43,44],"T1027","T1055","T1140","T1497","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill reverse-engineering-dotnet-malware-with-dnspy",{"tool":57,"command":58},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill reverse-engineering-dotnet-malware-with-dnspy",{"tool":60,"command":61},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill reverse-engineering-dotnet-malware-with-dnspy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy\u002FSKILL.md",true,[65,69,75],{"path":66,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fapi-reference.md","REFERENCE","参考文档",2531,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy\u002Freferences\u002Fapi-reference.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fagent.py","SCRIPT","脚本",8248,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Freverse-engineering-dotnet-malware-with-dnspy\u002Fscripts\u002Fagent.py",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]