T1547.010

Port Monitors

Adversaries may use port monitors to run an adversary-supplied DLL during system boot for persistence or privilege escalation. A port monitor can be set through the AddMonitor API call to set a DLL to be loaded at startup. This DLL can be located in C:\Windows\System32 and will be loaded and run by the print spooler service, spoolsv.exe, under SYSTEM level permissions on boot. Alternatively, an arbitrary DLL can be loaded if permissions allow writing a fully-qualified pathname for that DLL to the Driver value of an existing or new arbitrarily named subkey of HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors.

Microsoft Sentinel / Defender
kusto
let MonitorRegPath = @"HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors";
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "Control\\Print\\Monitors"
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend RegistryValueName = tostring(RegistryValueData)
| extend SuspiciousDLL = RegistryValueData endswith ".dll"
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine, SuspiciousDLL
| sort by Timestamp desc;
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName =~ "spoolsv.exe"
| where FileName !in~ ("splwow64.exe", "PrintIsolationHost.exe", "printfilterpipelinesvc.exe")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, FolderPath, InitiatingProcessFileName
| sort by Timestamp desc;
DeviceFileEvents
| where Timestamp > ago(24h)
| where FolderPath startswith @"C:\Windows\System32"
| where FileName endswith ".dll"
| where InitiatingProcessFileName !in~ ("TiWorker.exe", "TrustedInstaller.exe", "msiexec.exe", "svchost.exe")
| where ActionType == "FileCreated"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
high severity high confidence

Data Sources

Windows Registry: Registry Key Creation Windows Registry: Registry Key Modification Process: Process Creation File: File Creation Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents DeviceProcessEvents DeviceFileEvents

False Positives

  • Legitimate printer driver installations by IT administrators using vendor-provided installers (HP, Canon, Lexmark, etc.) that register port monitors through AddMonitor API
  • Print management software (PaperCut, PrinterLogic, Pharos) that installs custom port monitors for print job tracking and accounting
  • PDF printer utilities (Adobe PDF, Microsoft Print to PDF, CutePDF) that register virtual port monitors during installation
  • Windows Update or WSUS deploying printer driver updates that modify the Print\Monitors registry key

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections