> Windows Syscalls
ntoskrnl.exeT1562.001T1106

NtTerminateJobObject

Terminates every process currently assigned to a job object atomically.

Prototype

NTSTATUS NtTerminateJobObject(
  HANDLE   JobHandle,
  NTSTATUS ExitStatus
);

Arguments

NameTypeDirDescription
JobHandleHANDLEinHandle to the job object, requiring JOB_OBJECT_TERMINATE access. All processes in the job — and in any nested child jobs — are killed.
ExitStatusNTSTATUSinExit code reported for every terminated process via GetExitCodeProcess.

Syscall IDs by Windows version

Windows versionSyscall IDBuild
Win10 15070x1A2win10-1507
Win10 16070x1ABwin10-1607
Win10 17030x1B1win10-1703
Win10 17090x1B5win10-1709
Win10 18030x1B7win10-1803
Win10 18090x1B8win10-1809
Win10 19030x1B9win10-1903
Win10 19090x1B9win10-1909
Win10 20040x1BFwin10-2004
Win10 20H20x1BFwin10-20h2
Win10 21H10x1BFwin10-21h1
Win10 21H20x1C1win10-21h2
Win10 22H20x1C1win10-22h2
Win11 21H20x1CBwin11-21h2
Win11 22H20x1CFwin11-22h2
Win11 23H20x1CFwin11-23h2
Win11 24H20x1D2win11-24h2
Server 20160x1ABwinserver-2016
Server 20190x1B8winserver-2019
Server 20220x1C7winserver-2022
Server 20250x1D2winserver-2025

Kernel module

ntoskrnl.exeNtTerminateJobObject

Related APIs

TerminateJobObjectNtTerminateProcessNtCreateJobObjectNtAssignProcessToJobObjectNtIsProcessInJob

Syscall stub

4C 8B D1            mov r10, rcx
B8 D2 01 00 00      mov eax, 0x1D2
F6 04 25 08 03 FE 7F 01   test byte ptr [0x7FFE0308], 1
75 03               jne short +3
0F 05               syscall
C3                  ret
CD 2E               int 2Eh
C3                  ret

Undocumented notes

NtTerminateJobObject is the kernel side of `TerminateJobObject`. The kernel walks the job's process list (under PspJobLock) and issues `PspTerminateProcess` against each, so the kill is effectively atomic from any single process's point of view — no race window in which a child can fork itself out. The SSN moves on every major release (`0x1B9` Win10 1903, `0x1BF` 2004, `0x1D2` Win11 24H2 / Server 2025), so dynamic resolution is mandatory for cross-build payloads. The flagship legitimate caller is the Chromium browser process recycling its renderer / GPU / utility jobs, and `cmd /c taskkill /T /F` on a process-tree root that lives inside a job.

Common malware usage

Comparatively rare in offensive tooling — most attackers prefer `NtTerminateProcess` against named EDR processes individually (Conti, LockBit, BlackCat all do this). Where NtTerminateJobObject *does* show up is in (1) anti-analysis ransomware that, once it has detected and obtained a handle to its Cuckoo / Joe Sandbox containing job, kills the entire sandbox cohort to disrupt artifact collection; (2) custom backdoors that wrap victim user-mode helpers in a job specifically so they can be torn down with a single syscall on uninstall; (3) red-team tooling that, having abused PROCESS_SET_QUOTA / JOB_OBJECT_ASSIGN_PROCESS to bring an EDR sensor into a controlled job, kills the whole job to bypass per-process self-protection. The technique is loud, easy to detect, and almost never seen in commodity loaders.

Detection opportunities

ETW `Microsoft-Windows-Kernel-Process/ProcessStop` will fire once per killed process with a shared, very-close-in-time timestamp cluster — the smoking gun for a job-wide termination versus a sequential `taskkill` loop. PsSetCreateProcessNotifyRoutineEx callbacks see the same pattern. Sysmon Event ID 5 (`ProcessTerminate`) lacks the terminating-PID field but the timing burst is still characteristic. High-fidelity rule: 5+ processes in the same job ending within a 50 ms window, terminated by a process not in their parent chain. EDR self-protection (PPL on `MsMpEng.exe`, the Defender protected-process flag on `MsSense.exe`) prevents NtTerminateJobObject from killing Defender / MDE even from SYSTEM — making this technique a known dead end against modern protected-process EDRs.

Direct syscall examples

asmx64 stub (Win11 24H2 SSN 0x1D2)

; Direct syscall stub for NtTerminateJobObject
NtTerminateJobObject PROC
    mov  r10, rcx          ; syscall convention
    mov  eax, 1D2h         ; SSN (Win11 24H2 / Server 2025)
    syscall
    ret
NtTerminateJobObject ENDP

cBrowser-style sandbox recycle

// Recycle a renderer cohort: open the named job we own and terminate it.
#include <windows.h>

DWORD RecycleSandbox(const wchar_t *job_name) {
    HANDLE h = OpenJobObjectW(JOB_OBJECT_TERMINATE, FALSE, job_name);
    if (!h) return GetLastError();
    DWORD err = 0;
    if (!TerminateJobObject(h, 0xDEAD0001))  // STATUS-style exit
        err = GetLastError();
    CloseHandle(h);
    return err;
}

cAnti-sandbox: tear down Cuckoo monitor cohort

// Hostile (defensive PoC): if we detect we're inside a sandbox job and
// can open a handle to it with TERMINATE rights, kill every sibling.
// In practice the monitor strips JOB_OBJECT_TERMINATE from descendants —
// this rarely works, hence why ransomware prefers per-process killing.
#include <windows.h>

typedef NTSTATUS (NTAPI *pNtTerminateJobObject)(HANDLE, NTSTATUS);

BOOL NukeContainingJob(void) {
    // Acquire a handle via OpenProcess + duplicating the job from a sibling
    // is a non-trivial dance; abbreviated here.
    HANDLE h_job = /* ... */ NULL;
    if (!h_job) return FALSE;
    pNtTerminateJobObject NtTerminateJobObject = (pNtTerminateJobObject)GetProcAddress(
        GetModuleHandleA("ntdll.dll"), "NtTerminateJobObject");
    return NtTerminateJobObject(h_job, 0) == 0;
}

MITRE ATT&CK mappings

Last verified: 2026-05-20