PrintNightmare – Print Spooler RCE to SYSTEM
PrintNightmare abuses the RpcAddPrinterDriverEx function in the Windows Print Spooler service to load an arbitrary DLL as SYSTEM. Any authenticated domain user can trigger it — no local admin required. Because the Print Spooler runs on Domain Controllers by default, a single low-privilege domain account can lead directly to full domain compromise.
Two CVEs cover the attack surface: CVE-2021-1675 (original LPE/RCE) and CVE-2021-34527 (remote RCE, more critical). The exploit technique is the same for both.
Patched systems may still be vulnerable if the PointAndPrint registry keys are present with permissive values — check for those before assuming the target is safe.
Prerequisites
Valid domain credentials (any user)
Print Spooler running on the target
Network access to port 445 on the target
Confirm the spooler is exposed:
If MS-RPRN or MS-PAR appears in the output, the spooler is accessible and the target is potentially vulnerable.
Setting Up the Exploit
The cube0x0 exploit requires his fork of Impacket. Install it in a separate virtual environment to avoid breaking your system Impacket:
Building the Malicious DLL
The exploit loads a DLL from a UNC path you host. The DLL executes as SYSTEM on the target. Build a reverse shell DLL with msfvenom:
Host it on an SMB share that the target can reach:
Running the Exploit
Start a listener:
Run the exploit pointing at your hosted DLL:
With a hash instead of password:
[*] Connecting to ncacn_np:10.10.10.10[\PIPE\spoolss] [+] Bind OK [+] pDriverPath Found C:\Windows\System32\DriverStore\FileRepository\ntprint.inf_amd64_...\Amd64\UNIDRV.DLL [*] Executing \\10.10.10.1\share\shell.dll [*] Try 1... [*] Stage0: 0 [*] Stage2: 0 [+] Exploit Completed
Your nc listener receives a SYSTEM shell on completion.
Patched But Still Vulnerable – PointAndPrint Check
If the target is patched but PointAndPrint is misconfigured, the exploit still works. Check the registry from a compromised host:
If both of these values are present, the target is still exploitable despite the patch:
NoWarningNoElevationOnInstall = 0x1
RestrictDriverInstallationToAdministrators = 0x0
Loading a Local DLL Instead of UNC
If outbound SMB from the target is blocked, place the DLL in a path the target can already access — a share you know it mounts, or a path discovered via an earlier file write. Change the exploit argument to a local Windows path:
This requires a separate file write step first. Use an authenticated SMB write or another upload method to place the DLL.
References
-
CVE-2021-1675github.com/cube0x0/CVE-2021-1675 (opens in new tab)
cube0x0 Impacket-based Python exploit for remote PrintNightmare exploitation.
Was this helpful?
Your feedback helps improve this page.