We covered the Print Nightmare Exploit from a defensive perspective where we performed an incident response and extracted the related artifacts to the exploit using Wireshark, Brim and Windows event viewer. This was part of TryHackMe Printermare room.

Get OSCP Notes

Per Microsoft, “A remote code execution vulnerability exists when the Windows Print Spooler service improperly performs privileged file operations. An attacker who successfully exploited this vulnerability could run arbitrary code with SYSTEM privileges. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights“.
Microsoft defines the Print spooler service as a service that runs on each computer system. As you can guess from the name, the Print spooler service manages the printing processes. The Print spooler’s responsibilities are managing the print jobs, receiving files to be printed, queueing them, and scheduling.

To better understand the PrintNightmare vulnerability (or any vulnerability), you should get into the habit of researching the vulnerabilities by reading Microsoft articles on any Windows-specific CVE or browsing through the Internet for community and vendor blogposts.

There has been some confusion if the CVE-2021-1675 and CVE-2021-34527 are related to each other. They go under the same name: Windows Print Spooler Remote Code Execution Vulnerability and are both related to the Print Spooler.

As Microsoft states in the FAQ, the PrintNightmare (CVE-2021-34527) vulnerability “is similar but distinct from the vulnerability that is assigned CVE-2021-1675. The attack vector is different as well.”

What did Microsoft mean by the attack vector? To answer this question, let’s look into the differences between the two vulnerabilities and append the timeline of events.

Per Microsoft’s definition, PrintNightmare vulnerability is “a remote code execution vulnerability exists when the Windows Print Spooler service improperly performs privileged file operations. An attacker who successfully exploited this vulnerability could run arbitrary code with SYSTEM privileges. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights.”.

Running arbitrary code involves executing any commands of the attacker’s choice and preference on a victim’s machine.
Suppose you had a chance to look at both CVE’s on Microsoft. You would notice that the attack vectors for both are different.

To exploit the CVE-2021-1675 vulnerability, the attacker would need to have direct or local access to the machine to use a malicious DLL file to escalate privileges. To exploit the CVE-2021-34527 vulnerability successfully, the attacker can remotely inject the malicious DLL file.

Room Answers
Where would you enable or disable Print Spooler Service?
Provide the CVE of the Windows Print Spooler Remote Code Execution Vulnerability that doesn’t require local access to the machine.

What date was the CVE assigned for the vulnerability in the previous question? (mm/dd/yyyy)

Provide the CVE of the Windows Print Spooler Remote Code Execution Vulnerability that doesn’t require local access to the machine.

What date was the CVE assigned for the vulnerability in the previous question? (mm/dd/yyyy)

What is the flag residing on the Administrator’s Desktop?
Provide the first folder path where you would likely find the dropped DLL payload.

Provide the function that is used to install printer drivers.

What tool can the attacker use to scan for vulnerable print servers?

Provide the name of the dropped DLL, including the error code. (no space after the comma)
Provide the event log name and the event ID that detected the dropped DLL. (no space after the comma)

Find the source name and the event ID when the Print Spooler Service stopped unexpectedly and how many times was this event logged? (format: answer,answer,answer)

After some threat hunting steps, you are more confident now that it’s a PrintNightmare attack. Hunt for the attacker’s shell connection. Provide the log name, event ID, and destination port. (format: answer,answer,answer)

Oh no! You think you’ve found the attacker’s connection. You need to know the attacker’s IP address and the destination hostname in order to terminate the connection.  Provide the attacker’s IP address and the hostname. (format: answer,answer)

Sysmon FileCreated event was generated and logged. Provide the full path to the dropped DLL and the earliest creation time in UTC.  (format:answer,yyyy-mm-dd hh-mm-ss)

What is the host name of the domain controller?

What is the local domain?

What user account was utilized to exploit the vulnerability?

What was the malicious DLL used in the exploit?

What was the attacker’s IP address?

What was the UNC path where the malicious DLL was hosted?

There are encrypted packets in the results. What was the associated protocol?

Provide two ways to manually disable the Print Spooler Service. (format: answer,answer)

Where can you disable the Print Spooler Service in Group Policy? (format: no spaces between the forward slashes)

Provide the command in PowerShell to detect if Print Spooler Service is enabled and running.

Video Walkthrough

About the Author

I create cybersecurity notes, digital marketing notes and online courses. I also provide digital marketing consulting including but not limited to SEO, Google & Meta ads and CRM administration.

View Articles