Can't Wait to Shut You Down — Remote DoS Using Wininit.exe
A security check in the WindowsShutdown RPC interface could be bypassed because the RPC runtime caches a successful call to an unrestricted function, allowing any authenticated user to remotely shut down a Windows machine.
Published on akamai.com
Client-Side Protection & Compliance
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Wininit is a critical Windows process that participates in both the start up and the shut down of the operating system. If it crashes, the whole system crashes. Because of that role, it exposes several RPC interfaces that implement shutdown functionality, and some of them are documented. The vulnerability described here lives in the WindowsShutdown interface.

WindowsShutdown is one of the few RPC interfaces exposed by Wininit and is responsible for the shutdown process. Its UUID is d95afe70-a6d5-4259-822e-2c84da1ddb0d. It is part of MS-RSP (Remote Shutdown Protocol) and exposes three functions: WsdrInitiateShutdown, WsdrAbortShutdown and WsdrCheckForHiberboot.

Looking at the public IDL file, only WsdrInitiateShutdown and WsdrAbortShutdown are documented. The undocumented function is the one that matters here.
Setup
The work was done with the author's RPC toolkit, published in the akamai-security-research repository, and a proof of concept for the vulnerability is provided in the PoCs/cve-2022-44707 directory of the same repository. The attack requires an authenticated remote user: the goal is to reach the shutdown functions over RPC from another machine. The callback allows only the ALPC or TCP transports and only the authentication level RPC_C_AUTHN_LEVEL_PKT_PRIVACY.
The vulnerability affects all unpatched Windows versions starting with Windows 8/Server 2012. It was responsibly disclosed to MSRC in August (late August, per the closing note) and patched as part of December 2022 Patch Tuesday. It is tracked as CVE-2022-44707 with a CVSS score of 6.5.
Finding it
The starting point is the security callback registered for the WindowsShutdown interface. The callback first checks the transport protocol and allows only ALPC or TCP. It then checks the authentication level and allows only RPC_C_AUTHN_LEVEL_PKT_PRIVACY. Finally, if the called function is not WsdrCheckForHiberboot, it checks the remote calling user's token by comparing it with a well-known SID saved in a global variable created during WinInit's initialization: SECURITY_NETWORK_RID.

Calls to WsdrCheckForHiberboot are not restricted at all by the security callback. That asymmetry is the opening: the interface is registered with the default cache behaviour, so a successful call to WsdrCheckForHiberboot should produce a cached successful result that lets subsequent calls to WsdrInitiateShutdown and WsdrAbortShutdown bypass the SID check. This is the RPC caching mechanism the author had researched previously.
The remaining problem is calling WsdrCheckForHiberboot correctly. The function is undocumented, so its signature has to be reconstructed. The only documented RPC client found for it is the advapi CheckForHiberboot, which takes two arguments: a Boolean pointer and a Boolean.

Exploitation
Step 1: recreate the function definition from the advapi client
Using the two arguments of the advapi client, the author recreated the function definition in an IDL file and compiled a client and program. Calling the function remotely with that client fails: the RPC runtime reports that the function is being called incorrectly by returning an RPC stub error.

Step 2: read the ProcFormatString
Rather than guessing further, the author parsed the interface stub's ProcFormatString. This is a long binary string that describes the argument types and return values for all functions exposed by the interface, and the RPC runtime uses it while marshaling and unmarshaling calls, which is the process that produced the stub error. Parsing it manually revealed an additional argument the function expects, of type wchar_t*.

