EN | 中文
A kernel mode solution for detecting and preventing the creation of malicious threads in a target process on Windows.
- Detects malicious threads created in user mode that call
CreateRemoteThread
with a start address pointing toLoadLibraryA(W)
inkernel32.dll
orkernelbase.dll
. - Detects malicious threads created in kernel mode that call
ZwCreateThreadEx
with a start address pointing to a wild address allocated byZwAllocateVirtualMemory
. - Detects malicious threads created from either user mode or kernel mode with a start address pointing to an instruction jump point.
- Intercepts malicious thread creation by making it exit gracefully or forcefully.
- WDK 10.0.22621.2428 or higher
- Windows SDK 10.0.22621.2428 or higher.
- wdk-sys 0.3.0 or higher (installation instructions in windows-drivers-rs)
Note
This project demonstrates the detection and interception of malicious threads
using notepad.exe
. Users can implement more complex strategy rules to
filter the processes that need protection.
Some code in this project is adapted from BlackBone and has been ported to Rust.
- Compile and start this driver.
- Prepare a DLL for injection that performs an attention-grabbing action, such as displaying a message box.
- Use Process Hacker to inject the DLL into
notepad.exe
and check if the message box appears.
- Prepare your own driver for injection, typically by creating a remote thread in kernel mode during process creation callbacks.
- Prepare a DLL for injection.
- Compile and start this driver.
- Launch
notepad.exe
and verify if the message box appears.
rmtrd is licensed under the MIT License. Dependencies are under their respective licenses.