Git Product home page Git Product logo

confuserex2_string_decryptor's Introduction

ConfuserEx2_String_Decryptor

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.

Warning

Run Only In VM - The deobfuscation is based on a dynamic approach using managed hooking and reflection.

ConfuserEx2 Websites

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>

BEFORE:


AFTER:

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.

Warning

Run These Tools Only In VM - Some of them are based on a dynamic approach using managed hooking and reflection.

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

  1. 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.

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

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

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

    de4dot.exe <filepath> -p crx
    
  5. Use the string decryption tools (ConfuserEx2_String_Decryptor) → 32-bit version on 32-bit samples and 64-bit version on 64-bit samples.

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

GUIDE - Video

[YouTube]

Something Not Working?

  1. Follow the video guide.
  2. Verify you successfully unpacked the protected sample - if it is packed (no IL code body or buggy decompilation in dnSpyEx) → debug the original sample/dll/loader to get over the module constructor of the protected sample → dump it from memory (dnSpyEx GUI).
  3. Make sure it is protected by ConfuserEx2 and not some super old version from the Confuser family or an absolutely different protector.

confuserex2_string_decryptor's People

Contributors

dump-guy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.