The figure shows the section of the ProcFormatString for WsdrCheckForHiberboot with the author's comments on each part.
Step 3: call WsdrCheckForHiberboot
With the extra argument added to the definition, the call succeeds: CheckForHiberboot returns, and the cached result is in place.
Step 4: call the shutdown functions
With the cache primed, both WsdrInitiateShutdown and WsdrAbortShutdown can be called. No guesswork is needed for these: the function definition is documented in the IDL file, and the flags they expect are documented under the advapi function InitiateShutdownA. Using the flag combination of SHUTDOWN_GRACE_OVERRIDE, SHUTDOWN_HYBRID and SHUTDOWN_FORCE_OTHERS forces an immediate shutdown.
That completes the chain: bypass the security callback and its SID check, then shut the machine down remotely.
Root cause
The interface is registered with the default cache behaviour, and the security callback exempts WsdrCheckForHiberboot from the token check entirely. A successful call to that one function therefore caches a successful result for the interface, which would allow later calls to the shutdown functions to bypass the SID check.
Technically this is an escalation of privilege, since it lets any authenticated user call WsdrInitiateShutdown remotely instead of only those allowed under SECURITY_NETWORK_RID. Because the only outcome reachable through this interface is a shutdown, it was categorised as a denial-of-service vulnerability instead.
Impact
An authenticated remote attacker can stop or initiate shutdowns on a target Windows machine, bypassing the SID check that is supposed to limit the shutdown functions to SECURITY_NETWORK_RID. The author is explicit that the vulnerability is not critical: it is just a remote shutdown, and not even an unauthenticated one. All unpatched Windows versions from Windows 8/Server 2012 onwards are affected.
Fix
Microsoft patched the vulnerability in December 2022 Patch Tuesday. The report does not describe the code change. For detection, the author provides an OSQuery that flags unpatched, and therefore vulnerable, versions of Wininit.exe; Akamai Guardicore Segmentation customers can combine it with the Insight feature to search for vulnerable assets.
WITH product_version AS (
WITH os_minor AS (
WITH os_major AS (
SELECT substr(product_version, 0, instr(product_version, ".")) as os_major, substr(product_version, instr(product_version, ".")+1) as no_os_major_substr
FROM file
WHERE path = "c:\windows\system32\wininit.exe"
)
SELECT substr(no_os_major_substr, instr(no_os_major_substr, ".")+1) as no_os_minor_substr, substr(no_os_major_substr, 0, instr(no_os_major_substr, ".")) as os_minor, os_major
FROM os_major
)
SELECT
CAST(substr(no_os_minor_substr, instr(no_os_minor_substr, ".")+1) AS INTEGER) AS product_minor,
CAST(substr(no_os_minor_substr, 0, instr(no_os_minor_substr, ".")) AS INTEGER) AS product_major,
CAST(os_minor AS INTEGER) AS os_minor,
CAST(os_major AS INTEGER) AS os_major
FROM os_minor
)
SELECT
CASE
WHEN NOT ((os_major = 6 AND os_minor = 3) OR (os_major = 6 AND os_minor = 2) OR (os_major = 10 AND os_minor = 0))
THEN "not supported"
WHEN os_major = 6 AND os_minor = 3 AND product_major = 9600 AND product_minor >= 20716 THEN "patched"
WHEN os_major = 6 AND os_minor = 2 AND product_major = 9200 AND product_minor >= 24011 THEN "patched"
WHEN (
(product_major = 14393 AND product_minor >= 5582)
OR
(product_major = 10240 AND product_minor >= 19624)
OR
(product_major = 19041 AND product_minor >= 1620)
OR
(product_major = 22621 AND product_minor >= 963)
OR
(product_major = 22000 AND product_minor >= 1335)
OR
(product_major = 20348 AND product_minor >= 1366)
OR
(product_major = 17763 AND product_minor >= 3770)
)
THEN
"patched"
ELSE
"not patched"
The query reads the product version of c:\windows\system32\wininit.exe, splits it into major and minor components, and compares them against the patched build numbers for each supported OS release. Anything below the listed build for its branch is reported as not patched.
Variants to test
- Enumerate other RPC interfaces registered with the default cache behaviour and look for a function that the security callback exempts from its checks. A positive result is a call to that function succeeding with a low-privileged token, followed by a privileged function on the same interface succeeding afterwards.
- For any interface whose documented client takes fewer arguments than the server expects, parse the
ProcFormatStringof the interface stub instead of guessing. A positive result is an argument type in the format string that is absent from the documented client, as with thewchar_t*here. - Check security callbacks that branch on the function being called, rather than applying the same check to every function. A positive result is any function that reaches the body of the callback without the token comparison.
- Test interfaces that accept both ALPC and TCP, since the callback here allowed both and only enforced
RPC_C_AUTHN_LEVEL_PKT_PRIVACY. A positive result is a remote call over TCP at that authentication level reaching a function that local callers reach over ALPC.
Summary
Although this vulnerability is not critical, it shows the destructive potential built into MS-RPC, which is present even in the most critical services of the Windows operating system. Unlike other vulnerability classes, there is almost no guesswork with RPC: all of the cards are on the binary table, and you only have to know how to read them. That is why the author continues research into MS-RPC, which remains largely underresearched despite its widespread use.

