Reflective dll injection(nim 学习系列)

Reflective dll injection(nim 学习系列)

ImprovedReflectiveDLLInjection

将项目 https://github.com/dismantl/ImprovedReflectiveDLLInjection 下载回本地,我使用 Visual Studio 2019 打开 rdi.sln,编译成 Release 版,即可生成 inject.exe 和 reflective_dll.dll。

截图

启动一个 powershell.exe 进程用于测试,可以看到 PID 是 1764。

截图

尝试注入,inject.x64.exe test 1764 或者 inject.x64.exe test 1764 reflective_dll.x64.dll (指定某个dll)

截图

成功弹窗,“test”字符串也传递过去了。

截图

截图

NimRDI

以上是C语言版本的实现,而 NimRDI 则通过Compile pragma 编译并链接他人项目的C语言源文件,间接实现了nim版本的RDI。

编译命令:

nim c -d:release --app:lib --cpu:amd64 --nomain -o:"reflective_dll.x64.dll" rdi.nim

然后用上一步生成的 inject.x64.exe 注入目标进程即可。

inject.x64.exe Moriarty 1764

引用

https://github.com/Moriarty2016/NimRDI

https://github.com/dismantl/ImprovedReflectiveDLLInjection
From: https://www.cnblogs.com/StudyCat/p/14494523.html

posted @ 2021-03-07 14:21  StudyCat  阅读(471)  评论(0编辑  收藏  举报