NtDebugContinue
Setzt einen Debuggee-Thread nach einem Debug-Event mit gegebenem NTSTATUS-Continue-Code fort.
Prototyp
NTSTATUS NtDebugContinue( HANDLE DebugObjectHandle, PCLIENT_ID DebuggeeId, NTSTATUS ContinueStatus );
Argumente
| Name | Type | Dir | Description |
|---|---|---|---|
| DebugObjectHandle | HANDLE | in | Handle auf das Debug-Object, das das ursprüngliche Event geliefert hat. |
| DebuggeeId | PCLIENT_ID | in | ClientId (UniqueProcess + UniqueThread) des fortzusetzenden Debuggee-Threads — meist aus DBGUI_WAIT_STATE_CHANGE.AppClientId kopiert. |
| ContinueStatus | NTSTATUS | in | DBG_CONTINUE (0x00010002), DBG_EXCEPTION_NOT_HANDLED (0x80010001) oder DBG_REPLY_LATER. |
Syscall-IDs pro Windows-Version
| Windows-Version | Syscall-ID | Build |
|---|---|---|
| Win10 1507 | 0xC0 | win10-1507 |
| Win10 1607 | 0xC3 | win10-1607 |
| Win10 1703 | 0xC6 | win10-1703 |
| Win10 1709 | 0xC7 | win10-1709 |
| Win10 1803 | 0xC8 | win10-1803 |
| Win10 1809 | 0xC9 | win10-1809 |
| Win10 1903 | 0xCA | win10-1903 |
| Win10 1909 | 0xCA | win10-1909 |
| Win10 2004 | 0xCE | win10-2004 |
| Win10 20H2 | 0xCE | win10-20h2 |
| Win10 21H1 | 0xCE | win10-21h1 |
| Win10 21H2 | 0xCF | win10-21h2 |
| Win10 22H2 | 0xCF | win10-22h2 |
| Win11 21H2 | 0xD4 | win11-21h2 |
| Win11 22H2 | 0xD5 | win11-22h2 |
| Win11 23H2 | 0xD5 | win11-23h2 |
| Win11 24H2 | 0xD7 | win11-24h2 |
| Server 2016 | 0xC3 | winserver-2016 |
| Server 2019 | 0xC9 | winserver-2019 |
| Server 2022 | 0xD3 | winserver-2022 |
| Server 2025 | 0xD7 | winserver-2025 |
Kernel-Modul
Verwandte APIs
Syscall-Stub
4C 8B D1 mov r10, rcx B8 D7 00 00 00 mov eax, 0xD7 ; Win11 24H2 SSN 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
Undokumentierte Hinweise
Das Komplement zu `NtWaitForDebugEvent` — jedes vom Wait gelieferte Event muss bestätigt werden, sonst bleibt der Debuggee-Thread auf unbestimmte Zeit eingefroren. `DBG_CONTINUE` sagt „Ich habe das behandelt, keine Exception entkommt zum SEH des Debuggee"; `DBG_EXCEPTION_NOT_HANDLED` sagt „SEH im Debuggee abwickeln lassen"; das weniger bekannte `DBG_REPLY_LATER` (Win10 1607+) verschiebt den Ack, sodass ein Debugger mehrere Events sammeln kann, ohne zwischenliegende Threads zu blockieren. Der `ClientId`-Parameter macht dies thread-granular — ein Multi-Thread-Debuggee kann einen Thread fortsetzen lassen, während andere geparkt bleiben.
Häufige Malware-Nutzung
Immer mit `NtWaitForDebugEvent` gepaart. Im Self-Debug-Anti-Attach-Muster antwortet die Schleife systematisch `DBG_CONTINUE` auf *jede* Exception, was den Debuggee gegen standardmäßige Analysten-Tricks (`int 3` im Code platziert, `__debugbreak`, `RaiseException(0x80000003)`) immun macht — diese würden normalerweise in einem angehängten externen Debugger auftauchen, werden hier aber lautlos vom Self-Debugger geschluckt. Eine raffiniertere Variante inspiziert das Event, prüft, ob die Exception eine vom Implant selbst ausgelöste ist (z. B. ein stego'd `int 3`, dessen Adresse einer bekannten Anti-Debug-Prüfung entspricht), und antwortet selektiv `DBG_CONTINUE` vs `DBG_EXCEPTION_NOT_HANDLED`, um den Debuggee glauben zu lassen, dass kein Debugger anwesend ist (der `IsDebuggerPresent`/PEB.BeingDebugged-Pfad bleibt sauber, weil der *externe* Debugger nie angehängt hat).
Erkennungsmöglichkeiten
`NtDebugContinue` allein ist laut — jeder laufende Debugger ruft ihn ständig. Der Detection-Wert liegt im Eltern-Kontext: ein Prozess mit `EPROCESS.DebugPort != NULL`, der zugleich selbst der Debugger ist (sein Thread hält das Debug-Object-Handle), wobei der Debuggee *er selbst* oder ein Kind ist. Kombiniert mit `NtCreateDebugObject` + `NtDebugActiveProcess(NtCurrentProcess())` ist das die Self-Debug-Anti-Attach-Signatur. ETW Microsoft-Windows-Kernel-Process zeigt Debug-Port-Übergänge.
Direkte Syscall-Beispiele
cContinue every event silently
// Inside the self-debug loop, after NtWaitForDebugEvent returned `sc`.
NTSTATUS status = (sc.NewState == DbgExceptionStateChange)
? DBG_CONTINUE // swallow ALL exceptions silently
: DBG_CONTINUE; // and pass non-exception events through
NtDebugContinue(hDbg, &sc.AppClientId, status);cSelective forwarding (smarter anti-debug)
// Only swallow our own planted int3s; let other exceptions surface to the debuggee.
if (sc.NewState == DbgExceptionStateChange) {
PVOID pc = (PVOID)sc.StateInfo.Exception.ExceptionRecord.ExceptionAddress;
NTSTATUS code = sc.StateInfo.Exception.ExceptionRecord.ExceptionCode;
NTSTATUS reply;
if (code == STATUS_BREAKPOINT && IsOurAntiDebugProbe(pc)) {
reply = DBG_CONTINUE; // hide it from any SEH check
} else {
reply = DBG_EXCEPTION_NOT_HANDLED; // let the debuggee see/handle it
}
NtDebugContinue(hDbg, &sc.AppClientId, reply);
} else {
NtDebugContinue(hDbg, &sc.AppClientId, DBG_CONTINUE);
}asmx64 direct stub
; NtDebugContinue direct syscall (Win11 24H2 SSN 0xD7)
NtDebugContinue PROC
mov r10, rcx
mov eax, 0D7h
syscall
ret
NtDebugContinue ENDPMITRE ATT&CK-Mappings
Last verified: 2026-05-20