Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Lockfile

Detects LockFile ransomware

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

What this rule detects

Detects LockFile ransomware

Associated malware family: Lockfile.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-lockfile.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Lockfile : FILE
{
	meta:
		description = "Detects LockFile ransomware"
		author = "ditekSHen"
		id = "762ac376-43ff-56d2-b279-2879ce6d8542"
		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#L7998-L8014"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "28c8aa8931d599e5a1860fe2ed0b8172e709dad1a48a319858a907fa775af293"
		score = 75
		quality = 71
		tags = "FILE"

	strings:
		$x1 = "LOCKFILE" fullword ascii
		$x2 = "25a01bb859125507013a2fe9737d3c33" fullword ascii
		$s1 = "</key>" fullword ascii
		$s2 = "<computername>%s</computername>" fullword ascii
		$s3 = "<blocknum>%d</blocknum>" fullword ascii
		$s4 = "%s\\%s-%s-%d%s" fullword ascii
		$s5 = ">RAC=OQD:S>P@:AO?R:EEOS:ARDD=N?EENSB" ascii wide
		$m1 = "<title>LOCKFILE</title>" ascii wide nocase
		$m2 = "<hta:application id=LOCKFILE applicationName=LOCKFILE" ascii wide nocase

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or all of ( $s* ) or ( 1 of ( $x* ) and ( 2 of ( $s* ) or 1 of ( $m* ) ) ) or ( 1 of ( $m* ) and ( 1 of ( $x* ) or 2 of ( $s* ) ) ) )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$x1text"LOCKFILE"fullword ascii
$x2text"25a01bb859125507013a2fe9737d3c33"fullword ascii
$s1text"</key>"fullword ascii
$s2text"<computername>%s</computername>"fullword ascii
$s3text"<blocknum>%d</blocknum>"fullword ascii
$s4text"%s\\%s-%s-%d%s"fullword ascii
$s5text">RAC=OQD:S>P@:AO?R:EEOS:ARDD=N?EENSB"ascii wide
$m1text"<title>LOCKFILE</title>"ascii wide nocase
$m2text"<hta:application id=LOCKFILE applicationName=LOCKFILE"ascii wide nocase

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or all of ( $s* ) or ( 1 of ( $x* ) and ( 2 of ( $s* ) or 1 of ( $m* ) ) ) or ( 1 of ( $m* ) and ( 1 of ( $x* ) or 2 of ( $s* ) ) ) )

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 2 patterns in ( $s* ) must match.
  • At least 1 patterns in ( $m* ) 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: 762ac376-43ff-56d2-b279-2879ce6d8542

Tags:FILE

More Lockfile rules