Last Updated: 2021-07-02 11:57:15 UTC
by Johannes Ullrich (Version: 1)
[preliminary. please let us know if we missed something or made any mistakes]
Latest update from Microsoft (July 1st 2021): Microsoft assigned a new CVE to the issue: CVE-2021-34527. It also provides some mitigation techniques. See https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527
As part of Microsoft's June patch Tuesday, Microsoft released a patch for CVE-2021-1675. At the time, the vulnerability was considered a privilege escalation vulnerability. Microsoft considered exploitation "less likely" .
On June 21st, Microsoft modified the description of the vulnerability upgrading it to a remote code execution vulnerability. Earlier this week, an RCE exploit was posted to GitHub. While the exploit code was quickly removed, it had already been forked multiple times and can still easily be found on GitHub.
Further, it appears that the patch released by Microsoft on June 6th was incomplete. This exploit will work on fully patched systems, according to multiple reports. But remote exploitation requires normal user credentials .
A successful attack will leave the attacker with SYSTEM privileges.
What should you do:
- Patch systems that need to run the printer spool service.
Disable the printer spool service where possible. You only need it on systems that share printers. You do not need it on clients that only print to shared printers.(see user comment below)
- Block port 445/TCP and 135/TCP at your perimeter. (that is a good idea anyway)
What we do not know for sure:
- The effectiveness of the June patch is disputed. Some say that it may prevent the PoC from working, but there is evidence that it does not fully patch the vulnerability.
- Are there any exploit scenarios that do not require valid user credentials?
- Some reports indicate issues with printing after applying the June patch.
for a good summary see: https://doublepulsar.com/zero-day-for-every-supported-windows-os-version-in-the-wild-printnightmare-b3fdb82f840c
Enable "PrintService-Operational" event logging. Exploit attempts (successful or not) will trigger event ID 316. 
Also see this GitHub: https://github.com/LaresLLC/CVE-2021-1675
An interesting workaround comes from Fabio Viggiani of Truesec. The exploit relies on loading a malicious printer driver. This can be prevented by restricting access to the printer driver directory. 
$Path = "C:\Windows\System32\spool\drivers"
$Acl = Get-Acl $Path
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("System", "Modify", "ContainerInherit, ObjectInherit", "None", "Deny")
Set-Acl $Path $Acl