What happened, in plain words
Every Windows computer has a small set of programs that must keep running for the machine to work at all. One of them is called Wininit.exe. It is involved in starting Windows up and in shutting it down. If it crashes, the whole computer crashes with it. Think of it as the person at the front desk of a building who holds the only key to the main power switch: if that person falls over, the lights go out for everyone.
Because Wininit is the thing that actually performs a shutdown, other programs need a way to ask it to shut the machine down. They do that through an RPC interface. RPC stands for Remote Procedure Call, and the idea is simple: one program asks another program, possibly on a different computer, to run one of its functions, as if it were calling a local function. It is like phoning a restaurant and ordering a dish by its number on the menu: you do not need to know how the kitchen works, you just need the number and the right way of asking.

The interface in question is called WindowsShutdown. It is one of the few RPC interfaces that Wininit exposes, and it is the one responsible for the shutdown process. Each RPC interface has a long identifier called a UUID, a string of letters and digits that uniquely names it, a bit like a phone number for the interface. WindowsShutdown's UUID is d95afe70-a6d5-4259-822e-2c84da1ddb0d. It belongs to a Microsoft specification called MS-RSP, which stands for Remote Shutdown Protocol, and it offers three functions:
- WsdrInitiateShutdown: start a shutdown.
- WsdrAbortShutdown: cancel a shutdown.
- WsdrCheckForHiberboot: a third function, whose purpose we will come back to.

Microsoft publishes a description of some of its interfaces in a file called an IDL file (Interface Definition Language). You can think of an IDL file as a menu that lists the functions an interface offers and what arguments each one takes. Looking at the public IDL file, only WsdrInitiateShutdown and WsdrAbortShutdown are documented. The third function, WsdrCheckForHiberboot, is not described there at all. As you will see, that undocumented function is the one that matters here.
The setup: what you need to pull this off
The researcher, Stiv Kupchik, did the work with a toolkit for talking to RPC interfaces, published in the akamai-security-research repository, and a proof of concept for this specific vulnerability is provided in the PoCs/cve-2022-44707 directory of the same repository. A proof of concept is a small program that demonstrates that an attack really works, without doing anything beyond what is needed to show it.
The attack needs a remote user who has already logged in somewhere: the goal is to reach the shutdown functions over RPC from another machine. In other words, you do not need to be sitting at the target computer, but you do need a valid account. The interface accepts only two transports, meaning two ways of carrying the conversation: ALPC, which is the way programs on the same machine talk to each other, and TCP, the ordinary network protocol used across the internet and local networks. The callback allows only one authentication level, RPC_C_AUTHN_LEVEL_PKT_PRIVACY. Authentication level is how much proof of identity and protection the caller has to provide; this particular level means the traffic is authenticated and encrypted.
The vulnerability affects all unpatched Windows versions starting with Windows 8/Server 2012. It was responsibly disclosed to MSRC, Microsoft's Security Response Center (the team that handles reports of security bugs), in August, and patched as part of December 2022 Patch Tuesday. Patch Tuesday is the day each month when Microsoft releases its security fixes. The vulnerability is tracked as CVE-2022-44707, where CVE is a public catalogue number given to a known security flaw, and it has a CVSS score of 6.5. CVSS is a standard way of scoring how serious a vulnerability is, from 0 to 10; 6.5 is in the middle range, not the most severe.
Finding it: the security callback
The starting point is the security callback registered for the WindowsShutdown interface. A callback is a piece of code that the system runs automatically before letting a request through, like a bouncer at a door who checks your name against a list before you enter. This particular bouncer does three checks in order:
- It checks the transport protocol and allows only ALPC or TCP.
- It checks the authentication level and allows only
RPC_C_AUTHN_LEVEL_PKT_PRIVACY. - Finally, if the function being called is not WsdrCheckForHiberboot, it checks the remote calling user's token. A token here is the internal record of who you are and what you are allowed to do, a bit like a badge you wear inside a building. The check compares your token with a well-known SID saved in a global variable created during WinInit's initialization. A SID (Security Identifier) is the unique number Windows uses to identify a user or a group; this particular one is
SECURITY_NETWORK_RID, which represents the group of users who are allowed to shut the machine down over the network.

