线程池定时器进程注入

原文链接: https://mp.weixin.qq.com/s?__biz=MzAxMjYyMzkwOA==&mid=2247531828&idx=1&sn=4381a27123c22b6fb996e14610172733

线程池定时器进程注入

Ots安全 2025-07-18 02:34

线程池定时器进程注入

线程池定时器进程注入是一种利用 Windows 线程池执行 Shellcode 的技术。使用 CreateThreadpoolTimer 进行经典的 DLL 注入,使用合法的系统线程在内存中运行 Shellcode,这种技术非常隐蔽,而且很容易突破现代防御机制。

这种方法引入了一种隐秘的执行向量,避免了经典的 API 钩子(例如CreateRemoteThread、NtCreateThreadEx和 APC),这使得它对于红队操作和恶意软件研究极具吸引力。

🛠️ 技术实现

线程池定时器进程注入

🧩 核心组件

🛠
 主注入器(Injector.cpp)
– 进程枚举和目标逻辑

  • DLL 注入使用CreateRemoteThread和LoadLibraryW

  • 错误处理和执行状态报告

⏲ 定时器 DLL ( TimerDLL.cpp)
– 基于计时器的shellcode执行实现

  • TP_CALLBACK_ENVIRON线程池配置的结构设置

  • 通过定时器回调执行shellcode

📋 
API 序列

OpenProcess() // Access the target process
VirtualAllocEx() // Allocate memory in remote process 
WriteProcessMemory() // Write shellcode or DLL path
CreateRemoteThread() // Create a remote thread to execute payload
LoadLibraryW() // Load a DLL via thread execution


⏱️ ThreadPoolTimer-BasedAPIs

InitializeThreadpoolEnvironment() // Configure threadpool callback environment
CreateThreadpoolTimer() // Create a timer object
SetThreadpoolTimer() // Schedule the timer for execution
TimerCallback() // Callback function that executes shellcode

项目地址:

https://github.com/andreisss/Thread-Pool-Timer-Process-Injection

感谢您抽出

线程池定时器进程注入

.

线程池定时器进程注入

.

线程池定时器进程注入

来阅读本文

线程池定时器进程注入

点它,分享点赞在看都在这里