Bypassing PPL in Userland (again)
A user with administrator privileges could bypass the mitigation that prevents protected processes from loading Known DLLs by using a COM type confusion to write a valid object directory handle into the global variable that stores the KnownDlls handle, then coercing the protected process to load an unsigned DLL from that directory. This allows injection of arbitrary code into a PPL with the highest signer type.
Published on blog.scrt.ch
This post is a sequel to Bypassing LSA Protection in Userland and The End of PPLdump. Here, I will discuss how I was able to bypass the latest mitigation implemented by Microsoft and develop a new Userland exploit for injecting arbitrary code in a PPL with the highest signer type.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the process does not verify the signature of a DLL when it is mapped from a Section object, and a COM type library can be hijacked to induce a type confusion that provides an arbitrary write primitive.
What the attacker needed
Administrator privileges; target protected process exposes COM object; ability to edit registry
How it was found
- Determine the handle value of the \BaseNamedObjects directory in the target protected process using NtQuerySystemInformation.
- Hijack the Type Library of the WaaSRemediation COM class by editing the registry key to point to an attacker-controlled Type Library.
- Create an instance of the WaaSRemediation COM object to load the hijacked Type Library.
- Call LaunchDetectionOnly to write a heap address at a chosen offset relative to ntdll!LdrpKnownDllDirectoryHandle.
- Call LaunchRemediationOnly to zero out unwanted bytes and form a valid handle value.
- Create a Section object in the new object directory and coerce the protected process to load it via LoadLibrary.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Protected processes are special Windows processes that normally refuse to load unsigned code. The researcher found a way to trick one such process into loading a malicious DLL by abusing a COM object whose type information can be swapped out, causing the process to write attacker-controlled data to a specific memory location. This lets an administrator run their own code inside the protected process.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.