Skip to content
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
meltedinhex/analyzing-dotnet-malware-internalsMalware and ransomware analysis

analyzing-dotnet-malware-internals

⁨Reverses .NET/managed malware: decompiling MSIL back to C#, defeating common⁩

v1.0.03 installs+3 in 7 days24 StarsApache-2.0synced 10 hours ago

Install

No NotHoly CLI yet? Install it first.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install meltedinhex/analyzing-dotnet-malware-internals

Writes to ⁦~/.notholy/skills⁩ after checking the signature and the SHA-256.

SignatureSigned, ed25519
AzD6QYo/58…0eqigGAQ==The CLI checks the SHA-256 and the signature before it writes a file.
Packagea4a1eed8…b29a337d
a4a1eed8df18…753fb29a337d4 files · ⁦3.0 KB⁩
ScanMedium2 findings
  • Executable script shipped with the skillscripts/analyst.py
  • Links to outside domains
See the full scan
Sourcegithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/analyzing-dotnet-malware-internals@da7600a

When to Use

  • A sample is a managed (.NET) assembly — confirmed by a CLR header / mscoree import or BSJB metadata signature.
  • You need readable C# from MSIL and want to defeat .NET-specific obfuscation.
  • A loader uses reflection (Assembly.Load) to run an in-memory payload you must recover.

Do not use native disassembly workflows (Ghidra for x86) as the primary tool — managed code decompiles far more cleanly with a .NET decompiler.

Prerequisites

  • ILSpy / dnSpyEx for decompilation and (with dnSpyEx) managed debugging.
  • de4dot or equivalent for known protectors; familiarity with common .NET obfuscators.

Workflow

Step 1: Confirm it is managed

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

bash
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:

  • String encryption — a decryptor method called everywhere; run/trace it to recover plaintext (de4dot can often static-decrypt).
  • Control-flow flattening — follow the dispatcher state machine.
  • Proxy methods / renaming — rely on decompiler analysis rather than names.

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

  • Decompiled C# is coherent (named or recovered) and the entry path is traced.
  • Encrypted strings are recovered to plaintext.
  • The reflection-loaded stage is dumped and itself decompiles.

Pitfalls

  • Treating the loader as the payload — managed malware is frequently multi-stage.
  • Ignoring the module initializer where protectors install hooks.
  • Static-decrypting strings when the scheme is runtime-keyed; debug and dump instead.

References

  • See references/api-reference.md for the CLR identifier.
  • ECMA-335 and ILSpy (linked in frontmatter).

Files in this version

Permissions

PermissionDeclaredFound by the scan
Reads filesNoNo
Writes filesNoNo
Runs shell commandsYesYes
Uses the networkYesYes
Uses connectorsNoNo
Drives a browserNoNo

Scan findings

Reviewed on Nov 13, 2026

  1. MediumFile · Executable script shipped with the skillscripts/analyst.py
  2. InfoLink · Links to outside domains

A clean scan lowers the risk but does not prove a package is safe. Read what you install.

VersionPublishedCommitSHA-256SignaturePermission change
v1.0.0Nov 13, 2026da7600aa4a1eed8Signed–

Ask anything your scope allows.

Create an account, add credits and ask the first question in the chat or the terminal.

  1. 1/3

    Create the account

    Individual or company. You can switch to a company later without losing balance or keys.

    IndividualCompany
  2. 2/3

    Add credits

    By card. Pay per token, no subscription.

    $5.00minimum deposit
  3. 3/3

    Ask

    In the chat, or install the CLI and run notholy login in your terminal.

    $ notholy login