YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Nppspy
Detects NPPSpy / Ntospy
- Author
- ditekShen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects NPPSpy / Ntospy
Associated malware family: Nppspy.
Targets: Windows PE.
It defines 11 patterns (11 text, 0 hex, 0 regex). YARA modules used: pe.
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
import "pe"
rule DITEKSHEN_MALWARE_Win_Nppspy : FILE
{
meta:
= "Detects NPPSpy / Ntospy"
= "ditekShen"
= "3867ba96-1162-5693-b58e-fc6fa04d880a"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L11305-L11325"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "53e929b52dddd5e3d060d2dd9937411f1ff215be4d3c67f5935c2a3fbab006d6"
= 75
= 75
= "FILE"
strings:
$s1 = "ntskrnl.dll" fullword ascii
$s2 = "PasswordStealing.dll" fullword ascii
$s3 = "ntoskrnl.dll" fullword ascii
$s4 = "\\programdata\\packag~" ascii
$s5 = "NPPSPY.dll" fullword ascii
$s6 = "MSControll.dll" fullword ascii
$s7 = "\\Windows\\Temp\\" ascii
$s8 = "\\NPPSpy\\" ascii
$s9 = "NPGetCaps" fullword ascii
$s10 = "NPLogonNotify" fullword ascii
$path = "\\GrzegorzTworek\\" ascii
condition:
uint16( 0 ) == 0x5a4d and ( ( pe.is_dll ( ) and filesize < 110KB and pe.number_of_exports == 2 and ( ( pe.exports ( "NPGetCaps" ) and pe.exports ( "NPLogonNotify" ) ) or ( 1 of ( $s* ) and ( pe.exports ( "NPGetCaps" ) or pe.exports ( "NPLogonNotify" ) ) ) ) ) or ( ( $path ) and any of ( $s* ) ) )
}
Strings (11 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "ntskrnl.dll" | fullword ascii |
| $s2 | text | "PasswordStealing.dll" | fullword ascii |
| $s3 | text | "ntoskrnl.dll" | fullword ascii |
| $s4 | text | "\\programdata\\packag~" | ascii |
| $s5 | text | "NPPSPY.dll" | fullword ascii |
| $s6 | text | "MSControll.dll" | fullword ascii |
| $s7 | text | "\\Windows\\Temp\\" | ascii |
| $s8 | text | "\\NPPSpy\\" | ascii |
| $s9 | text | "NPGetCaps" | fullword ascii |
| $s10 | text | "NPLogonNotify" | fullword ascii |
| $path | text | "\\GrzegorzTworek\\" | ascii |
Condition
uint16( 0 ) == 0x5a4d and ( ( pe.is_dll ( ) and filesize < 110KB and pe.number_of_exports == 2 and ( ( pe.exports ( "NPGetCaps" ) and pe.exports ( "NPLogonNotify" ) ) or ( 1 of ( $s* ) and ( pe.exports ( "NPGetCaps" ) or pe.exports ( "NPLogonNotify" ) ) ) ) ) or ( ( $path ) and any of ( $s* ) ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- The file must be smaller than 110KB (a cheap guard that skips large files).
- At least one pattern in ( $s* ) must match.
- At least 1 patterns in ( $s* ) must match.
- Uses the pe module.
- Checks exported functions or the DLL name.
- Requires a DLL.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
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: 3867ba96-1162-5693-b58e-fc6fa04d880a
Tags:FILE
Related rules
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06
- MalwareditekSHen detection· ditekShen· 2020-11-06