YARA · ditekSHen detection
DITEKSHEN_INDICATOR_TOOL_EXP_Sharpprintnightmare
Detect SharpPrintNightmare
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-09-25
- Score / Quality
- 75 / 75
What this rule detects
Detect SharpPrintNightmare
Targets: Windows PE.
It defines 13 patterns (12 text, 1 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
indicator-tool-exp-sharpprintnightmare.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_EXP_Sharpprintnightmare : FILE
{
meta:
= "Detect SharpPrintNightmare"
= "ditekSHen"
= "15f52fce-27cc-52e7-91d5-7e2f6db5b596"
= "2020-11-06"
= "2024-09-25"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/indicator_tools.yar#L941-L961"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "22c890a22ce6b7c1a06068018364f7c5a2afe1bee5b5bc6a8bae3703a11fac26"
= 75
= 75
= "FILE"
strings:
$s1 = "RevertToSelf() Error:" wide
$s2 = "NeverGonnaGiveYou" wide
$s3 = "\\Amd64\\UNIDRV.DLL" wide
$s4 = ":\\Windows\\System32\\DriverStore\\FileRepository\\" wide
$s5 = "C:\\Windows\\System32\\spool\\drivers\\x64\\3\\old\\{0}\\{1}" wide
$s6 = "\\SharpPrintNightmare\\" ascii
$s7 = { 4e 61 6d 65 09 46 75 6c 6c 54 72 75 73 74 01 }
$s8 = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\PackageInstallation\\Windows x64\\DriverPackages" wide
$s9 = "ntprint.inf_amd64" wide
$s10 = "AddPrinterDriverEx" wide
$s11 = "addPrinter" ascii
$s12 = "DRIVER_INFO_2" ascii
$s13 = "APD_COPY_" ascii
condition:
uint16( 0 ) == 0x5a4d and 7 of them
}
Strings (13 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "RevertToSelf() Error:" | wide |
| $s2 | text | "NeverGonnaGiveYou" | wide |
| $s3 | text | "\\Amd64\\UNIDRV.DLL" | wide |
| $s4 | text | ":\\Windows\\System32\\DriverStore\\FileRepository\\" | wide |
| $s5 | text | "C:\\Windows\\System32\\spool\\drivers\\x64\\3\\old\\{0}\\{1}" | wide |
| $s6 | text | "\\SharpPrintNightmare\\" | ascii |
| $s7 | hex | { 4e 61 6d 65 09 46 75 6c 6c 54 72 75 73 74 01 } | |
| $s8 | text | "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\PackageInstallation\\Windows x64\\DriverPackages" | wide |
| $s9 | text | "ntprint.inf_amd64" | wide |
| $s10 | text | "AddPrinterDriverEx" | wide |
| $s11 | text | "addPrinter" | ascii |
| $s12 | text | "DRIVER_INFO_2" | ascii |
| $s13 | text | "APD_COPY_" | ascii |
Condition
uint16( 0 ) == 0x5a4d and 7 of themIn plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 7 patterns in the rule must match.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.
References
Licence & attribution
Author: ditekSHen
Source repository: ditekSHen detection @ e76c93dcde
Licence: BSD 2-Clause License (repository licence)
Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 15f52fce-27cc-52e7-91d5-7e2f6db5b596
Tags:FILE
Related rules
- Suspicious / huntingditekSHen detection· ditekSHen· 2023-08-22
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21