YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_WSHRATJS
Detects WSHRAT JS variants
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects WSHRAT JS variants
Associated malware family: WSHRATJS.
It defines 10 patterns (10 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-wshratjs.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_WSHRATJS : FILE
{
meta:
= "Detects WSHRAT JS variants"
= "ditekSHen"
= "7dbaea67-48dc-5fb8-ba58-b0d6eeca207b"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L4028-L4045"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "9956ed4613ac403360ab0222a7ed62350fcd998710843bd6700717f8bbb5052e"
= 75
= 75
= "FILE"
strings:
$charset_full = "us-ascii" nocase ascii
$charset_begin = "\"us-\"" nocase ascii
$charset_end = "Array(97,115,99,105,105)" nocase ascii
$wsc_object1 = "WScript.CreateObject(\"System.Text.UTF8Encoding" nocase ascii
$wsc_object2 = "WScript.CreateObject(\"Adodb.Stream" nocase ascii
$wsc_object3 = "WScript.CreateObject(\"Microsoft.XmlDom" nocase ascii
$s1 = "function(){return" ascii
$s2 = "}catch(err){" ascii
$s3 = "{item: \"bin.base64\"}" nocase ascii
$s4 = "* 1].item =" ascii
condition:
filesize < 400KB and ( $charset_full or ( $charset_begin and $charset_end ) ) and 2 of ( $wsc_object* ) and 3 of ( $s* )
}
Strings (10 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $charset_full | text | "us-ascii" | nocase ascii |
| $charset_begin | text | "\"us-\"" | nocase ascii |
| $charset_end | text | "Array(97,115,99,105,105)" | nocase ascii |
| $wsc_object1 | text | "WScript.CreateObject(\"System.Text.UTF8Encoding" | nocase ascii |
| $wsc_object2 | text | "WScript.CreateObject(\"Adodb.Stream" | nocase ascii |
| $wsc_object3 | text | "WScript.CreateObject(\"Microsoft.XmlDom" | nocase ascii |
| $s1 | text | "function(){return" | ascii |
| $s2 | text | "}catch(err){" | ascii |
| $s3 | text | "{item: \"bin.base64\"}" | nocase ascii |
| $s4 | text | "* 1].item =" | ascii |
Condition
filesize < 400KB and ( $charset_full or ( $charset_begin and $charset_end ) ) and 2 of ( $wsc_object* ) and 3 of ( $s* )In plain words (Heuristic)
- The file must be smaller than 400KB (a cheap guard that skips large files).
- At least 2 patterns in ( $wsc_object* ) must match.
- At least 3 patterns in ( $s* ) must match.
- Pattern $charset_full must be present.
- Pattern $charset_begin must be present.
- Pattern $charset_end must be present.
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: 7dbaea67-48dc-5fb8-ba58-b0d6eeca207b
Tags:FILE
Related rules
- 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
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06