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 a Registry key under HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors with a Driver value pointing to the malicious DLL. The print spooler service runs under SYSTEM level permissions, therefore print processors installed by an adversary may run under elevated privileges.
let PrintProcRegPath = @"Control\Print\Environments";
let KnownPrintProcessors = dynamic(["winprint.dll", "filterpipelineprintproc.dll", "lxkptpc.dll", "hpzpp4v5.dll"]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has PrintProcRegPath
| where RegistryKey has "Print Processors"
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend DLLValue = tostring(RegistryValueData)
| extend IsKnown = DLLValue has_any (KnownPrintProcessors)
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine, IsKnown
| sort by Timestamp desc;
DeviceFileEvents
| where Timestamp > ago(24h)
| where FolderPath has @"\spool\prtprocs"
| where FileName endswith ".dll"
| where ActionType == "FileCreated"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, SHA256, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc;
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName =~ "spoolsv.exe"
| where FileName !in~ ("splwow64.exe", "PrintIsolationHost.exe", "printfilterpipelinesvc.exe", "conhost.exe")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, FolderPath, InitiatingProcessFileName
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate printer driver installations from vendors (HP, Canon, Lexmark, Xerox) that install custom print processors via AddPrintProcessor API
- Print management software (PaperCut, Pharos, Equitrac) that deploys custom print processors for job accounting and watermarking
- Windows Update or WSUS deploying updated print processor DLLs as part of printer driver packages
- IT administrators manually installing print processors using PowerShell or the Print Management console on print servers
References (7)
- https://attack.mitre.org/techniques/T1547/012/
- https://docs.microsoft.com/en-us/windows/win32/printdocs/addprintprocessor
- https://learn.microsoft.com/windows-hardware/drivers/print/introduction-to-print-processors
- https://www.welivesecurity.com/2020/05/21/no-game-over-winnti-group/
- https://www.trendmicro.com/en_us/research/22/a/earth-lusca-employs-sophisticated-infrastructure-varied-tools-and-techniques.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1547.012/T1547.012.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/registry/registry_set
Unlock Pro Content
Get the full detection package for T1547.012 including response playbook, investigation guide, and atomic red team tests.