Developer knowledge network · moderated exchange

UnreliableCode 커뮤니티

개발자 연구, 리버스 엔지니어링 및 코딩 커뮤니티

Knowledge index살다
4Categories
919Threads
2.8K게시물
Guide

Creating stealthy system threads in kernel mode with PsCreateSystemThread [v2.4 Technical Discussion]

kernel_komrade
Driver Dev
MEMBER
대표: 145
가입 날짜: Feb 2019
게시물: 26
감사해요: 45
1개월 전 · Jul 11, 2026 9:38 PM
#1

How to spawn a background worker thread in ring0:

C
HANDLE hThread;
OBJECT_ATTRIBUTES objAttr;
InitializeObjectAttributes(&objAttr, NULL, OBJ_KERNEL_HANDLE, NULL, NULL);

NTSTATUS status = PsCreateSystemThread(
    &hThread,
    THREAD_ALL_ACCESS,
    &objAttr,
    NULL,
    NULL,
    (PKSTART_ROUTINE)KernelWorkerRoutine,
    NULL
);
if (NT_SUCCESS(status)) {
    ZwClose(hThread); // Close handle, thread continues running in system space
}

Ensure your worker routine checks a termination atomic flag before driver unload to avoid orphan thread crashes.

stack_smasher
Kernel Explorer
MEMBER
대표: 111
가입 날짜: Feb 2019
게시물: 30
감사해요: 18
1개월 전 · Jul 12, 2026 1:23 AM
#2

To avoid anti-cheat stack scanners flagging thread start addresses outside valid modules, consider hijacking a suspended thread in a legitimate system driver.

val_driver_guy
Driver Dev
MEMBER
대표: 42
가입 날짜: May 2019
게시물: 24
감사해요: 37
1개월 전 · Jul 12, 2026 12:26 PM
#3

Clean usage of OBJ_KERNEL_HANDLE.