YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Cratpluginransomhansom
Detects CRAT Hansom Ransomware plugin DLL
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 73
What this rule detects
Detects CRAT Hansom Ransomware plugin DLL
Associated malware family: Cratpluginransomhansom.
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-cratpluginransomhansom.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Cratpluginransomhansom : FILE
{
meta:
= "Detects CRAT Hansom Ransomware plugin DLL"
= "ditekSHen"
= "0bfc97df-545f-5453-afe0-5777dc1c95b4"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L2002-L2020"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "b22f6d22630f311241634513eb051df2b36af84a938c1ae1f5284e5a5d7d3077"
= 75
= 73
= "FILE"
strings:
$cmd1 = "/f /im \"%s\"" wide
$cmd2 = "add HKLM\\%s /v %s /t REG_DWORD /d %d /F" wide
$cmd3 = "add HKCU\\%s /v %s /t REG_DWORD /d %d /F" wide
$cmd4 = "\"%s\" a -y -ep -k -r -s -ibck -df -m0 -hp%s -ri1:%d \"%s\" \"%s\"" wide
$s1 = "\\hansom.jpg" wide
$s2 = "HansomMain" fullword ascii wide
$s3 = "ExtractHansom" fullword ascii wide
$s4 = "Hansom2008" fullword ascii
$s5 = ".hansomkey" fullword wide
$s6 = ".hansom" fullword wide
$s7 = /Ransom_(x64|x32|Win64|Win32)_DllRelease\.dll/ fullword ascii
condition:
uint16( 0 ) == 0x5a4d and ( ( 2 of ( $cmd* ) and 2 of ( $s* ) ) or ( 4 of ( $s* ) and 1 of ( $cmd* ) ) or 6 of them )
}
Strings (11 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $cmd1 | text | "/f /im \"%s\"" | wide |
| $cmd2 | text | "add HKLM\\%s /v %s /t REG_DWORD /d %d /F" | wide |
| $cmd3 | text | "add HKCU\\%s /v %s /t REG_DWORD /d %d /F" | wide |
| $cmd4 | text | "\"%s\" a -y -ep -k -r -s -ibck -df -m0 -hp%s -ri1:%d \"%s\" \"%s\"" | wide |
| $s1 | text | "\\hansom.jpg" | wide |
| $s2 | text | "HansomMain" | fullword ascii wide |
| $s3 | text | "ExtractHansom" | fullword ascii wide |
| $s4 | text | "Hansom2008" | fullword ascii |
| $s5 | text | ".hansomkey" | fullword wide |
| $s6 | text | ".hansom" | fullword wide |
| $s7 | regex | /Ransom_(x64|x32|Win64|Win32)_DllRelease\.dll/ | fullword ascii |
Condition
uint16( 0 ) == 0x5a4d and ( ( 2 of ( $cmd* ) and 2 of ( $s* ) ) or ( 4 of ( $s* ) and 1 of ( $cmd* ) ) or 6 of them )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 2 patterns in ( $cmd* ) must match.
- At least 2 patterns in ( $s* ) must match.
- At least 4 patterns in ( $s* ) must match.
- At least 1 patterns in ( $cmd* ) must match.
- 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: 0bfc97df-545f-5453-afe0-5777dc1c95b4
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