Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_WSHRAT

Detects WASHRAT

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

What this rule detects

Detects WASHRAT

Associated malware family: WSHRAT.

Targets: Windows PE.

It defines 11 patterns (10 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-wshrat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_WSHRAT : FILE
{
	meta:
		description = "Detects WASHRAT"
		author = "ditekSHen"
		id = "e7940b7f-51dd-5a32-899b-64310f27bf3e"
		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#L10582-L10600"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "297bfe65815637a464e2a8fc23570c6e79694ffe0467d5898b7c845f1450de95"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$x1 = "WSH Rat v" wide
		$x2 = "SOFTWARE\\WSHRat" wide
		$x3 = "WSH Remote" wide nocase
		$x4 = "WSHRAT" wide nocase
		$s1 = "shellobj.regwrite \"HKEY_" ascii nocase
		$s2 = "shellobj.run(\"%comspec% /c" ascii nocase
		$s3 = "objhttpdownload.setrequestheader \"user-agent:\"," ascii nocase
		$s4 = "WScript.CreateObject(\"Shell.Application\").ShellExecute" ascii nocase
		$s5 = "objwmiservice.ExecQuery(\"select" ascii nocase
		$s6 = "httpobj.open(\"post\",\"http" ascii nocase
		$s7 = /(rdp|keylogger|get-pass|uvnc)\|http/ wide

	condition:
		uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or ( 1 of ( $x* ) and 1 of ( $s* ) ) or ( 6 of ( $s* ) ) )
}

Strings (11 patterns)

IdentifierTypeValueModifiers
$x1text"WSH Rat v"wide
$x2text"SOFTWARE\\WSHRat"wide
$x3text"WSH Remote"wide nocase
$x4text"WSHRAT"wide nocase
$s1text"shellobj.regwrite \"HKEY_"ascii nocase
$s2text"shellobj.run(\"%comspec% /c"ascii nocase
$s3text"objhttpdownload.setrequestheader \"user-agent:\","ascii nocase
$s4text"WScript.CreateObject(\"Shell.Application\").ShellExecute"ascii nocase
$s5text"objwmiservice.ExecQuery(\"select"ascii nocase
$s6text"httpobj.open(\"post\",\"http"ascii nocase
$s7regex/(rdp|keylogger|get-pass|uvnc)\|http/wide

Condition

uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or ( 1 of ( $x* ) and 1 of ( $s* ) ) or ( 6 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 2 patterns in ( $x* ) must match.
  • At least 1 patterns in ( $x* ) must match.
  • At least 1 patterns in ( $s* ) must match.
  • At least 6 patterns in ( $s* ) 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: e7940b7f-51dd-5a32-899b-64310f27bf3e

Tags:FILE

More WSHRAT rules