Forked from olafhartong/2021-1675-spooler-imageloads.kql
Created
July 6, 2021 00:31
-
-
Save zyrone27/b186c37f08b4db28dc5f53beff108df8 to your computer and use it in GitHub Desktop.
2021-1675 - PrintNightmare KQL - MDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let serverlist=DeviceInfo | |
| where DeviceType != "Workstation" | |
| distinct DeviceId; | |
let suspiciousdrivers=DeviceImageLoadEvents | |
| where DeviceId in (serverlist) | |
| where FolderPath startswith @"c:\windows\system32\spool\drivers" | |
| distinct SHA1 | |
| invoke FileProfile(SHA1, 1000) | |
| where GlobalPrevalence < 50 and IsRootSignerMicrosoft != 1 and SignatureState != "SignedValid"; | |
suspiciousdrivers | |
| join kind=inner (DeviceImageLoadEvents | |
| where DeviceId in (serverlist) | |
| where FolderPath startswith @"c:\windows\system32\spool\drivers") on SHA1 | |
| where InitiatingProcessFileName != "ccmexec.exe" | |
// Optionally filter for only the print spooler to load the driver to make it specific to this attack | |
//| where InitiatingProcessFileName == "spoolsv.exe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment