> Windows Syscalls
ntoskrnl.exeT1106T1497T1480

NtOpenEvent

Opens a handle to an existing named event object.

Prototype

NTSTATUS NtOpenEvent(
  PHANDLE            EventHandle,
  ACCESS_MASK        DesiredAccess,
  POBJECT_ATTRIBUTES ObjectAttributes
);

Arguments

NameTypeDirDescription
EventHandlePHANDLEoutReceives the handle to the existing event on success.
DesiredAccessACCESS_MASKinRequested access rights, e.g. EVENT_MODIFY_STATE | SYNCHRONIZE.
ObjectAttributesPOBJECT_ATTRIBUTESinMust specify the existing event name under \BaseNamedObjects (or a private namespace).

Syscall IDs by Windows version

Windows versionSyscall IDBuild
Win10 15070x40win10-1507
Win10 16070x40win10-1607
Win10 17030x40win10-1703
Win10 17090x40win10-1709
Win10 18030x40win10-1803
Win10 18090x40win10-1809
Win10 19030x40win10-1903
Win10 19090x40win10-1909
Win10 20040x40win10-2004
Win10 20H20x40win10-20h2
Win10 21H10x40win10-21h1
Win10 21H20x40win10-21h2
Win10 22H20x40win10-22h2
Win11 21H20x40win11-21h2
Win11 22H20x40win11-22h2
Win11 23H20x40win11-23h2
Win11 24H20x40win11-24h2
Server 20160x40winserver-2016
Server 20190x40winserver-2019
Server 20220x40winserver-2022
Server 20250x40winserver-2025

Kernel module

ntoskrnl.exeNtOpenEvent

Related APIs

OpenEventWOpenEventACreateEventWNtCreateEventNtSetEventNtWaitForSingleObject

Syscall stub

4C 8B D1            mov r10, rcx
B8 40 00 00 00      mov eax, 0x40
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

Opens an existing event object by name, returning STATUS_OBJECT_NAME_NOT_FOUND if the name has never been created. SSN `0x40` is stable across every shipped Win10/11 build. The lookup happens inside `ObOpenObjectByName` under the directory specified by `ObjectAttributes->RootDirectory` (typically `\BaseNamedObjects` or a per-session `\Sessions\<n>\BaseNamedObjects`). The returned handle is independent of the creator's lifetime — once both creator and opener close their handles, the kernel object is reaped.

Common malware usage

Cross-process implant coordination: a stager creates a named event then the persistent module opens it to know when to begin operating, or a watchdog opens the event to detect that the main payload is still alive. In named-pipe C2 (Brute Ratel, Sliver pivots), the server side opens the event the client signals when bytes are ready, avoiding busy-wait. Some loaders open a well-known event name as a kill-switch / sandbox probe — if the event exists, the analyst environment is detected (classic WannaCry-style guardrail, generalized).

Detection opportunities

By itself opening an event is high-volume and benign. The strong signal is opening events whose names match suspicious patterns (random GUIDs, family-known strings like `Global\Ekko*`, `Global\BR4*`), or opening an event in a process whose parent chain is not the creator. ETW `Microsoft-Windows-Kernel-Object` `OpenHandle` events expose this. EDRs that resolve `OBJECT_ATTRIBUTES.ObjectName` on every Nt* open call (rather than only Win32 layers) catch direct-syscall variants that bypass `OpenEventW` hooks.

Direct syscall examples

asmx64 direct stub

; Direct syscall stub for NtOpenEvent (SSN 0x40, stable across Win10/11)
NtOpenEvent PROC
    mov  r10, rcx          ; syscall convention
    mov  eax, 40h          ; SSN
    syscall
    ret
NtOpenEvent ENDP

cOpen a named event as IPC rendezvous

UNICODE_STRING name;
RtlInitUnicodeString(&name, L"\\BaseNamedObjects\\Global\\BeaconReady");
OBJECT_ATTRIBUTES oa;
InitializeObjectAttributes(&oa, &name, OBJ_CASE_INSENSITIVE, NULL, NULL);

HANDLE hEvent = NULL;
NTSTATUS st = NtOpenEvent(&hEvent, EVENT_MODIFY_STATE | SYNCHRONIZE, &oa);
if (st == STATUS_OBJECT_NAME_NOT_FOUND) {
    // creator side hasn't started yet
}

rustSandbox probe via OpenEvent

// Cargo: windows-sys = "0.59"
use windows_sys::Win32::System::Threading::{OpenEventW, EVENT_MODIFY_STATE};
use windows_sys::core::w;

unsafe fn looks_like_sandbox() -> bool {
    // Many analyst VMs pre-create well-known names; presence reveals instrumentation.
    !OpenEventW(EVENT_MODIFY_STATE, 0, w!("Global\\CuckooEventMutex")).is_null()
}

MITRE ATT&CK mappings

Last verified: 2026-05-20