NtInitiatePowerAction
Requests the power manager to perform a system-wide power action (sleep, hibernate, shutdown, reboot).
Prototype
NTSTATUS NtInitiatePowerAction( POWER_ACTION SystemAction, SYSTEM_POWER_STATE MinSystemState, ULONG Flags, BOOLEAN Asynchronous );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| SystemAction | POWER_ACTION | in | Action to perform: Sleep, Hibernate, Shutdown, ShutdownReset, ShutdownOff, WarmEject, DisplayOff. |
| MinSystemState | SYSTEM_POWER_STATE | in | Minimum acceptable target state (PowerSystemWorking..PowerSystemShutdown). |
| Flags | ULONG | in | POWER_ACTION_* flags controlling policy: QUERY_ALLOWED, UI_ALLOWED, OVERRIDE_APPS, DISABLE_WAKES, CRITICAL. |
| Asynchronous | BOOLEAN | in | TRUE returns immediately; FALSE blocks until the action is fully arbitrated. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0xF1 | win10-1507 |
| Win10 1607 | 0xF5 | win10-1607 |
| Win10 1703 | 0xF8 | win10-1703 |
| Win10 1709 | 0xF9 | win10-1709 |
| Win10 1803 | 0xFA | win10-1803 |
| Win10 1809 | 0xFB | win10-1809 |
| Win10 1903 | 0xFC | win10-1903 |
| Win10 1909 | 0xFC | win10-1909 |
| Win10 2004 | 0x101 | win10-2004 |
| Win10 20H2 | 0x101 | win10-20h2 |
| Win10 21H1 | 0x101 | win10-21h1 |
| Win10 21H2 | 0x102 | win10-21h2 |
| Win10 22H2 | 0x102 | win10-22h2 |
| Win11 21H2 | 0x107 | win11-21h2 |
| Win11 22H2 | 0x108 | win11-22h2 |
| Win11 23H2 | 0x108 | win11-23h2 |
| Win11 24H2 | 0x10A | win11-24h2 |
| Server 2016 | 0xF5 | winserver-2016 |
| Server 2019 | 0xFB | winserver-2019 |
| Server 2022 | 0x106 | winserver-2022 |
| Server 2025 | 0x10A | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 0A 01 00 00 mov eax, 0x10A 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
Top-level power action entry point: `InitiatePowerActionW`, `SetSuspendState` (via powrprof.dll), `ExitWindowsEx` (for shutdown/reboot variants) and the Modern Standby fast-paths all route through here. Unlike `NtSetSystemPowerState`, this function goes through the **power policy manager**: it broadcasts WM_POWERBROADCAST / PBT_APMQUERYSUSPEND to running processes, honors `QUERY_ALLOWED` (i.e. apps can refuse), and only then delegates to `NtSetSystemPowerState` if the policy permits. Requires `SeShutdownPrivilege`. The `Asynchronous` parameter is the critical operational knob — async returns immediately and the caller cannot detect refusal; sync blocks until either the system resumes or a driver/app vetoes.
Common malware usage
**Ransomware post-encryption reboot** is the dominant abuse. Royal, BlackCat/ALPHV, Conti, LockBit 3.0 and BlackSuit all issue an InitiatePowerAction-class reboot after they finish writing the ransom note — the goal is to force users into the recovery-prompt or Windows RE screen, which reliably puts the ransom note on screen and prevents users from quickly rolling back via Volume Shadow Copies still in memory. **Wipers** (HermeticWiper, IsaacWiper, WhisperGate, CaddyWiper) similarly trigger a ShutdownReset to bring the box up with corrupted boot data. A smaller class of red-team loaders calls PowerActionSleep with `DISABLE_WAKES | CRITICAL` to evade short-lived sandbox sessions. Privilege requirement (SeShutdownPrivilege) is trivial for malware running as admin or LocalSystem, but for low-priv user code the privilege check fails — most ransomware ships a separate elevation primitive first.
Detection opportunities
Microsoft-Windows-Kernel-Power ETW provider emits structured events for every initiate-power-action: source process PID, action, flags, success/failure. Event log: System log Event ID 1074 records the initiating process for any user-initiated shutdown/reboot (clean), 6005/6006 record service-pack init, 6008 records dirty shutdowns. The most actionable behavioral rule: a process that issued >N file writes/modifies in the last 60 seconds and then calls a Shutdown/Reset class power action — that is a near-perfect ransomware indicator. SeShutdownPrivilege adjustment from a non-interactive token is itself unusual and worth alerting on. EDRs that hook ntdll see this call directly; direct-syscall variants bypass ntdll but still leave the ETW trace.
Direct syscall examples
asmx64 direct stub (Win11 24H2)
; Direct syscall stub for NtInitiatePowerAction (SSN 0x10A on Win11 24H2)
NtInitiatePowerAction PROC
mov r10, rcx ; syscall convention
mov eax, 10Ah ; SSN — varies per build
syscall
ret
NtInitiatePowerAction ENDPcRansomware post-encryption reboot
// Final step after the encryption pass and ransom-note drop.
// PowerActionShutdownReset = 6 (reboot), PowerSystemShutdown = 6.
// Flags = POWER_ACTION_DISABLE_WAKES | POWER_ACTION_CRITICAL
// | POWER_ACTION_OVERRIDE_APPS bypass app refusal.
#include <windows.h>
#include <winternl.h>
typedef NTSTATUS (NTAPI *pNtInitiatePowerAction)(ULONG, ULONG, ULONG, BOOLEAN);
VOID PostEncryptReboot(VOID) {
pNtInitiatePowerAction NtInitiatePowerAction = (pNtInitiatePowerAction)
GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtInitiatePowerAction");
// SeShutdownPrivilege assumed already enabled
NtInitiatePowerAction(
/* SystemAction */ 6,
/* MinSystemState */ 6,
/* Flags */ 0xC0010000, // CRITICAL | DISABLE_WAKES | OVERRIDE_APPS
/* Asynchronous */ FALSE);
}rustSandbox evasion via critical sleep
// Cargo: windows-sys = "0.59"
// Try to put the analysis VM into S3 sleep before the loader's real work runs.
// Async + DISABLE_WAKES prevents most sandbox harnesses from resuming it cleanly.
use windows_sys::Win32::Security::*;
use windows_sys::Win32::System::Threading::*;
use windows_sys::Win32::Foundation::*;
extern "system" {
fn NtInitiatePowerAction(action: u32, min_state: u32, flags: u32, asynch: u8) -> i32;
}
pub unsafe fn evade_via_sleep() -> i32 {
let mut tok: HANDLE = std::mem::zeroed();
OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &mut tok);
// (omitted: LookupPrivilegeValueW + AdjustTokenPrivileges for SeShutdownPrivilege)
// PowerActionSleep = 2, PowerSystemSleeping3 = 5
NtInitiatePowerAction(2, 5, 0x40000000 /* DISABLE_WAKES */, 1)
}MITRE ATT&CK mappings
Last verified: 2026-05-20