The Windows Print Spooler has a privilege escalation vulnerability that can be leveraged to achieve code execution as SYSTEM. The `SpoolDirectory`, a configuration setting that holds the path that a printer's spooled jobs are sent to, is writable for all users, and it can be configured via `SetPrinterDataEx()` provided the caller has the `PRINTER_ACCESS_ADMINISTER` permission. If the `SpoolDirectory` path does not exist, it will be created once the print spooler reinitializes. Calling `SetPrinterDataEx()` with the `CopyFiles\` registry key will load the dll passed in as the `pData` argument, meaning that writing a dll to the `SpoolDirectory` location can be loaded by the print spooler. Using a directory junction and UNC path for the `SpoolDirectory`, the exploit writes a payload to `C:\Windows\System32\spool\drivers\x64\4` and loads it by calling `SetPrinterDataEx()`, resulting in code execution as SYSTEM.
Exploit database
Vulnerability
CVE-2022-22718
Windows Print Spooler Elevation of Privilege Vulnerability
Vulnerability details
- Score
- 7.8
- Severity
- high
CVSS 3.1 · microsoft
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:CDescription
Windows Print Spooler Elevation of Privilege Vulnerability
CVE ProgramExploit source choices
4 sourcesCVE-2022-21999 SpoolFool Privesc
2022-02-08cve_2022_21999_spoolfool_privesc.rb
ly4k/spoolfool
Exploit for CVE-2022-21999 - Windows Print Spooler Elevation of Privilege Vulnerability (LPE)
2022-02-0822 files · 793 stars
al1ex/windowselevation
Windows Elevation(持续更新)
2021-03-291,045 files · 665 stars
clearbluejar/cve-markdown-charts
A simple tool to create mermaid js markdown charts from CVE IDs and CVE keyword searches.
2022-02-186 files · 47 stars