This is a native Rust implementation of the CLR hosting interfaces, in this case, only ICLRMetaHost
, ICLRRuntimeInfo
, ICLRRuntimeHost
and CLRCreateInstance
are imported.
This is Offensive Rust material, you could use this to inject managed code into an unmanaged process.
From Injecting .NET Assembly to an Unmanaged Process
At a high level, it works as follows:
CLRCreateInstance
is used to retrieve an interfaceICLRMetaHost
ICLRMetaHost->GetRuntime
is used to retrieveICLRRuntimeInfo
interface for a specified CLR versionICLRRuntimeInfo->GetInterface
is used to load the CLR into the current process and retrieve an interfaceICLRRuntimeHost
ICLRRuntimeHost->Start
is used to initialize the CLR into the current process
At this point, managed shellcode can be injected into the CLR-loaded process and executed.
cargo build --release