> Windows Syscalls
ntoskrnl.exeT1055.013T1027T1106

NtRollbackTransaction

Rolls back a KTM transaction, discarding every change made under it.

Prototype

NTSTATUS NtRollbackTransaction(
  HANDLE  TransactionHandle,
  BOOLEAN Wait
);

Arguments

NameTypeDirDescription
TransactionHandleHANDLEinHandle to the transaction to roll back. Must have TRANSACTION_ROLLBACK access.
WaitBOOLEANinTRUE blocks until rollback completes; FALSE returns STATUS_PENDING immediately.

Syscall IDs by Windows version

Windows versionSyscall IDBuild
Win10 15070x165win10-1507
Win10 16070x16Dwin10-1607
Win10 17030x173win10-1703
Win10 17090x176win10-1709
Win10 18030x178win10-1803
Win10 18090x179win10-1809
Win10 19030x17Awin10-1903
Win10 19090x17Awin10-1909
Win10 20040x180win10-2004
Win10 20H20x180win10-20h2
Win10 21H10x180win10-21h1
Win10 21H20x182win10-21h2
Win10 22H20x182win10-22h2
Win11 21H20x18Awin11-21h2
Win11 22H20x18Dwin11-22h2
Win11 23H20x18Dwin11-23h2
Win11 24H20x18Fwin11-24h2
Server 20160x16Dwinserver-2016
Server 20190x179winserver-2019
Server 20220x188winserver-2022
Server 20250x18Fwinserver-2025

Kernel module

ntoskrnl.exeNtRollbackTransaction

Related APIs

RollbackTransactionNtCreateTransactionNtCommitTransactionNtCreateSectionNtCreateProcessEx

Syscall stub

4C 8B D1            mov r10, rcx
B8 8F 01 00 00      mov eax, 0x18F     ; 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

Undocumented notes

Aborts the transaction at the KTM level. Every NTFS change performed under the transaction is reverted to its pre-transaction state by replaying the CLFS undo log. Crucially, **sections already created from a transacted file remain valid** — the kernel does not invalidate `SectionObject->ControlArea->FilePointer` mappings just because the underlying file was rolled back. This decoupling is the entire foundation of Process Doppelgänging.

Common malware usage

The closing move of canonical **Process Doppelgänging** (T1055.013). After the malicious payload has been written to a transacted file *and* a section has been created from it, the rollback discards the on-disk evidence. The on-disk file either disappears entirely or reverts to its pre-transaction content (often a copy of a clean Microsoft-signed binary), while the in-memory section — still backed by the malicious bytes — is used to spawn a process. From the kernel's process-creation perspective, the image file name still points at the clean reverted file: this defeats hash-based AV that scans the binary on disk and most signature-based product-image lookups. SynAck (2018), Osiris/Kronos banker variants and the original enSilo PoC all end the chain with this call.

Detection opportunities

ETW `Microsoft-Windows-Kernel-File` exposes transaction rollback events; correlating rollback events with section creations against the same `FileObject` is the highest-fidelity Doppelgänging hunt. Microsoft Defender for Endpoint added a behavioural detection for the create-write-section-rollback pattern after 2018. Independent detection vectors: compare `PEB->ProcessParameters->ImagePathName` content hash against the on-disk file at process-creation time; flag any mismatch. Kernel-mode callbacks on `PsSetCreateProcessNotifyRoutineEx` receive `CREATE_PROCESS_NOTIFY_INFO->FileObject`, which still points at the transacted (now rolled-back) file — the file's `FileObject->SectionObjectPointer->ImageSectionObject` may already be detached, which is itself anomalous.

Direct syscall examples

cDoppelgänging finisher

// Final step of Process Doppelgänging — section is already created.
// After this call, the on-disk file is restored, but hSection still maps payload.

NTSTATUS s = NtRollbackTransaction(hTransaction, /*Wait=*/ TRUE);
if (!NT_SUCCESS(s)) return s;

NtClose(hTransactedFile);
NtClose(hTransaction);

// Spawn process from the orphaned section.
HANDLE hProcess = NULL;
NtCreateProcessEx(
    &hProcess,
    PROCESS_ALL_ACCESS,
    NULL,
    NtCurrentProcess(),
    PROCESS_CREATE_FLAGS_INHERIT_HANDLES,
    hSection,
    NULL, NULL, FALSE);

asmx64 direct stub (Win11 24H2)

; NtRollbackTransaction direct stub — SSN 0x18F on Win11 24H2
NtRollbackTransaction PROC
    mov  r10, rcx
    mov  eax, 18Fh
    syscall
    ret
NtRollbackTransaction ENDP

rustRollback via ntapi crate

use ntapi::ntxcapi::NtRollbackTransaction;
use winapi::shared::ntdef::HANDLE;

unsafe fn rollback(tx: HANDLE) {
    let status = NtRollbackTransaction(tx, 1 /* TRUE */);
    assert!(status >= 0, "rollback failed: 0x{:X}", status);
}

MITRE ATT&CK mappings

Last verified: 2026-05-20