Toolset and Libraries for reflectively running/bootstrapping managed code from unmanaged code using the .NET Framework. There are three techniques represented here:
- CLRHosting: Load Assemblies using Microsoft's official Unmanaged CLR Hosting APIs.
- DemoAssembly: A demo EXE and DLL used for testing
- DemoLoad: A simple program for loading DLLs with LoadLibraryA. For testing
DllMain
and exported functions. - MixedAssembly: Load Assemblies using C++/CLI, a version of C++ that can mix both unmanaged machine code and managed MSIL code on a per-module or even per-function basis.
- Shellcode: Various PICs or tools (some are just links) for injecting .NET Assemblies through native shellcode.
Additionally, the DemoAssembly project is provided that includes an Assembly that pops up a command prompt. This can be used as an easy test payload. It is provided in both DLL and EXE format.
The DemoLoad project is a simple program that loads a DLL through LoadLibrary. It is useful for testing a generated DLL payload.
The capability to load managed code from unmanaged code can serve many purposes. However, from the perspective of a red-teamer, this represents the ability to inject .NET code into arbitrary Windows processes. It can also provide a more Op-Sec friendly way of crafting stagers for .NET Assemblies that does not rely upon putting easily reversable managed code onto disk.