T1547.012 Microsoft Sentinel · KQL

Detect Print Processors in Microsoft Sentinel

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.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1547 Boot or Logon Autostart Execution
Sub-technique
T1547.012 Print Processors
Canonical reference
https://attack.mitre.org/techniques/T1547/012/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
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
high severity high confidence

Detects print processor persistence via three correlated signals: (1) Registry modifications to the Print Processors key under Print\Environments indicating a new print processor DLL registration, (2) new DLL files created in the spool\prtprocs directory where print processor DLLs must reside, and (3) unexpected child processes spawned by spoolsv.exe. Known legitimate print processors (winprint.dll, filterpipelineprintproc.dll) are flagged but not excluded to allow analyst review. Uses DeviceRegistryEvents, DeviceFileEvents, and DeviceProcessEvents from MDE.

Data Sources

Windows Registry: Registry Key CreationWindows Registry: Registry Key ModificationFile: File CreationProcess: Process CreationMicrosoft Defender for Endpoint

Required Tables

DeviceRegistryEventsDeviceFileEventsDeviceProcessEvents

False Positives & Tuning

  • 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
Download portable Sigma rule (.yml)

Other platforms for T1547.012


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Print Processor Registry Key Creation

    Expected signal: Sysmon Event ID 12: Registry Key Created for TestProcessor_df00tech subkey. Sysmon Event ID 13: Registry Value Set for Driver value with Details=winprint.dll. Security Event ID 4688 with CommandLine containing reg add and the full registry path.

  2. Test 2DLL Drop in Print Processor Directory

    Expected signal: Sysmon Event ID 11: File Create with TargetFilename=C:\Windows\System32\spool\prtprocs\x64\df00tech_test_printproc.dll, Image=cmd.exe. DeviceFileEvents with ActionType=FileCreated in the prtprocs directory.

  3. Test 3PowerShell Print Processor Registration (Earth Lusca Style)

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with full command line. Sysmon Event ID 12: Registry Key Created. Sysmon Event ID 13: Registry Value Set. PowerShell ScriptBlock Log Event ID 4104 capturing the registry manipulation.

  4. Test 4Enumerate Existing Print Processors for Reconnaissance

    Expected signal: Sysmon Event ID 1: Process Create for reg.exe with CommandLine containing reg query and Print Processors path. Security Event ID 4688 with same details. No registry modification events (read-only operation).

Unlock Pro Content

Get the full detection package for T1547.012 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections