Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Locked

Detects Locked ransomware

MalwareLockedditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 73

What this rule detects

Detects Locked ransomware

Associated malware family: Locked.

Targets: Windows PE.

It defines 9 patterns (8 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-locked.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Locked : FILE
{
	meta:
		description = "Detects Locked ransomware"
		author = "ditekSHen"
		id = "ad2f91ab-9bbb-5d47-a5c3-5a38dbab2ebe"
		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#L9098-L9114"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "b838b996946fb268c66bac68d5e326ff3049340dfb08f2e0a77492df49915d5a"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$x1 = "http://xxxx.onion/xxxx-xxxx-xxxx-xxxx" ascii
		$x2 = "http://pigetrzlperjreyr3fbytm27bljaq4eungv3gdq2tohnoyfrqu4bx5qd.onion" ascii
		$x3 = "dHA6Ly94eHh4Lm9uaW9uL3h4eHgteHh4eC14eHh4LXh4eHg" ascii
		$s1 = "choice /t 1 /d y /n >nul" ascii
		$s2 = ".locked" fullword ascii
		$s3 = "c:\\system volume information" fullword ascii
		$s4 = "__$$RECOVERY_README$$__.html" fullword ascii
		$s5 = "Trunc..." fullword ascii
		$s6 = /C:\\windows\\temp\\[a-z0-9A-Z]{6}\.tmp/ fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or all of ( $s* ) or ( 1 of ( $x* ) and 4 of ( $s* ) ) or ( #s6 > 1 and 4 of them ) )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$x1text"http://xxxx.onion/xxxx-xxxx-xxxx-xxxx"ascii
$x2text"http://pigetrzlperjreyr3fbytm27bljaq4eungv3gdq2tohnoyfrqu4bx5qd.onion"ascii
$x3text"dHA6Ly94eHh4Lm9uaW9uL3h4eHgteHh4eC14eHh4LXh4eHg"ascii
$s1text"choice /t 1 /d y /n >nul"ascii
$s2text".locked"fullword ascii
$s3text"c:\\system volume information"fullword ascii
$s4text"__$$RECOVERY_README$$__.html"fullword ascii
$s5text"Trunc..."fullword ascii
$s6regex/C:\\windows\\temp\\[a-z0-9A-Z]{6}\.tmp/fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or all of ( $s* ) or ( 1 of ( $x* ) and 4 of ( $s* ) ) or ( #s6 > 1 and 4 of them ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $x* ) must match.
  • All patterns in ( $s* ) must match.
  • At least 1 patterns in ( $x* ) must match.
  • At least 4 patterns in ( $s* ) must match.
  • At least 4 patterns in the rule must match.
  • Pattern $s6 must occur > 1 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.

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: ad2f91ab-9bbb-5d47-a5c3-5a38dbab2ebe

Tags:FILE