Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Wshratplugin

WSHRAT keylogger plugin payload

MalwareWshratpluginditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 75

What this rule detects

WSHRAT keylogger plugin payload

Associated malware family: Wshratplugin.

Targets: Windows PE.

It defines 8 patterns (8 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-wshratplugin.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Wshratplugin : FILE
{
	meta:
		description = "WSHRAT keylogger plugin payload"
		author = "ditekSHen"
		id = "45c4fc87-6c45-5cd7-9fc4-7d3ea664a740"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L1668-L1685"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "3feeab43b58b533b7d2d41a71f2107e6f05b9c54ff805607843d253cadbe9384"
		score = 75
		quality = 75
		tags = "FILE"
		snort_sid = "920010-920012"
		clamav_sig = "MALWARE.Win.Trojan.WSHRAT-KLG"

	strings:
		$s1 = "GET /open-keylogger HTTP/1.1" fullword wide
		$s2 = "KeyboardChange: nCode={0}, wParam={1}, vkCode={2}, scanCode={3}, flags={4}, dwExtraInfo={6}" wide
		$s3 = "MouseChange: nCode={0}, wParam={1}, x={2}, y={3}, mouseData={4}, flags={5}, dwExtraInfo={7}" wide
		$s4 = "sendKeyLog" fullword ascii
		$s5 = "saveKeyLog" fullword ascii
		$s6 = "get_TotalKeyboardClick" fullword ascii
		$s7 = "get_SessionMouseClick" fullword ascii
		$pdb = "\\Android\\documents\\visual studio 2010\\Projects\\Keylogger\\Keylogger\\obj\\x86\\Debug\\Keylogger.pdb" ascii

	condition:
		uint16( 0 ) == 0x5a4d and filesize < 100KB and 4 of them
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$s1text"GET /open-keylogger HTTP/1.1"fullword wide
$s2text"KeyboardChange: nCode={0}, wParam={1}, vkCode={2}, scanCode={3}, flags={4}, dwExtraInfo={6}"wide
$s3text"MouseChange: nCode={0}, wParam={1}, x={2}, y={3}, mouseData={4}, flags={5}, dwExtraInfo={7}"wide
$s4text"sendKeyLog"fullword ascii
$s5text"saveKeyLog"fullword ascii
$s6text"get_TotalKeyboardClick"fullword ascii
$s7text"get_SessionMouseClick"fullword ascii
$pdbtext"\\Android\\documents\\visual studio 2010\\Projects\\Keylogger\\Keylogger\\obj\\x86\\Debug\\Keylogger.pdb"ascii

Condition

uint16( 0 ) == 0x5a4d and filesize < 100KB and 4 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 100KB (a cheap guard that skips large files).
  • At least 4 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.

Open in editor

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).

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 45c4fc87-6c45-5cd7-9fc4-7d3ea664a740

Metadata

snort_sid920010-920012
clamav_sigMALWARE.Win.Trojan.WSHRAT-KLG

Tags:FILE