YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_PWSH_Poshkeylogger
Detects PowerShell PoshKeylogger
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects PowerShell PoshKeylogger
Associated malware family: PWSH.
It defines 8 patterns (8 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-pwsh-poshkeylogger.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_PWSH_Poshkeylogger
{
meta:
= "Detects PowerShell PoshKeylogger"
= "ditekSHen"
= "a816d716-caeb-5f08-9043-29db531f9e7c"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L4612-L4627"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "20bde87ded7e3b68bc554c4b9a6c2ef08514f0d47b6b144763927bede81ea540"
= 75
= 75
= ""
strings:
$s1 = "::GetKeyboardState" ascii
$s2 = "GetAsyncKeyState(" ascii
$s3 = "::MapVirtualKey(" ascii
$s4 = "::GetAsyncKeyState" ascii
$s5 = "Start-Sleep" ascii
$s6 = "send-mailmessage" ascii
$s7 = "[System.IO.File]::AppendAllText($" ascii
$s8 = "new-object Management.Automation.PSCredential $" ascii
condition:
6 of them
}
Strings (8 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "::GetKeyboardState" | ascii |
| $s2 | text | "GetAsyncKeyState(" | ascii |
| $s3 | text | "::MapVirtualKey(" | ascii |
| $s4 | text | "::GetAsyncKeyState" | ascii |
| $s5 | text | "Start-Sleep" | ascii |
| $s6 | text | "send-mailmessage" | ascii |
| $s7 | text | "[System.IO.File]::AppendAllText($" | ascii |
| $s8 | text | "new-object Management.Automation.PSCredential $" | ascii |
Condition
6 of themIn plain words (Heuristic)
- At least 6 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: a816d716-caeb-5f08-9043-29db531f9e7c
Related rules
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2034-02-17
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06