Here is the important part: calls to WsdrCheckForHiberboot are not restricted at all by the security callback. The bouncer checks the transport and the authentication level, then sees the function name, and waves it through without looking at your badge. That asymmetry is the opening.
The interface is registered with the default cache behaviour. A cache is a place where a system stores the result of something it has already done, so it does not have to do it again; think of a receptionist who, after checking your badge once, sticks a note on the desk saying "already checked" and lets you past on later visits without looking again. Because of that default cache behaviour, a successful call to WsdrCheckForHiberboot should produce a cached successful result, and that cached result should let subsequent calls to WsdrInitiateShutdown and WsdrAbortShutdown bypass the SID check. This is the RPC caching mechanism the author had researched previously, in an earlier post called Cold Hard Cache.
The remaining problem is calling WsdrCheckForHiberboot correctly. The function is undocumented, so its signature, meaning the list of arguments it expects and their types, has to be reconstructed. The only documented RPC client found for it is the advapi CheckForHiberboot, which takes two arguments: a Boolean pointer and a Boolean. A Boolean is simply a true-or-false value. A pointer is a value that says where in memory something is stored, rather than the thing itself, like a note saying "the answer is in the second drawer" instead of the answer.

Exploitation
Step 1: recreate the function definition from the advapi client
Using the two arguments of the advapi client, the author recreated the function definition in an IDL file and compiled a client and program. Compiling means turning the written description into a working program. Calling the function remotely with that client fails: the RPC runtime reports that the function is being called incorrectly by returning an RPC stub error. The RPC runtime is the part of Windows that carries the call across the network, and a stub is the small piece of generated code that packs the arguments up on one side and unpacks them on the other. The error is the runtime's way of saying "the shape of what you sent does not match the shape of what the function expects".

Step 2: read the ProcFormatString
Rather than guessing further, the author parsed the interface stub's ProcFormatString. This is a long binary string that describes the argument types and return values for all functions exposed by the interface, and the RPC runtime uses it while marshaling and unmarshaling calls. Marshaling is the process of packing arguments into a flat stream of bytes to send over the network; unmarshaling is unpacking them at the other end. That packing and unpacking is exactly the process that produced the stub error. Parsing the string manually, meaning reading it byte by byte and working out what each part means, revealed an additional argument the function expects, of type wchar_t*. A wchar_t* is a pointer to a wide character string, which is how Windows stores text internally.

