YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Lokilocker
Detects LokiLocker ransomware
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects LokiLocker ransomware
Associated malware family: Lokilocker.
Targets: Windows PE.
It defines 18 patterns (16 text, 0 hex, 2 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-lokilocker.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Lokilocker : FILE
{
meta:
= "Detects LokiLocker ransomware"
= "ditekSHen"
= "4f4927c5-79e6-5c5a-b84d-c4728affe9e1"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L9169-L9194"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "bf78f5e8f40c1a19f6b078a85854e95d5ef1f321393a831edda17b0d65515da7"
= 75
= 75
= "FILE"
strings:
$x1 = "SOFTWARE\\Loki" fullword wide
$x2 = "Cpriv.Loki" fullword wide
$x3 = "Loki/" wide
$x4 = /loki(\s)?locker/ fullword wide nocase
$s1 = "Restore-My-Files.txt" wide
$s2 = "loading encryption keys" wide
$s3 = "Kill switch -> enabled" wide
$s4 = "ScanSMBShares" fullword ascii
$s5 = "RewriteMBR" fullword ascii
$s6 = /Encrypt(Drives|File|WinVolume|OsDrive)/ fullword ascii
$n1 = "unique-id=" ascii wide
$n2 = "&disk-size=" ascii wide
$n3 = "&user=Darwin&cpu-name=" ascii wide
$n4 = "&ram-size=" ascii wide
$n5 = "&os-name=" ascii wide
$n6 = "&chat-id=" ascii wide
$n7 = "&msg-id=" ascii wide
$n8 = "&elapsed-time=" ascii wide
condition:
uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or 4 of ( $s* ) or 6 of ( $n* ) or ( 3 of ( $s* ) and 3 of ( $n* ) ) or ( 1 of ( $x* ) and ( 2 of ( $s* ) or 2 of ( $n* ) ) ) )
}
Strings (18 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $x1 | text | "SOFTWARE\\Loki" | fullword wide |
| $x2 | text | "Cpriv.Loki" | fullword wide |
| $x3 | text | "Loki/" | wide |
| $x4 | regex | /loki(\s)?locker/ | fullword wide nocase |
| $s1 | text | "Restore-My-Files.txt" | wide |
| $s2 | text | "loading encryption keys" | wide |
| $s3 | text | "Kill switch -> enabled" | wide |
| $s4 | text | "ScanSMBShares" | fullword ascii |
| $s5 | text | "RewriteMBR" | fullword ascii |
| $s6 | regex | /Encrypt(Drives|File|WinVolume|OsDrive)/ | fullword ascii |
| $n1 | text | "unique-id=" | ascii wide |
| $n2 | text | "&disk-size=" | ascii wide |
| $n3 | text | "&user=Darwin&cpu-name=" | ascii wide |
| $n4 | text | "&ram-size=" | ascii wide |
| $n5 | text | "&os-name=" | ascii wide |
| $n6 | text | "&chat-id=" | ascii wide |
| $n7 | text | "&msg-id=" | ascii wide |
| $n8 | text | "&elapsed-time=" | ascii wide |
Condition
uint16( 0 ) == 0x5a4d and ( 2 of ( $x* ) or 4 of ( $s* ) or 6 of ( $n* ) or ( 3 of ( $s* ) and 3 of ( $n* ) ) or ( 1 of ( $x* ) and ( 2 of ( $s* ) or 2 of ( $n* ) ) ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 2 patterns in ( $x* ) must match.
- At least 4 patterns in ( $s* ) must match.
- At least 6 patterns in ( $n* ) must match.
- At least 3 patterns in ( $s* ) must match.
- At least 3 patterns in ( $n* ) must match.
- At least 1 patterns in ( $x* ) must match.
- At least 2 patterns in ( $s* ) must match.
- At least 2 patterns in ( $n* ) 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: 4f4927c5-79e6-5c5a-b84d-c4728affe9e1
Tags:FILE
Related rules
- Suspicious / huntingditekSHen detection· ditekShen· 2021-01-21
- Suspicious / huntingditekSHen detection· ditekShen· 2021-01-21
- 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