在不使用 PInvoke 的情况下,从托管代码中动态调用任意未管理的代码。
Dynamic replacement for PInvoke on Windows. DInvoke contains powerful primitives that may be combined intelligently to dynamically invoke unmanaged code from disk or from memory with careful precision. This may be used for many purposes such as PE parsing, intelligent dynamic API resolution, dynamically loading PE plugins at runtime, process injection, and avoiding API hooks.
Features:
Conference talk (Staying # & Bringing Covert Injection Tradecraft to .NET): https://www.youtube.com/watch?v=FuxpMXTgV9s
Blog posts:
This project was originally created for SharpSploit (https://github.com/cobbr/SharpSploit). With permission from the author(s), it is now hosted here as a standalone library and NuGet.
NuGet: https://www.nuget.org/packages/DInvoke/
The example below demonstrates how to use DInvoke to dynamically find and call exports of a DLL.
…
In the example below, we first call OpenProcess normally using PInvoke. Then, we will call it in several ways using DInvoke to demonstrate that each mechanism successfully executes the unmanaged code and evades API hooks.
…
To test that this evaded hooks, we will use the tool API Monitor v2 to hook kernel32.dll!OpenProcess. Then we will run the demo through API Monitor. You may observe which of our calls to OpenProcess were caught in hooks by watching for those that are called with the PROCESS_ALL_ACCESS flag. As you will see, API Monitor successfully catches the API call when it is performed with PInvoke. However, it does NOT succeed when we use DInvoke or Manual Mapping. You may watch the video on Vimeo to see this in action.
SharpSploit: Bypassing API Hooks via DInvoke and Manual Mapping
暂无开放 Issues,或尚未同步最近议题。