
DNCIは、Windowsのアンマネージプロセスにリモートで.NETコード(.exeまたは.dll)をインジェクションすることができます。
プロジェクトは以下のように構成されています。
Classic .NETコンソールアプリケーションをNotepad++にインジェクションする
この例では、InjectDemo.Console.ClassicNet .exeファイルを使用しています。 DNCI.Injector.Runner.exe --assemblyFile "<PATH_TO_FILE>\InjectDemo.Console.ClassicNet.exe" --className InjectDemo.Console.ClassicNet.Program --methodName EntryPoint --targetMode=processName --processName notepad++ --argument "OK BOY"
Classic .NETコンソールアプリケーションをプロセスID 66にインジェクションする
この例では、InjectDemo.Console.ClassicNet .exeファイルを使用しています。 DNCI.Injector.Runner.exe --assemblyFile "<PATH_TO_FILE>\InjectDemo.Console.ClassicNet.exe" --className InjectDemo.Console.ClassicNet.Program --methodName EntryPoint --targetMode=PID --pid 66 --argument "OK BOY"
Classic .NETコンソールアプリケーションを任意の実行中プロセスにインジェクションを試みる
この例では、InjectDemo.Console.ClassicNet .exeファイルを使用しています。 DNCI.Injector.Runner.exe --assemblyFile "<PATH_TO_FILE>\InjectDemo.Console.ClassicNet.exe" --className InjectDemo.Console.ClassicNet.Program --methodName EntryPoint --targetMode=BruteForce --argument "OK BOY"
インジェクションライブラリは、任意の.NETプログラムで使用できるように設計されています。実際、DNCIコマンドラインユーティリティはDNCIライブラリ自体を使用しています。
Classic .NETコンソールアプリケーションをリモートプロセスにインジェクションする
Injector.Library.InjectorConfiguration config = Injector.Library.InjectorConfigurationBuilder
.Instance()
.InjectThisClrBinary(@"<PATH_TO_BINARY>\InjectDemo.Console.ClassicNet.exe")
.ClrClassName("InjectDemo.Console.ClassicNet.Program")
.ClrMethodName("EntryPoint")
.WithArguments("OK - It Works Baby")
.InjectOnProcess("cmd") // Try to Inject on cmd process
.InjectOnProcess("chrome") // Try to Inject on chrome process
.InjectOnProcess("cmd.exe") // Try to Inject on cmd.exe process
.InjectOnProcess("calc") // Try to Inject on calc process
.InjectOnProcess("notepad++") // Try to Inject on notepad++ process
.Build();
Classic .NET DLLアプリケーションを利用可能な任意のプロセスにブルートフォースでインジェクションする
Injector.Library.InjectorConfiguration config = Injector.Library.InjectorConfigurationBuilder
.Instance()
.InjectThisClrBinary(@"<PATH_TO_BINARY>\InjectDemo.Dll.ClassicNet.dll")
.ClrClassName("InjectDemo.Dll.ClassicNet.Class1")
.ClrMethodName("EntryPoint")
.WithArguments("OK - It Works Baby")
.InjectWithBruteForce()
.Build();
// Create Injector Instance
DNCI.Injector.Library.Injector injector = new Library.Injector(configBuilderconfig);
// Execute the Injection
List<InjectorResult> result = injector.Run();
// Print Injection Result on Console
foreach (InjectorResult res in result)
{
Console.WriteLine(res);
}