ID | Technique | Tactic |
---|---|---|
T1547.012 | Print Processors | Persistence |
T1547 | Boot or Logon Autostart Execution | Privilege Escalation |
Detection: Print Spooler Adding A Printer Driver
Description
The following analytic detects the addition of new printer drivers by monitoring Windows PrintService operational logs, specifically EventCode 316. This detection leverages log data to identify messages indicating the addition or update of printer drivers, such as "kernelbase.dll" and "UNIDRV.DLL." This activity is significant as it may indicate exploitation attempts related to vulnerabilities like CVE-2021-34527 (PrintNightmare). If confirmed malicious, attackers could gain code execution or escalate privileges, potentially compromising the affected system. Immediate isolation and investigation of the endpoint are recommended.
Search
1`printservice` EventCode=316 category = "Adding a printer driver" Message = "*kernelbase.dll,*" Message = "*UNIDRV.DLL,*" Message = "*.DLL.*"
2| stats count min(_time) as firstTime max(_time) as lastTime by OpCode EventCode ComputerName Message
3| `security_content_ctime(firstTime)`
4| `security_content_ctime(lastTime)`
5| `print_spooler_adding_a_printer_driver_filter`
Data Source
Name | Platform | Sourcetype | Source | Supported App |
---|---|---|---|---|
Windows Event Log Printservice 316 | Windows | 'WinEventLog' |
'WinEventLog:Microsoft-Windows-PrintService/Admin' |
N/A |
Macros Used
Name | Value |
---|---|
printservice | source="wineventlog:microsoft-windows-printservice/operational" OR source="WinEventLog:Microsoft-Windows-PrintService/Admin" |
print_spooler_adding_a_printer_driver_filter | search * |
print_spooler_adding_a_printer_driver_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
You will need to ensure PrintService Admin and Operational logs are being logged to Splunk from critical or all systems.
Known False Positives
Unknown. This may require filtering.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
Suspicious print driver was loaded on endpoint $ComputerName$. | 72 | 80 | 90 |
References
-
https://twitter.com/MalwareJake/status/1410421445608476679?s=20
-
https://www.reddit.com/r/msp/comments/ob6y02/critical_vulnerability_printnightmare_exposes
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | WinEventLog:Microsoft-Windows-PrintService/Operational |
WinEventLog |
Integration | ✅ Passing | Dataset | WinEventLog:Microsoft-Windows-PrintService/Operational |
WinEventLog |
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 2