Analyzing dotnet malware internals

From meltedinhex/analyst-ai-pack · View interactive version

Analyzing dotnet malware internals is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. Reverses .NET/managed malware: decompiling MSIL back to C#, defeating common .NET protectors and string encryptors, and tracing reflection-based loaders to recover the real payload. Activates for requests to analyze a .NET sample, decompile MSIL, or unpack a managed loader.

How to use this skill

Skill file

Analyzing .NET Malware Internals

When to Use

BSJB metadata signature.

Do not use native disassembly workflows (Ghidra for x86) as the primary tool — managed

code decompiles far more cleanly with a .NET decompiler.

Prerequisites

Workflow

Step 1: Confirm it is managed

Check for the CLR runtime header and the BSJB metadata magic:

python scripts/analyst.py identify sample.exe

Step 2: Decompile

Open in ILSpy/dnSpyEx and review the entry point, Main, and module initializer

(<Module>.cctor), which protectors often abuse.

Step 3: Handle obfuscation

Recognize and undo common schemes:

plaintext (de4dot can often static-decrypt).

Step 4: Trace reflection loaders

Find Assembly.Load(byte[]) / Activator.CreateInstance; dump the byte array argument at

runtime (managed debugger breakpoint) to recover the real second-stage assembly, then recurse.

Step 5: Analyze the payload

Decompile the recovered stage; extract C2, configuration, and capabilities for the report.

Validation

Pitfalls

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.