← Back to SOC feed Coverage →

printnightmare-cve-2021-1675 usage detection (1)

kql MEDIUM Azure-Sentinel
DeviceNetworkEvents
backdoorexploithuntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-21T23:00:01Z · Confidence: medium

Hunt Hypothesis

Unusual file creation activity in the print spooler drivers folder may indicate exploitation of CVE-2021-1675, as attackers often leverage this vulnerability to execute arbitrary code. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential compromise of print spooler services and prevent lateral movement.

KQL Query

DeviceNetworkEvents
| where Timestamp > ago(7d)
| where LocalPort == 445
| summarize RemoteIPCount=dcount(RemoteIP) by DeviceName, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCreationTime

Analytic Rule Definition

id: ec1e131a-79cb-4f5c-b5e6-3edc5574ac68
name: printnightmare-cve-2021-1675 usage detection (1)
description: |
  First query digs in print spooler drivers folder for any file creations,
  MANY OF THE FILES THAT SHOULD COME UP HERE MAY BE LEGIT. Unsigned files
  or ones that don't have any relations to printers that you are using are
  suspicious.
  Second query that can be used for finding client machines that
  could be operating print servers or file servers is also included here.
  As additional mitigation for the exploit you might want to block the
  incoming traffic to the SMB or EPMAP Ports (445) if you need to keep the
  spooler service running to print from clients.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceNetworkEvents
tactics:
- Privilege escalation
- Lateral movement
- Exploit
query: |
  DeviceNetworkEvents
  | where Timestamp > ago(7d)
  | where LocalPort == 445
  | summarize RemoteIPCount=dcount(RemoteIP) by DeviceName, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCreationTime

Required Data Sources

Sentinel TableNotes
DeviceNetworkEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Exploits/printnightmare-cve-2021-1675 usage detection (1).yaml