NtOpenTransaction
Opens an existing KTM transaction object by name or unit-of-work GUID.
Prototype
NTSTATUS NtOpenTransaction( PHANDLE TransactionHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, LPGUID Uow, HANDLE TmHandle );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| TransactionHandle | PHANDLE | out | Receives a handle to the opened transaction. |
| DesiredAccess | ACCESS_MASK | in | Requested access rights (TRANSACTION_QUERY_INFORMATION, TRANSACTION_COMMIT, TRANSACTION_ROLLBACK, …). |
| ObjectAttributes | POBJECT_ATTRIBUTES | in | Object attributes containing the transaction object name (when opening by name). |
| Uow | LPGUID | in | Optional unit-of-work GUID used when ObjectAttributes->ObjectName is NULL. |
| TmHandle | HANDLE | in | Optional handle to the Transaction Manager that hosts the transaction. NULL = default TM. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0x11B | win10-1507 |
| Win10 1607 | 0x121 | win10-1607 |
| Win10 1703 | 0x125 | win10-1703 |
| Win10 1709 | 0x127 | win10-1709 |
| Win10 1803 | 0x129 | win10-1803 |
| Win10 1809 | 0x12A | win10-1809 |
| Win10 1903 | 0x12B | win10-1903 |
| Win10 1909 | 0x12B | win10-1909 |
| Win10 2004 | 0x130 | win10-2004 |
| Win10 20H2 | 0x130 | win10-20h2 |
| Win10 21H1 | 0x130 | win10-21h1 |
| Win10 21H2 | 0x131 | win10-21h2 |
| Win10 22H2 | 0x131 | win10-22h2 |
| Win11 21H2 | 0x137 | win11-21h2 |
| Win11 22H2 | 0x139 | win11-22h2 |
| Win11 23H2 | 0x139 | win11-23h2 |
| Win11 24H2 | 0x13B | win11-24h2 |
| Server 2016 | 0x121 | winserver-2016 |
| Server 2019 | 0x12A | winserver-2019 |
| Server 2022 | 0x136 | winserver-2022 |
| Server 2025 | 0x13B | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 3B 01 00 00 mov eax, 0x13B ; 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
Counterpart to `NtCreateTransaction`. The transaction can be opened either by name (when the creator placed it in `\BaseNamedObjects` or another directory) or by UoW GUID — every KTM transaction has a globally-unique unit-of-work GUID enrolled with the Transaction Manager. Once opened, the handle can be used to enlist further resource managers, query state via `NtQueryInformationTransaction`, or to commit/rollback if access was requested.
Common malware usage
Less central than `NtCreateTransaction` for Process Doppelgänging, but useful in multi-stage chains where one component creates the transaction (e.g. a service-context loader) and another stage opens it by UoW GUID to perform the rollback after the section has been created in a different process. Also appears in inter-process Doppelgänging variants where the dropper hands the UoW GUID to a child via IPC, lets the child reopen the transaction, and only then triggers rollback — this splits the suspicious sequence across two PIDs and defeats simple per-process detections.
Detection opportunities
Same telemetry surface as `NtCreateTransaction` — `Microsoft-Windows-Kernel-File` and `Microsoft-Windows-TxF` ETW providers. Specifically watch for unrelated processes opening the *same* UoW GUID within a short window: legitimate transactional apps (SQL Server, NTFS journaling) almost never span the create-open-rollback sequence across unrelated PIDs. Listing `\BaseNamedObjects` with WinObj will reveal named transactions, but most attacker-created transactions are unnamed and rely on UoW GUIDs.
Direct syscall examples
cOpen by UoW GUID
// Open an existing transaction by its unit-of-work GUID.
GUID uow = { /* received via IPC from the creator */ };
HANDLE hTx = NULL;
OBJECT_ATTRIBUTES oa = { sizeof(oa) };
NTSTATUS s = NtOpenTransaction(
&hTx,
TRANSACTION_COMMIT | TRANSACTION_ROLLBACK,
&oa,
&uow,
NULL);
if (NT_SUCCESS(s)) {
// Take ownership of the transaction — commit or rollback as needed.
NtRollbackTransaction(hTx, TRUE);
NtClose(hTx);
}asmx64 direct stub (Win11 24H2)
; NtOpenTransaction direct stub — SSN 0x13B on Win11 24H2
NtOpenTransaction PROC
mov r10, rcx
mov eax, 13Bh
syscall
ret
NtOpenTransaction ENDPrustOpen via ntapi crate
use ntapi::ntxcapi::NtOpenTransaction;
use winapi::shared::guiddef::GUID;
use winapi::shared::ntdef::{HANDLE, OBJECT_ATTRIBUTES};
use std::{mem, ptr::null_mut};
unsafe fn open_by_uow(mut uow: GUID) -> HANDLE {
let mut h: HANDLE = null_mut();
let mut oa: OBJECT_ATTRIBUTES = mem::zeroed();
oa.Length = mem::size_of::<OBJECT_ATTRIBUTES>() as u32;
let s = NtOpenTransaction(&mut h, 0x0008 | 0x0010, &mut oa, &mut uow, null_mut());
assert!(s >= 0);
h
}MITRE ATT&CK mappings
Last verified: 2026-05-20