YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Hive
Detects Hive ransomware
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 73
What this rule detects
Detects Hive ransomware
Associated malware family: Hive.
Targets: Windows PE.
It defines 30 patterns (30 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-hive.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Hive : FILE
{
meta:
= "Detects Hive ransomware"
= "ditekSHen"
= "7b79dc54-01c7-5667-acf5-a32cd7a45b54"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L6610-L6647"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "14c20ff2fa62d80eed0f4f364e24d93d493d4f3b47f664983714940afa74046f"
= 75
= 73
= "FILE"
strings:
$url1 = "http://hivecust" ascii
$url2 = "http://hiveleakdb" ascii
$s1 = "encrypt_files.go" ascii
$s2 = "erase_key.go" ascii
$s3 = "kill_processes.go" ascii
$s4 = "remove_shadow_copies.go" ascii
$s5 = "stop_services_windows.go" ascii
$s6 = "remove_itself_windows.go" ascii
$x1 = "/encryptor/" ascii
$x2 = "HOW_TO_DECRYPT.txt" ascii
$x3 = "FilesEncrypted" fullword ascii
$x4 = "EncryptionStarted" fullword ascii
$x5 = "encryptFilesGroup" fullword ascii
$x6 = "Your data will be undecryptable" ascii
$x7 = "- Do not fool yourself. Encryption has perfect secrecy" ascii
$v1_1 = ".EncryptFiles." ascii
$v1_2 = ".EncryptFilename." ascii
$v1_3 = ")*struct { F uintptr; .autotmp_14 string }" ascii
$v1_4 = "D*struct { F uintptr; data *[]uint8; seed *uint8; fnc *main.decFunc }" ascii
$v1_5 = "golang.org/x/sys/windows.getSystemWindowsDirectory" ascii
$v1_6 = "path/filepath.WalkDir" ascii
$v2_1 = "taskkill /f /im" ascii
$v2_2 = "schtasks /delete /tn" ascii
$v2_3 = "encfile.txt" ascii
$v2_4 = "README.html" ascii
$v2_5 = "total encrypt %v/%v" ascii
$v2_6 = "<b>ITSSHOWKEY</b>" ascii
$v2_7 = "Recovery your files." ascii
$v2_8 = "yaml:\"send_host\"" ascii
$v2_9 = "yaml:\"ignore_dir\"" ascii
condition:
uint16( 0 ) == 0x5a4d and ( all of ( $url* ) or all of ( $s* ) or 4 of ( $x* ) or 5 of ( $v1* ) or 5 of ( $v2* ) or ( 4 of ( $v2* ) and #v2_1 > 10 ) )
}
Strings (30 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $url1 | text | "http://hivecust" | ascii |
| $url2 | text | "http://hiveleakdb" | ascii |
| $s1 | text | "encrypt_files.go" | ascii |
| $s2 | text | "erase_key.go" | ascii |
| $s3 | text | "kill_processes.go" | ascii |
| $s4 | text | "remove_shadow_copies.go" | ascii |
| $s5 | text | "stop_services_windows.go" | ascii |
| $s6 | text | "remove_itself_windows.go" | ascii |
| $x1 | text | "/encryptor/" | ascii |
| $x2 | text | "HOW_TO_DECRYPT.txt" | ascii |
| $x3 | text | "FilesEncrypted" | fullword ascii |
| $x4 | text | "EncryptionStarted" | fullword ascii |
| $x5 | text | "encryptFilesGroup" | fullword ascii |
| $x6 | text | "Your data will be undecryptable" | ascii |
| $x7 | text | "- Do not fool yourself. Encryption has perfect secrecy" | ascii |
| $v1_1 | text | ".EncryptFiles." | ascii |
| $v1_2 | text | ".EncryptFilename." | ascii |
| $v1_3 | text | ")*struct { F uintptr; .autotmp_14 string }" | ascii |
| $v1_4 | text | "D*struct { F uintptr; data *[]uint8; seed *uint8; fnc *main.decFunc }" | ascii |
| $v1_5 | text | "golang.org/x/sys/windows.getSystemWindowsDirectory" | ascii |
| $v1_6 | text | "path/filepath.WalkDir" | ascii |
| $v2_1 | text | "taskkill /f /im" | ascii |
| $v2_2 | text | "schtasks /delete /tn" | ascii |
| $v2_3 | text | "encfile.txt" | ascii |
| $v2_4 | text | "README.html" | ascii |
| $v2_5 | text | "total encrypt %v/%v" | ascii |
| $v2_6 | text | "<b>ITSSHOWKEY</b>" | ascii |
| $v2_7 | text | "Recovery your files." | ascii |
| $v2_8 | text | "yaml:\"send_host\"" | ascii |
| $v2_9 | text | "yaml:\"ignore_dir\"" | ascii |
Condition
uint16( 0 ) == 0x5a4d and ( all of ( $url* ) or all of ( $s* ) or 4 of ( $x* ) or 5 of ( $v1* ) or 5 of ( $v2* ) or ( 4 of ( $v2* ) and #v2_1 > 10 ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- All patterns in ( $url* ) must match.
- All patterns in ( $s* ) must match.
- At least 4 patterns in ( $x* ) must match.
- At least 5 patterns in ( $v1* ) must match.
- At least 5 patterns in ( $v2* ) must match.
- At least 4 patterns in ( $v2* ) must match.
- Pattern $v2_1 must occur > 10 times.
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: 7b79dc54-01c7-5667-acf5-a32cd7a45b54
Tags:FILE
Related rules
- Suspicious / huntingditekSHen detection· ditekSHen· 2021-01-21
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- 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