最近在学习dll劫持,一些原理上的东西参见 https://payloads.online/archivers/2018-06-09/1,我这里具体写下发现wegame dll劫持的步骤。
首先是准备工作,即两款工具:
pressmonitor:
https://download.sysinternals.com/files/ProcessMonitor.zip
dll_hijacker.py:
https://raw.githubusercontent.com/zhaoed/DLL_Hijacker/master/DLL_Hijacker.py
下面是正式步骤:
process monitor的filter规则如图,即仅显示tgp_daemon进程加载dll过程。

可以看到进程先在其安装目录E:\Wegame\没有找到winmmase.dll,然后再c:\windows\syswow64中找到了该dll,所以我们可以直接在E:\Wegame放入我们自定义的同名dll,就达到了dll劫持的效果。但是为了不影响原程序的运行,我们需要让程序先执行了我们的dll,再执行原本的dll。这里就用到了dll_hijacker.py



将生成的cpp内容放入vc的dll工程中,并修改几个地方:
1.vc6环境需添加#include "stdafx.h"
2将Hijack函数改为自己想执行的操作,systemm函数需要#include <stdlib.h>

3.修改需要调用的原版dll名,并放入E:\Wegame\,注意需要把原dll的mui文件一起放入,否则将会报错


效果:

网友评论