Woman working with a laptop while drinking coffee at a cafe

Using de4dot to Analyze ASP.NET Core Applications Safely

ASP.NET Core applications are usually published as a set of DLLs, configuration files, and web assets, which can make analysis feel scattered at first. This guide shows using de4dot to analyze ASP.NET Core applications safely, from finding the right published assemblies to checking routes, views, and recovered code without running untrusted code.

The safest approach is to treat analysis as reading, not running. Clean a copy, inspect it in a decompiler, and keep the original published output untouched.

Start With the Published Output

An ASP.NET Core app is often published to a folder that contains the main DLL, runtime configuration, and supporting libraries. Start by listing that folder and identifying the main assembly, usually named after the project. Dependencies may be many, but you do not need to clean all of them at once.

Copy the published output into a working folder before you analyse it. This protects the original build and gives you a clean place to store cleaned files and notes.

Step 1: Identify the Main Assembly

Look for the DLL that contains the app startup, controllers, and routing. Shared framework files are usually less interesting at first, while the app assembly holds the custom logic you most likely need to review.

Record the assembly name, its dependencies, and any configuration files that explain connection strings, endpoints, or hosted services. Those details help you interpret the code you recover later.

Step 2: Clean a Copy With de4dot

If the assembly is protected, run de4dot on a copy and keep the original safe.

de4dot yourapp.dll

Check the output for warnings, then open the cleaned file in a decompiler. Confirm that controllers, services, and startup logic are readable before you draw conclusions.

Step 3: Map Routes and Endpoints

From the cleaned code, trace how requests are routed. Look for controller classes, route attributes, and middleware registration. Note which endpoints accept user input, which handle files or uploads, and which call external services.

This map is often more useful than reading code line by line. It shows the attack surface, the data flows, and the places where a closer review will pay off.

Step 4: Check Views, Models, and Data Handling

ASP.NET Core apps often separate views, models, and data access. After cleaning, check view-related code and model classes for validation, authorisation checks, and data handling. Pay attention to places where input is trusted too quickly, where secrets are stored in configuration, and where errors reveal internal details.

The same careful reading applies to desktop apps. For comparison, see the guide to analyzing WPF applications with de4dot, which covers a different kind of .NET user interface.

Step 5: Keep Analysis Safe

  • Work in a virtual machine or another isolated system for untrusted samples.
  • Do not run a cleaned web app on a public network or with real credentials.
  • Replace real connection strings and secrets with test values in your notes.
  • Keep cleaned files separate from original builds.
  • Record what was recovered and what remains unclear.

If a cleaned assembly will not open or a route is still unclear, do not guess. Note the gap, check dependencies, and compare with another tool. A clear record of uncertainty is part of good analysis.

Desktop and web apps share many deobfuscation habits, so it also helps to read the guide to analyzing WinForms applications safely with de4dot for a second perspective on safe analysis.

Frequently Asked Questions

Do I need to clean every DLL in an ASP.NET Core publish folder?

No. Start with the main application assembly, then clean dependencies only when their code is relevant to your review.

Can de4dot recover ASP.NET Core routes?

Often, yes, if the route attributes and controller logic survive protection. Cleaned code usually makes routing much easier to trace than the protected version.

Is it safe to run a cleaned ASP.NET Core app to test it?

Only in isolation, with test data and no real secrets. For most reviews, reading the code is safer than running the app.

What if views are stored as separate files?

Check the published views and static assets alongside the cleaned assembly. They can explain what a controller returns, even when the code alone is unclear.

What should I document after analysis?

Record the assembly checked, the endpoints found, the data flows observed, and any parts that could not be recovered. That record makes your findings useful to others.

Analysed this way, an ASP.NET Core application becomes a readable system: published files first, a safe clean second, routes and data handling next, and careful notes throughout.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top