The figure shows the section of the ProcFormatString for WsdrCheckForHiberboot with the author's comments on each part.
Step 3: call WsdrCheckForHiberboot
With the extra argument added to the definition, the call succeeds: CheckForHiberboot returns, and the cached result is in place. In other words, the receptionist has now written the "already checked" note on the desk.
Step 4: call the shutdown functions
With the cache primed, both WsdrInitiateShutdown and WsdrAbortShutdown can be called. No guesswork is needed for these: the function definition is documented in the IDL file, and the flags they expect are documented under the advapi function InitiateShutdownA. A flag is an option you switch on to change how a function behaves, like ticking a box on a form. Using the flag combination of SHUTDOWN_GRACE_OVERRIDE, SHUTDOWN_HYBRID and SHUTDOWN_FORCE_OTHERS forces an immediate shutdown: Using the flag combination of SHUTDOWN_GRACE_OVERRIDE, SHUTDOWN_HYBRID and SHUTDOWN_FORCE_OTHERS forces an immediate shutdown.
That completes the chain: bypass the security callback and its SID check, then shut the machine down remotely.
Root cause
The interface is registered with the default cache behaviour, and the security callback exempts WsdrCheckForHiberboot from the token check entirely. A successful call to that one function therefore caches a successful result for the interface, and the cache is consulted before the SID comparison on later calls to the shutdown functions.
Technically this is an escalation of privilege, since it lets any authenticated user call WsdrInitiateShutdown remotely instead of only those allowed under SECURITY_NETWORK_RID. Escalation of privilege means doing something you were not supposed to be allowed to do. Because the only outcome reachable through this interface is a shutdown, it was categorised as a denial-of-service vulnerability instead. Denial of service means making a service or a machine unavailable to its normal users; here, the machine goes down.
Impact
An authenticated remote attacker can stop or initiate shutdowns on a target Windows machine, bypassing the SID check that is supposed to limit the shutdown functions to SECURITY_NETWORK_RID. The author is explicit that the vulnerability is not critical: it is just a remote shutdown, and not even an unauthenticated one. All unpatched Windows versions from Windows 8/Server 2012 onwards are affected.
Fix
Microsoft patched the vulnerability in December 2022 Patch Tuesday. The report does not describe the code change. For detection, the author provides an OSQuery that flags unpatched, and therefore vulnerable, versions of Wininit.exe. OSQuery is a tool that lets you ask questions about a computer's state using SQL, the same query language used for databases. Akamai Guardicore Segmentation customers can combine it with the Insight feature to search for vulnerable assets.
WITH product_version AS (
WITH os_minor AS (
WITH os_major AS (
SELECT substr(product_version, 0, instr(product_version, ".")) as os_major, substr(product_version, instr(product_version, ".")+1) as no_os_major_substr
FROM file
WHERE path = "c:\windows\system32\wininit.exe"
)
SELECT substr(no_os_major_substr, instr(no_os_major_substr, ".")+1) as no_os_minor_substr, substr(no_os_major_substr, 0, instr(no_os_major_substr, ".")) as os_minor, os_major
FROM os_major
)
SELECT
CAST(substr(no_os_minor_substr, instr(no_os_minor_substr, ".")+1) AS INTEGER) AS product_minor,
CAST(substr(no_os_minor_substr, 0, instr(no_os_minor_substr, ".")) AS INTEGER) AS product_major,
CAST(os_minor AS INTEGER) AS os_minor,
CAST(os_major AS INTEGER) AS os_major
FROM os_minor
)
SELECT
CASE
WHEN NOT ((os_major = 6 AND os_minor = 3) OR (os_major = 6 AND os_minor = 2) OR (os_major = 10 AND os_minor = 0))
THEN "not supported"
WHEN os_major = 6 AND os_minor = 3 AND product_major = 9600 AND product_minor >= 20716 THEN "patched"
WHEN os_major = 6 AND os_minor = 2 AND product_major = 9200 AND product_minor >= 24011 THEN "patched"
WHEN (
(product_major = 14393 AND product_minor >= 5582)
OR
(product_major = 10240 AND product_minor >= 19624)
OR
(product_major = 19041 AND product_minor >= 1620)
OR
(product_major = 22621 AND product_minor >= 963)
OR
(product_major = 22000 AND product_minor >= 1335)
OR
(product_major = 20348 AND product_minor >= 1366)
OR
(product_major = 17763 AND product_minor >= 3770)
)
THEN
"patched"
ELSE
"not patched"
Line by line, in plain words:
WITH product_version AS (starts a named block calledproduct_version, so the result can be reused later. Think of it as giving a name to an intermediate answer.WITH os_minor AS (andWITH os_major AS (are two more named blocks nested inside it, each holding one step of the work.SELECT substr(product_version, 0, instr(product_version, ".")) as os_major, substr(product_version, instr(product_version, ".")+1) as no_os_major_substrtakes the version text of the file and cuts it at the first dot.substrtakes a piece of text, andinstrfinds the position of a character. The part before the dot becomesos_major; the rest is kept asno_os_major_substr.FROM filesays the information comes from thefiletable, which is OSQuery's list of files on the machine.WHERE path = "c:\windows\system32\wininit.exe"restricts it to the Wininit.exe file at that exact path.- The next
SELECTrepeats the same cutting trick on the remainder, producingos_minorandno_os_minor_substr. - The outer
SELECTusesCAST(... AS INTEGER)to turn the text pieces into numbers, so they can be compared with>=later. It producesproduct_minor,product_major,os_minorandos_major. - The final
SELECTuses aCASEexpression, which is a series of if-then checks. The firstWHENsays: if the operating system is not one of the three listed combinations, report"not supported". - The next two
WHENlines handle two specific older branches, checking that the build number is at least the patched build for that branch. - The big
WHENwith theORlist checks the remaining branches, each with its own minimum build number. THEN "patched"is the answer when one of those conditions is true.ELSE "not patched"is the answer for everything else, which is the case we care about: a machine that has not received the fix.
In short, the query reads the product version of c:\windows\system32\wininit.exe, splits it into major and minor components, and compares them against the patched build numbers for each supported OS release. Anything below the listed build for its branch is reported as not patched.
Variants to test
- Enumerate other RPC interfaces registered with the default cache behaviour and look for a function that the security callback exempts from its checks. A positive result is a call to that function succeeding with a low-privileged token, followed by a privileged function on the same interface succeeding afterwards.
- For any interface whose documented client takes fewer arguments than the server expects, parse the
ProcFormatStringof the interface stub instead of guessing. A positive result is an argument type in the format string that is absent from the documented client, as with thewchar_t*here. - Check security callbacks that branch on the function being called, rather than applying the same check to every function. A positive result is any function that reaches the body of the callback without the token comparison.
- Test interfaces that accept both ALPC and TCP, since the callback here allowed both and only enforced
RPC_C_AUTHN_LEVEL_PKT_PRIVACY. A positive result is a remote call over TCP at that authentication level reaching a function that local callers reach over ALPC.
Summary
Although this vulnerability is not critical, it shows the destructive potential built into MS-RPC, which is present even in the most critical services of the Windows operating system. Unlike other vulnerability classes, there is almost no guesswork with RPC: all of the cards are on the binary table, and you only have to know how to read them. That is why the author continues research into MS-RPC, which remains largely underresearched despite its widespread use.

Glossary
- ALPC: a way for programs on the same Windows machine to send messages to each other.
- Authentication level: how much proof of identity and protection a caller must provide; here only
RPC_C_AUTHN_LEVEL_PKT_PRIVACYis accepted, meaning authenticated and encrypted traffic. - Boolean: a value that is either true or false.
- Cache: a store of results already computed, so they can be reused instead of recalculated.
- Callback: code that the system runs automatically before letting a request through, to check it.
- Compile: turn a written description or source file into a working program.
- CVE: a public catalogue number given to a known security flaw.
- CVSS score: a standard 0 to 10 score for how serious a vulnerability is.
- Denial of service (DoS): making a service or machine unavailable to its normal users.
- Escalation of privilege: doing something you were not supposed to be allowed to do.
- Flag: an option you switch on to change how a function behaves.
- IDL file: a file that describes the functions an interface offers and the arguments they take.
- Marshaling / unmarshaling: packing arguments into a stream of bytes to send, and unpacking them at the other end.
- MS-RSP: Microsoft's Remote Shutdown Protocol specification.
- MSRC: Microsoft Security Response Center, the team that handles reports of security bugs.
- OSQuery: a tool that lets you ask questions about a computer's state using SQL.
- Patch Tuesday: the day each month when Microsoft releases its security fixes.
- Pointer: a value that says where in memory something is stored, rather than the thing itself.
- Proof of concept: a small program that demonstrates an attack really works.
- RPC (Remote Procedure Call): one program asking another, possibly on a different computer, to run one of its functions.
- RPC runtime: the part of Windows that carries an RPC call across the network.
- RPC stub error: an error saying the arguments sent do not match what the function expects.
- Security callback: the automatic check run before a request is allowed through.
- SID (Security Identifier): the unique number Windows uses to identify a user or group.
- Signature: the list of arguments a function expects and their types.
- SQL: the query language used to ask questions of databases.
- Stub: the small piece of generated code that packs and unpacks arguments for an RPC call.
- TCP: the ordinary network protocol used across the internet and local networks.
- Token: the internal record of who you are and what you are allowed to do.
- Transport: the way a conversation is carried, such as ALPC or TCP.
- UUID: a long string of letters and digits that uniquely names an interface.
- wchar_t*: a pointer to a wide character string, how Windows stores text internally.