Hacking Tools

ConfuserEx2 String Decryptor – A Guide To Deobfuscating .NET Applications

ConfuserEx2 is the latest version from the Confuser family → An open-source, free protector for .NET applications.

ConfuserEx2_String_Decryptor deobfuscates constants protection, targeting string objects and char[] arrays.

This tool was tested on the vanilla version of ConfuserEx2 (ConfuserEx 1.6.0+-), but it should also handle some customized versions.

Description

ConfuserEx2_String_Decryptor is a simple C# console application that uses:

  • AsmResolver – .NET Assembly Manipulation (modification of IL code and metadata)
  • Harmony2 – Managed Hooking (to defeat some anti-checks)
  • .NET Reflection – Dynamic Invocation

The [Release] binaries are compiled for both win-x86 and win-x64 using .NET Framework 4.7.2.

Building On Windows

  • Install Visual Studio
  • Open .sln and restore NuGet packages (AsmResolver.DotNet, Lib.Harmony, etc.) → should be automatic if the NuGet URL is configured
  • Build – Release both x86, x64

Usage

Use on unpacked samples (Dumped – Passing Module Constructor)
ConfuserEx2_String_Decryptor.exe (32-bit) on 32-bit samples and (64-bit) on 64-bit samples
Drag&Drop or ConfuserEx2_String_Decryptor.exe <filepath>

ConfuserEx2 (1.6.0+-) Full Deobfuscation Guide

As a lot of malware devs, commodity malwares, and TAs are often using this obfuscator (avoiding older versions) to protect .NET samples, I put together some simple tools and steps that should help with deobfuscation.
This guide was tested on the vanilla version of ConfuserEx2, but it should also handle some simply customized versions.

Description

Most of these tools are based on well-known open-source libraries and use:

  • AsmResolver & dnlib – .NET Assembly Manipulation (modification of IL code and metadata)
  • Harmony2 – Managed Hooking (to defeat some anti-checks)
  • .NET Reflection – Dynamic Invocation
  • De4dot – CF deobfuscation and renaming (it is a different version than the original one)

The [Release] contains also all tools used in this guide “ConfuserEx2_Deobfuscate_Tools.7z

GUIDE – Steps

If the sample is packed (which means the IL code of the methods is not visible in tools like dnSpyEx), debug it and dump it from memory just after the module constructor execution is over, heading to the original entrypoint.

Preserve as much metadata as possible during the saving of the module from memory.

The original entrypoint is very often deleted from the .NET module metadata, so repair it in a tool like dnSpyEx.

Use the specific version of de4dot for CF cleaning and renaming.

de4dot.exe <filepath> -p crx

Use the string decryption tools (ConfuserEx2_String_Decryptor) → 32-bit version on 32-bit samples and 64-bit version on 64-bit samples.

Use the ProxyCall-Remover to get rid of proxy methods (should help to inline them).

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

10 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

10 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

2 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

3 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago