Boot or Logon Autostart Execution: Print Processors

Adversaries may abuse print processors to run malicious DLLs during system boot for persistence and/or privilege escalation. Print processors are DLLs that are loaded by the print spooler service, spoolsv.exe, during boot.

Adversaries may abuse the print spooler service by adding print processors that load malicious DLLs at startup. A print processor can be installed through the AddPrintProcessor API call with an account that has SeLoadDriverPrivilege enabled. Alternatively, a print processor can be registered to the print spooler service by adding the HKLM\SYSTEM\[CurrentControlSet or ControlSet001]\Control\Print\Environments\[Windows architecture: e.g., Windows x64]\Print Processors\[user defined]\Driver Registry key that points to the DLL. For the print processor to be correctly installed, it must be located in the system print-processor directory that can be found with the GetPrintProcessorDirectory API call.[1] After the print processors are installed, the print spooler service, which starts during boot, must be restarted in order for them to run.[2] The print spooler service runs under SYSTEM level permissions, therefore print processors installed by an adversary may run under elevated privileges.

ID: T1547.012
Sub-technique of:  T1547
Tactics: Persistence, Privilege Escalation
Platforms: Windows
Permissions Required: Administrator, SYSTEM
Data Sources: API monitoring, DLL monitoring, File monitoring, Process monitoring, Windows Registry
Contributors: Mathieu Tartare, ESET
Version: 1.0
Created: 05 October 2020
Last Modified: 09 October 2020

Procedure Examples

Name Description
PipeMon

The PipeMon installer has modified the Registry key HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors to install PipeMon as a Print Processor.[2]

Mitigations

Mitigation Description
User Account Management

Limit user accounts that can load or unload device drivers by disabling SeLoadDriverPrivilege.

Detection

Monitor process API calls to AddPrintProcessor and GetPrintProcessorDirectory. New print processor DLLs are written to the print processor directory. Also monitor Registry writes to HKLM\SYSTEM\ControlSet001\Control\Print\Environments\[Windows architecture]\Print Processors\[user defined]\Driver or HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\[Windows architecture]\Print Processors\[user defined]\Driver as they pertain to print processor installations.

Monitor for abnormal DLLs that are loaded by spoolsv.exe. Print processors that do not correlate with known good software or patching may be suspicious.

References