Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Lokilocker

Detects LokiLocker ransomware

MalwareLokilockerditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
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:
		description = "Detects LokiLocker ransomware"
		author = "ditekSHen"
		id = "4f4927c5-79e6-5c5a-b84d-c4728affe9e1"
		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#L9169-L9194"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "bf78f5e8f40c1a19f6b078a85854e95d5ef1f321393a831edda17b0d65515da7"
		score = 75
		quality = 75
		tags = "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)

IdentifierTypeValueModifiers
$x1text"SOFTWARE\\Loki"fullword wide
$x2text"Cpriv.Loki"fullword wide
$x3text"Loki/"wide
$x4regex/loki(\s)?locker/fullword wide nocase
$s1text"Restore-My-Files.txt"wide
$s2text"loading encryption keys"wide
$s3text"Kill switch -> enabled"wide
$s4text"ScanSMBShares"fullword ascii
$s5text"RewriteMBR"fullword ascii
$s6regex/Encrypt(Drives|File|WinVolume|OsDrive)/fullword ascii
$n1text"unique-id="ascii wide
$n2text"&disk-size="ascii wide
$n3text"&user=Darwin&cpu-name="ascii wide
$n4text"&ram-size="ascii wide
$n5text"&os-name="ascii wide
$n6text"&chat-id="ascii wide
$n7text"&msg-id="ascii wide
$n8text"&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.

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: 4f4927c5-79e6-5c5a-b84d-c4728affe9e1

Tags:FILE

More Lokilocker rules