Detection rules › Splunk

Print Spooler Adding A Printer Driver

Status
production
Severity
medium
Group by
Message, OpCode, computer_name, signature_id
Author
Mauricio Velazco, Michael Haag, Teoderick Contreras, Splunk
Source
github.com/splunk/security_content

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.

Known false positives

  • No false positives have been identified at this time.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

name: Print Spooler Adding A Printer Driver
id: 313681a2-da8e-11eb-adad-acde48001122
version: 12
creation_date: '2021-07-01'
modification_date: '2026-05-13'
author: Mauricio Velazco, Michael Haag, Teoderick Contreras, Splunk
status: production
type: TTP
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.
data_source:
    - Windows Event Log Printservice 316
search: |-
    `printservice` EventCode=316 category = "Adding a printer driver" Message = "*kernelbase.dll,*" Message = "*UNIDRV.DLL,*" Message = "*.DLL.*"
      | stats  count min(_time) as firstTime max(_time) as lastTime
        BY OpCode EventCode ComputerName
           Message
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `print_spooler_adding_a_printer_driver_filter`
how_to_implement: You will need to ensure PrintService Admin and Operational logs are being logged to Splunk from critical or all systems.
known_false_positives: No false positives have been identified at this time.
references:
    - https://twitter.com/MalwareJake/status/1410421445608476679?s=20
    - https://www.truesec.com/hub/blog/fix-for-printnightmare-cve-2021-1675-exploit-to-keep-your-print-servers-running-while-a-patch-is-not-available
    - https://www.truesec.com/hub/blog/exploitable-critical-rce-vulnerability-allows-regular-users-to-fully-compromise-active-directory-printnightmare-cve-2021-1675
    - https://www.reddit.com/r/msp/comments/ob6y02/critical_vulnerability_printnightmare_exposes
finding:
    title: Suspicious print driver was loaded on endpoint $ComputerName$.
    entity:
        field: ComputerName
        type: system
        score: 50
analytic_story:
    - PrintNightmare CVE-2021-34527
    - Black Basta Ransomware
asset_type: Endpoint
cve:
    - CVE-2021-34527
    - CVE-2021-1675
mitre_attack_id:
    - T1547.012
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`printservice` EventCode=316 category = "Adding a printer driver" Message = "*kernelbase.dll,*" Message = "*UNIDRV.DLL,*" Message = "*.DLL.*"

Stage 2: stats

| stats  count min(_time) as firstTime max(_time) as lastTime
    BY OpCode EventCode ComputerName
       Message

Stage 3: search

| `security_content_ctime(firstTime)`

Stage 4: search

| `security_content_ctime(lastTime)`

Stage 5: search

| `print_spooler_adding_a_printer_driver_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 316 corpus 2 (splunk 2)
field:"EventID" kind:eq value:"316"
Messageeq
  • "*.DLL.*"
  • "*UNIDRV.DLL,*"
  • "*kernelbase.dll,*"
field:"Message" kind:eq
categoryeq
  • "Adding a printer driver"
field:"category" kind:eq