[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EJPWV11RVV38EXMTS72NEG":3,"skill-same:01M7EJPWV11RVV38EXMTS72NEG":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7EJPWV11RVV38EXMTS72NEG","reverser-dotnet-malware",null,".NET malware analysis — dnSpy\u002FILSpy decompilation, de-obfuscation (ConfuserEx, .NET Reactor, Babel, Crypto Obfuscator), behavioral analysis of managed assemblies, PowerShell cradle extraction, and config decryption for common .NET RAT families.","a18268941610-crypto\u002FDecepticon-shentou","a18268941610-crypto","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F241464571?v=4","01M7EHA2V2KTCYTX78QJKXCZ8Y","fubai","01M7EHA2VKDD5RCWJJKC0ZA101",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Fdotnet-malware\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: reverser-dotnet-malware\ndescription: \".NET malware analysis — dnSpy\u002FILSpy decompilation, de-obfuscation (ConfuserEx, .NET Reactor, Babel, Crypto Obfuscator), behavioral analysis of managed assemblies, PowerShell cradle extraction, and config decryption for common .NET RAT families.\"\nallowed-tools: Bash Read Write\nmetadata:\n  when_to_use: \"dotnet .net malware dnspy ilspy de4dot deobfuscate confuserex reactor obfuscation managed assembly csharp vbnet msil cil rat stealer loader\"\n  subdomain: reverser\n  tags: \".NET, malware, deobfuscation, dnSpy, ILSpy, de4dot\"\n  mitre_attack: \"T1027.002, T1140, T1059.001\"\n---\n\n# .NET Malware Analysis\n\nAnalyze .NET malware from initial triage through full decompilation, de-obfuscation, config extraction, and behavioral mapping.\n\n## Quick Reference\n\n```bash\n# Identify .NET assembly\nfile \u003CTARGET>\npython3 -c \"import pefile; pe=pefile.PE('\u003CTARGET>'); print('CLR:', pe.OPTIONAL_HEADER.DATA_DIRECTORY[14].VirtualAddress)\"\n\n# Fast metadata check\nmonodis --assembly \u003CTARGET>\nstrings -n 10 \u003CTARGET> | grep -iE 'System\\.Reflection|Assembly\\.Load|FromBase64|Invoke|WebClient|DownloadString'\n\n# De-obfuscate with de4dot\nde4dot \u003CTARGET> -o \u003CTARGET>.cleaned.exe\n\n# Decompile to C# project\nilspycmd -p -o .\u002Fdecompiled\u002F \u003CTARGET>\n\n# Extract embedded resources\npython3 -c \"\nimport dnfile\ndn = dnfile.dnPE('\u003CTARGET>')\nfor r in dn.net.resources:\n    print(f'{r.name}  offset={r.offset}  size={r.size}')\n\"\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| Software Packing | T1027.002 | ConfuserEx, .NET Reactor, SmartAssembly, Babel packing |\n| Deobfuscate\u002FDecode | T1140 | Base64 decode + Assembly.Load, XOR decryption of payloads |\n| PowerShell | T1059.001 | Cradle execution: `powershell -enc \u003Cbase64>` from managed code |\n| Obfuscated Files | T1027 | String encryption, control flow flattening, anti-tamper |\n| Reflective Code Loading | T1620 | Assembly.Load(byte[]) for in-memory stage loading |\n\n## 1. Identify .NET Assembly\n\nConfirm the sample is managed code before committing to .NET tooling.\n\n```bash\n# Check PE headers for CLR data directory (index 14)\npython3 \u003C\u003C 'EOF'\nimport pefile, sys\npe = pefile.PE(\"\u003CTARGET>\")\nclr_dir = pe.OPTIONAL_HEADER.DATA_DIRECTORY[14]\nif clr_dir.VirtualAddress > 0:\n    print(f\"[+] .NET assembly confirmed — CLR RVA: {hex(clr_dir.VirtualAddress)}\")\n    # Check runtime version\n    import struct\n    clr_offset = pe.get_offset_from_rva(clr_dir.VirtualAddress)\n    pe.__data__.seek(clr_offset + 8)\n    major, minor = struct.unpack('\u003CHH', pe.__data__.read(4))\n    print(f\"    Runtime: v{major}.{minor}\")\nelse:\n    print(\"[-] Not a .NET assembly\")\n    sys.exit(1)\nEOF\n\n# Alternative quick checks\nfile \u003CTARGET>                    # Look for \"Mono\u002F.Net assembly\"\nexiftool \u003CTARGET> | grep -i \"assembly\\|\\.net\\|framework\"\n```\n\n## 2. Detect Obfuscator\n\nIdentify what protection was applied before attempting decompilation.\n\n```bash\n# de4dot auto-detects most obfuscators\nde4dot --detect-only \u003CTARGET>\n# Output example: \"Detected .NET Reactor 6.x\"\n\n# Detect It Easy (DIE) for packer\u002Fprotector identification\ndiec \u003CTARGET>\n\n# Manual signature checks\nstrings \u003CTARGET> | grep -iE 'ConfuserEx|Reactor|SmartAssembly|Babel|Crypto Obfuscator|Dotfuscator|Eazfuscator|AgileDotNet'\n\n# Check for anti-tamper \u002F anti-debug module initializers\nmonodis --method \u003CTARGET> | grep -i \"cctor\\|InitializeComponent\\|Module\"\n\n# Entropy per section — high entropy in .text = packed\u002Fencrypted\npython3 \u003C\u003C 'EOF'\nimport pefile, math\npe = pefile.PE(\"\u003CTARGET>\")\nfor s in pe.sections:\n    data = s.get_data()\n    if len(data) == 0: continue\n    counts = [data.count(bytes([b])) for b in range(256)]\n    total = len(data)\n    ent = -sum((c\u002Ftotal)*math.log2(c\u002Ftotal) for c in counts if c)\n    name = s.Name.decode().rstrip('\\x00')\n    print(f\"  {name:10s}  entropy={ent:.2f}  {'PACKED' if ent > 7.2 else 'normal'}\")\nEOF\n```\n\n## 3. De-obfuscate\n\nStrip protections layer by layer.\n\n```bash\n# de4dot — handles ConfuserEx, .NET Reactor, SmartAssembly, Babel, etc.\nde4dot \u003CTARGET> -o \u003CTARGET>.cleaned.exe\n\n# If de4dot detects \"Unknown obfuscator\", try force mode:\nde4dot \u003CTARGET> --strtyp delegate --strtok 0x06000042 -o \u003CTARGET>.cleaned.exe\n\n# For ConfuserEx specifically:\n# 1. Remove anti-tamper first (patches module cctor)\nde4dot \u003CTARGET> --un-name \"!^\u003CModule>$&!^\u003C\" -o step1.exe\n# 2. Then full clean\nde4dot step1.exe -o \u003CTARGET>.cleaned.exe\n\n# For .NET Reactor:\n# Use .NET Reactor Slayer or NETReactorSlayer\nNETReactorSlayer.CLI \u003CTARGET>\n\n# Verify result decompiles cleanly\nilspycmd \u003CTARGET>.cleaned.exe | head -50\n```\n\n## 4. Decompile and Analyze\n\nFull source recovery from cleaned assembly.\n\n```bash\n# ILSpy command-line — full project decompilation\nilspycmd -p -o .\u002Fdecompiled\u002F \u003CTARGET>.cleaned.exe\n\n# Search decompiled source for key behaviors\ngrep -rn \"WebClient\\|HttpClient\\|WebRequest\" .\u002Fdecompiled\u002F\ngrep -rn \"Registry\\|RegistryKey\\|SetValue\" .\u002Fdecompiled\u002F\ngrep -rn \"Process\\.Start\\|ProcessStartInfo\" .\u002Fdecompiled\u002F\ngrep -rn \"Assembly\\.Load\\|Activator\\.CreateInstance\" .\u002Fdecompiled\u002F\ngrep -rn \"FromBase64String\\|Convert\\.FromBase64\" .\u002Fdecompiled\u002F\ngrep -rn \"RijndaelManaged\\|AesManaged\\|DES\\|TripleDES\\|RC4\" .\u002Fdecompiled\u002F\ngrep -rn \"Socket\\|TcpClient\\|NetworkStream\" .\u002Fdecompiled\u002F\ngrep -rn \"Clipboard\\|Screenshot\\|Keylog\\|GetAsyncKeyState\" .\u002Fdecompiled\u002F\n\n# Extract hardcoded C2 \u002F config\ngrep -rn \"http:\u002F\u002F\\|https:\u002F\u002F\\|ftp:\u002F\u002F\\|\\b[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\b\" .\u002Fdecompiled\u002F\n\n# Dump embedded resources (payloads, configs, second stages)\npython3 \u003C\u003C 'EOF'\nimport dnfile, os\ndn = dnfile.dnPE(\"\u003CTARGET>.cleaned.exe\")\nos.makedirs(\"resources\", exist_ok=True)\nfor res in dn.net.resources:\n    if hasattr(res, 'data') and res.data:\n        path = f\"resources\u002F{res.name}\"\n        open(path, 'wb').write(res.data)\n        print(f\"[+] Extracted: {path} ({len(res.data)} bytes)\")\nEOF\n```\n\n## 5. PowerShell Cradle Extraction\n\n.NET loaders frequently spawn encoded PowerShell.\n\n```bash\n# Find encoded PowerShell invocations in decompiled source\ngrep -rn \"\\-enc\\|\\-EncodedCommand\\|\\-e \" .\u002Fdecompiled\u002F\n\n# Decode base64 PowerShell payloads\npython3 \u003C\u003C 'EOF'\nimport base64, sys\nencoded = \"\u003CBASE64_PAYLOAD>\"\ndecoded = base64.b64decode(encoded).decode('utf-16-le')\nprint(decoded)\n# Write to file for further analysis\nwith open(\"decoded_ps.ps1\", \"w\") as f:\n    f.write(decoded)\nEOF\n\n# Look for staged downloads\ngrep -iE 'DownloadString|DownloadFile|DownloadData|Invoke-Expression|IEX|Net\\.WebClient' decoded_ps.ps1\n```\n\n## 6. Config Extraction for Known Families\n\n```bash\n# AsyncRAT config extraction\npython3 \u003C\u003C 'EOF'\nimport base64, hashlib\nfrom Crypto.Cipher import AES\n\n# AsyncRAT stores config as encrypted strings in Settings class\n# Key is derived from a hardcoded passphrase via PBKDF2\npassphrase = \"\u003CEXTRACTED_KEY>\"  # From Settings.Key in decompiled source\nsalt = b\"\u003CEXTRACTED_SALT>\"     # From Settings.aession\n\nkey = hashlib.pbkdf2_hmac('sha1', passphrase.encode(), salt, 50000, dklen=32)\n# Each config field is Base64(IV + AES-CBC(data))\nconfig_fields = {\n    \"Host\": \"\u003CENC_HOST>\",\n    \"Port\": \"\u003CENC_PORT>\",\n    \"Mutex\": \"\u003CENC_MUTEX>\",\n}\nfor name, enc in config_fields.items():\n    raw = base64.b64decode(enc)\n    iv, ct = raw[:16], raw[16:]\n    cipher = AES.new(key, AES.MODE_CBC, iv)\n    pt = cipher.decrypt(ct)\n    pt = pt[:-pt[-1]]  # PKCS7 unpad\n    print(f\"  {name}: {pt.decode()}\")\nEOF\n\n# QuasarRAT — config in Settings class, AES-encrypted\n# njRAT — config in plain text fields, base64-encoded\n# AgentTesla — SMTP exfil config in Settings resource\n```\n\n## 7. Behavioral Analysis with dnSpy\n\n```\n# dnSpy interactive workflow (Windows GUI):\n# 1. Load cleaned assembly: File → Open → \u003CTARGET>.cleaned.exe\n# 2. Set breakpoints on:\n#    - EntryPoint (Main method)\n#    - Any method calling WebClient\u002FHttpClient\n#    - Any method calling Process.Start\n#    - Any method calling Assembly.Load\n# 3. Debug → Start (F5) — dnSpy hosts the CLR\n# 4. Step through, watch locals for decrypted strings\u002FURLs\n# 5. Memory window: watch for in-memory PE headers (4D 5A)\n\n# Headless: dump method bodies via Mono.Cecil\npython3 \u003C\u003C 'EOF'\n# pip install dnfile\nimport dnfile\ndn = dnfile.dnPE(\"\u003CTARGET>.cleaned.exe\")\nfor row in dn.net.mdtables.MethodDef:\n    if row.ImplFlags.miIL:\n        print(f\"  Token 0x{row.row_index:08X}  {row.Name}  RVA={hex(row.RVA)}\")\nEOF\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| dnSpy | .NET debugger + decompiler (GUI) | github.com\u002FdnSpy\u002FdnSpy |\n| ILSpy \u002F ilspycmd | .NET decompiler (GUI + CLI) | github.com\u002Ficsharpcode\u002FILSpy |\n| de4dot | .NET de-obfuscator | github.com\u002Fde4dot\u002Fde4dot |\n| dotPeek | JetBrains .NET decompiler | jetbrains.com\u002Fdecompiler |\n| dnlib \u002F dnfile | .NET metadata parsing (Python\u002FC#) | pip install dnfile |\n| Mono.Cecil | .NET assembly manipulation | nuget Mono.Cecil |\n| NETReactorSlayer | .NET Reactor unpacker | github.com\u002FSychicBT\u002FNETReactorSlayer |\n| Detect It Easy | Packer\u002Fprotector identification | github.com\u002Fhorsicq\u002FDetect-It-Easy |\n| AsmResolver | .NET PE\u002Fmetadata library | github.com\u002FWashi1337\u002FAsmResolver |\n\n## Detection Signatures\n\n| Indicator | Description | Sigma\u002FYARA |\n|---|---|---|\n| `Assembly.Load(byte[])` | Reflective loading of in-memory .NET payload | YARA: `$s1 = \"Assembly\" ascii wide` + `$s2 = \"Load\" ascii wide` |\n| `FromBase64String` + `Assembly.Load` | Base64 decode → reflective load chain | Sigma: process_creation with CommandLine containing `-enc` |\n| `WebClient.DownloadString` | Stage 2 download via .NET HTTP client | Network: HTTP GET to non-standard port |\n| ConfuserEx metadata | `ConfusedBy` attribute in assembly | YARA: `$conf = \"ConfusedByAttribute\"` |\n| High entropy .text section | Packed\u002Fencrypted .NET payload | YARA: `math.entropy(0, filesize) > 7.0` |\n| `csc.exe` compilation at runtime | Dynamic code compilation via CodeDom | Sysmon: Event ID 1, process `csc.exe` with parent not devenv\u002Fmsbuild |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| de4dot crashes on sample | Try older de4dot fork, or manually patch anti-tamper (NOP the module cctor) |\n| Mixed mode assembly (native + managed) | Use dnSpy for managed parts, IDA\u002FGhidra for native stubs |\n| AOT\u002FNativeAOT compiled | Not a traditional .NET assembly — treat as native PE, use Ghidra |\n| .NET 5+ single-file bundle | Extract with `dotnet-dump` or manually parse bundle header at end of PE |\n| Heavily virtualized (KoiVM\u002FEazVM) | Use specialized devirtualizers: OldRod (KoiVM), EazFixer (Eazfuscator) |\n| Anti-debug in module initializer | Patch `\u003CModule>.cctor` or use dnSpy's \"Edit IL\" to NOP checks |\n| Resource encryption | Dump at runtime with dnSpy breakpoints on `ResourceManager.GetObject` |\n\n## Decision Gate\n\n```\nIF sample is .NET assembly (CLR header present):\n  → Run de4dot to identify + strip obfuscation\n  → Decompile with ILSpy\u002FdnSpy\n  → Extract configs for known RAT families\n  → Map behaviors to ATT&CK techniques\n  → Extract IOCs (C2, mutex, registry keys)\nELSE IF .NET single-file or AOT:\n  → Extract bundled assemblies first, then proceed above\nELSE:\n  → Not .NET — use reverser\u002Fmalware-triage or reverser\u002Fghidra\n```\n","# .NET Malware Analysis\n\nAnalyze .NET malware from initial triage through full decompilation, de-obfuscation, config extraction, and behavioral mapping.\n\n## Quick Reference\n\n```bash\n# Identify .NET assembly\nfile \u003CTARGET>\npython3 -c \"import pefile; pe=pefile.PE('\u003CTARGET>'); print('CLR:', pe.OPTIONAL_HEADER.DATA_DIRECTORY[14].VirtualAddress)\"\n\n# Fast metadata check\nmonodis --assembly \u003CTARGET>\nstrings -n 10 \u003CTARGET> | grep -iE 'System\\.Reflection|Assembly\\.Load|FromBase64|Invoke|WebClient|DownloadString'\n\n# De-obfuscate with de4dot\nde4dot \u003CTARGET> -o \u003CTARGET>.cleaned.exe\n\n# Decompile to C# project\nilspycmd -p -o .\u002Fdecompiled\u002F \u003CTARGET>\n\n# Extract embedded resources\npython3 -c \"\nimport dnfile\ndn = dnfile.dnPE('\u003CTARGET>')\nfor r in dn.net.resources:\n    print(f'{r.name}  offset={r.offset}  size={r.size}')\n\"\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| Software Packing | T1027.002 | ConfuserEx, .NET Reactor, SmartAssembly, Babel packing |\n| Deobfuscate\u002FDecode | T1140 | Base64 decode + Assembly.Load, XOR decryption of payloads |\n| PowerShell | T1059.001 | Cradle execution: `powershell -enc \u003Cbase64>` from managed code |\n| Obfuscated Files | T1027 | String encryption, control flow flattening, anti-tamper |\n| Reflective Code Loading | T1620 | Assembly.Load(byte[]) for in-memory stage loading |\n\n## 1. Identify .NET Assembly\n\nConfirm the sample is managed code before committing to .NET tooling.\n\n```bash\n# Check PE headers for CLR data directory (index 14)\npython3 \u003C\u003C 'EOF'\nimport pefile, sys\npe = pefile.PE(\"\u003CTARGET>\")\nclr_dir = pe.OPTIONAL_HEADER.DATA_DIRECTORY[14]\nif clr_dir.VirtualAddress > 0:\n    print(f\"[+] .NET assembly confirmed — CLR RVA: {hex(clr_dir.VirtualAddress)}\")\n    # Check runtime version\n    import struct\n    clr_offset = pe.get_offset_from_rva(clr_dir.VirtualAddress)\n    pe.__data__.seek(clr_offset + 8)\n    major, minor = struct.unpack('\u003CHH', pe.__data__.read(4))\n    print(f\"    Runtime: v{major}.{minor}\")\nelse:\n    print(\"[-] Not a .NET assembly\")\n    sys.exit(1)\nEOF\n\n# Alternative quick checks\nfile \u003CTARGET>                    # Look for \"Mono\u002F.Net assembly\"\nexiftool \u003CTARGET> | grep -i \"assembly\\|\\.net\\|framework\"\n```\n\n## 2. Detect Obfuscator\n\nIdentify what protection was applied before attempting decompilation.\n\n```bash\n# de4dot auto-detects most obfuscators\nde4dot --detect-only \u003CTARGET>\n# Output example: \"Detected .NET Reactor 6.x\"\n\n# Detect It Easy (DIE) for packer\u002Fprotector identification\ndiec \u003CTARGET>\n\n# Manual signature checks\nstrings \u003CTARGET> | grep -iE 'ConfuserEx|Reactor|SmartAssembly|Babel|Crypto Obfuscator|Dotfuscator|Eazfuscator|AgileDotNet'\n\n# Check for anti-tamper \u002F anti-debug module initializers\nmonodis --method \u003CTARGET> | grep -i \"cctor\\|InitializeComponent\\|Module\"\n\n# Entropy per section — high entropy in .text = packed\u002Fencrypted\npython3 \u003C\u003C 'EOF'\nimport pefile, math\npe = pefile.PE(\"\u003CTARGET>\")\nfor s in pe.sections:\n    data = s.get_data()\n    if len(data) == 0: continue\n    counts = [data.count(bytes([b])) for b in range(256)]\n    total = len(data)\n    ent = -sum((c\u002Ftotal)*math.log2(c\u002Ftotal) for c in counts if c)\n    name = s.Name.decode().rstrip('\\x00')\n    print(f\"  {name:10s}  entropy={ent:.2f}  {'PACKED' if ent > 7.2 else 'normal'}\")\nEOF\n```\n\n## 3. De-obfuscate\n\nStrip protections layer by layer.\n\n```bash\n# de4dot — handles ConfuserEx, .NET Reactor, SmartAssembly, Babel, etc.\nde4dot \u003CTARGET> -o \u003CTARGET>.cleaned.exe\n\n# If de4dot detects \"Unknown obfuscator\", try force mode:\nde4dot \u003CTARGET> --strtyp delegate --strtok 0x06000042 -o \u003CTARGET>.cleaned.exe\n\n# For ConfuserEx specifically:\n# 1. Remove anti-tamper first (patches module cctor)\nde4dot \u003CTARGET> --un-name \"!^\u003CModule>$&!^\u003C\" -o step1.exe\n# 2. Then full clean\nde4dot step1.exe -o \u003CTARGET>.cleaned.exe\n\n# For .NET Reactor:\n# Use .NET Reactor Slayer or NETReactorSlayer\nNETReactorSlayer.CLI \u003CTARGET>\n\n# Verify result decompiles cleanly\nilspycmd \u003CTARGET>.cleaned.exe | head -50\n```\n\n## 4. Decompile and Analyze\n\nFull source recovery from cleaned assembly.\n\n```bash\n# ILSpy command-line — full project decompilation\nilspycmd -p -o .\u002Fdecompiled\u002F \u003CTARGET>.cleaned.exe\n\n# Search decompiled source for key behaviors\ngrep -rn \"WebClient\\|HttpClient\\|WebRequest\" .\u002Fdecompiled\u002F\ngrep -rn \"Registry\\|RegistryKey\\|SetValue\" .\u002Fdecompiled\u002F\ngrep -rn \"Process\\.Start\\|ProcessStartInfo\" .\u002Fdecompiled\u002F\ngrep -rn \"Assembly\\.Load\\|Activator\\.CreateInstance\" .\u002Fdecompiled\u002F\ngrep -rn \"FromBase64String\\|Convert\\.FromBase64\" .\u002Fdecompiled\u002F\ngrep -rn \"RijndaelManaged\\|AesManaged\\|DES\\|TripleDES\\|RC4\" .\u002Fdecompiled\u002F\ngrep -rn \"Socket\\|TcpClient\\|NetworkStream\" .\u002Fdecompiled\u002F\ngrep -rn \"Clipboard\\|Screenshot\\|Keylog\\|GetAsyncKeyState\" .\u002Fdecompiled\u002F\n\n# Extract hardcoded C2 \u002F config\ngrep -rn \"http:\u002F\u002F\\|https:\u002F\u002F\\|ftp:\u002F\u002F\\|\\b[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\b\" .\u002Fdecompiled\u002F\n\n# Dump embedded resources (payloads, configs, second stages)\npython3 \u003C\u003C 'EOF'\nimport dnfile, os\ndn = dnfile.dnPE(\"\u003CTARGET>.cleaned.exe\")\nos.makedirs(\"resources\", exist_ok=True)\nfor res in dn.net.resources:\n    if hasattr(res, 'data') and res.data:\n        path = f\"resources\u002F{res.name}\"\n        open(path, 'wb').write(res.data)\n        print(f\"[+] Extracted: {path} ({len(res.data)} bytes)\")\nEOF\n```\n\n## 5. PowerShell Cradle Extraction\n\n.NET loaders frequently spawn encoded PowerShell.\n\n```bash\n# Find encoded PowerShell invocations in decompiled source\ngrep -rn \"\\-enc\\|\\-EncodedCommand\\|\\-e \" .\u002Fdecompiled\u002F\n\n# Decode base64 PowerShell payloads\npython3 \u003C\u003C 'EOF'\nimport base64, sys\nencoded = \"\u003CBASE64_PAYLOAD>\"\ndecoded = base64.b64decode(encoded).decode('utf-16-le')\nprint(decoded)\n# Write to file for further analysis\nwith open(\"decoded_ps.ps1\", \"w\") as f:\n    f.write(decoded)\nEOF\n\n# Look for staged downloads\ngrep -iE 'DownloadString|DownloadFile|DownloadData|Invoke-Expression|IEX|Net\\.WebClient' decoded_ps.ps1\n```\n\n## 6. Config Extraction for Known Families\n\n```bash\n# AsyncRAT config extraction\npython3 \u003C\u003C 'EOF'\nimport base64, hashlib\nfrom Crypto.Cipher import AES\n\n# AsyncRAT stores config as encrypted strings in Settings class\n# Key is derived from a hardcoded passphrase via PBKDF2\npassphrase = \"\u003CEXTRACTED_KEY>\"  # From Settings.Key in decompiled source\nsalt = b\"\u003CEXTRACTED_SALT>\"     # From Settings.aession\n\nkey = hashlib.pbkdf2_hmac('sha1', passphrase.encode(), salt, 50000, dklen=32)\n# Each config field is Base64(IV + AES-CBC(data))\nconfig_fields = {\n    \"Host\": \"\u003CENC_HOST>\",\n    \"Port\": \"\u003CENC_PORT>\",\n    \"Mutex\": \"\u003CENC_MUTEX>\",\n}\nfor name, enc in config_fields.items():\n    raw = base64.b64decode(enc)\n    iv, ct = raw[:16], raw[16:]\n    cipher = AES.new(key, AES.MODE_CBC, iv)\n    pt = cipher.decrypt(ct)\n    pt = pt[:-pt[-1]]  # PKCS7 unpad\n    print(f\"  {name}: {pt.decode()}\")\nEOF\n\n# QuasarRAT — config in Settings class, AES-encrypted\n# njRAT — config in plain text fields, base64-encoded\n# AgentTesla — SMTP exfil config in Settings resource\n```\n\n## 7. Behavioral Analysis with dnSpy\n\n```\n# dnSpy interactive workflow (Windows GUI):\n# 1. Load cleaned assembly: File → Open → \u003CTARGET>.cleaned.exe\n# 2. Set breakpoints on:\n#    - EntryPoint (Main method)\n#    - Any method calling WebClient\u002FHttpClient\n#    - Any method calling Process.Start\n#    - Any method calling Assembly.Load\n# 3. Debug → Start (F5) — dnSpy hosts the CLR\n# 4. Step through, watch locals for decrypted strings\u002FURLs\n# 5. Memory window: watch for in-memory PE headers (4D 5A)\n\n# Headless: dump method bodies via Mono.Cecil\npython3 \u003C\u003C 'EOF'\n# pip install dnfile\nimport dnfile\ndn = dnfile.dnPE(\"\u003CTARGET>.cleaned.exe\")\nfor row in dn.net.mdtables.MethodDef:\n    if row.ImplFlags.miIL:\n        print(f\"  Token 0x{row.row_index:08X}  {row.Name}  RVA={hex(row.RVA)}\")\nEOF\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| dnSpy | .NET debugger + decompiler (GUI) | github.com\u002FdnSpy\u002FdnSpy |\n| ILSpy \u002F ilspycmd | .NET decompiler (GUI + CLI) | github.com\u002Ficsharpcode\u002FILSpy |\n| de4dot | .NET de-obfuscator | github.com\u002Fde4dot\u002Fde4dot |\n| dotPeek | JetBrains .NET decompiler | jetbrains.com\u002Fdecompiler |\n| dnlib \u002F dnfile | .NET metadata parsing (Python\u002FC#) | pip install dnfile |\n| Mono.Cecil | .NET assembly manipulation | nuget Mono.Cecil |\n| NETReactorSlayer | .NET Reactor unpacker | github.com\u002FSychicBT\u002FNETReactorSlayer |\n| Detect It Easy | Packer\u002Fprotector identification | github.com\u002Fhorsicq\u002FDetect-It-Easy |\n| AsmResolver | .NET PE\u002Fmetadata library | github.com\u002FWashi1337\u002FAsmResolver |\n\n## Detection Signatures\n\n| Indicator | Description | Sigma\u002FYARA |\n|---|---|---|\n| `Assembly.Load(byte[])` | Reflective loading of in-memory .NET payload | YARA: `$s1 = \"Assembly\" ascii wide` + `$s2 = \"Load\" ascii wide` |\n| `FromBase64String` + `Assembly.Load` | Base64 decode → reflective load chain | Sigma: process_creation with CommandLine containing `-enc` |\n| `WebClient.DownloadString` | Stage 2 download via .NET HTTP client | Network: HTTP GET to non-standard port |\n| ConfuserEx metadata | `ConfusedBy` attribute in assembly | YARA: `$conf = \"ConfusedByAttribute\"` |\n| High entropy .text section | Packed\u002Fencrypted .NET payload | YARA: `math.entropy(0, filesize) > 7.0` |\n| `csc.exe` compilation at runtime | Dynamic code compilation via CodeDom | Sysmon: Event ID 1, process `csc.exe` with parent not devenv\u002Fmsbuild |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| de4dot crashes on sample | Try older de4dot fork, or manually patch anti-tamper (NOP the module cctor) |\n| Mixed mode assembly (native + managed) | Use dnSpy for managed parts, IDA\u002FGhidra for native stubs |\n| AOT\u002FNativeAOT compiled | Not a traditional .NET assembly — treat as native PE, use Ghidra |\n| .NET 5+ single-file bundle | Extract with `dotnet-dump` or manually parse bundle header at end of PE |\n| Heavily virtualized (KoiVM\u002FEazVM) | Use specialized devirtualizers: OldRod (KoiVM), EazFixer (Eazfuscator) |\n| Anti-debug in module initializer | Patch `\u003CModule>.cctor` or use dnSpy's \"Edit IL\" to NOP checks |\n| Resource encryption | Dump at runtime with dnSpy breakpoints on `ResourceManager.GetObject` |\n\n## Decision Gate\n\n```\nIF sample is .NET assembly (CLR header present):\n  → Run de4dot to identify + strip obfuscation\n  → Decompile with ILSpy\u002FdnSpy\n  → Extract configs for known RAT families\n  → Map behaviors to ATT&CK techniques\n  → Extract IOCs (C2, mutex, registry keys)\nELSE IF .NET single-file or AOT:\n  → Extract bundled assemblies first, then proceed above\nELSE:\n  → Not .NET — use reverser\u002Fmalware-triage or reverser\u002Fghidra\n```\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"tags":25,"subdomain":26,"when_to_use":27,"mitre_attack":28},".NET, malware, deobfuscation, dnSpy, ILSpy, de4dot","reverser","dotnet .net malware dnspy ilspy de4dot deobfuscate confuserex reactor obfuscation managed assembly csharp vbnet msil cil rat stealer loader","T1027.002, T1140, T1059.001","Bash Read Write","main","d6bfd87ad9f910cfff715da04c804638990a8538","packages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Fdotnet-malware",1,"https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto","2026-10-12 03:35:17",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add a18268941610-crypto\u002FDecepticon-shentou --skill reverser-dotnet-malware",{"tool":43,"command":44},"bunx","bunx skills add a18268941610-crypto\u002FDecepticon-shentou --skill reverser-dotnet-malware",{"tool":46,"command":47},"pnpm","pnpm dlx skills add a18268941610-crypto\u002FDecepticon-shentou --skill reverser-dotnet-malware","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Fdotnet-malware\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7EJXTEFYQPHY32431RWJENT","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7EJXHKBXYF3QSYNW5YSK10H","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7EJXAC5W1C1MACKKP1RRT8K","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7EJX02A5FFBM2V7VG52GNSK","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7EJWNRRMBRZQTKH3VFYAK58","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7EJWB0CC58R8Z4HW6YRQCZW","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002Fa18268941610-crypto\u002FDecepticon-shentou\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]