Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Legionlocker

Detects LegionLocker ransomware

MalwareLegionlockerditekSHen 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 LegionLocker ransomware

Associated malware family: Legionlocker.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-legionlocker.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Legionlocker : FILE
{
	meta:
		description = "Detects LegionLocker ransomware"
		author = "ditekSHen"
		id = "4e5c50d0-808e-5adb-bce9-804ddf66ca61"
		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#L5111-L5129"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "2da897b5603415f14fff134b3a94d77e6963da79e117d26ba16e6b04e45f4045"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$m1 = "+Do not run task manager, powershell, cmd etc." ascii wide
		$m2 = "3 hours your files will be deleted." ascii wide
		$m3 = "files have been encrypted by Legion Locker" ascii wide
		$s1 = "passwordBytes" fullword ascii
		$s2 = "_start_enc_" ascii
		$s3 = "_del_desktop_" ascii
		$s4 = "Processhacker" wide
		$s5 = "/k color 47 && del /f /s /q %userprofile%\\" wide
		$s6 = "Submit code" fullword wide
		$pdb1 = "\\obj\\Debug\\LegionLocker.pdb" ascii
		$pdb2 = "\\obj\\Release\\LegionLocker.pdb" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( 1 of ( $m* ) or 1 of ( $pdb* ) or 4 of ( $s* ) )
}

Strings (11 patterns)

IdentifierTypeValueModifiers
$m1text"+Do not run task manager, powershell, cmd etc."ascii wide
$m2text"3 hours your files will be deleted."ascii wide
$m3text"files have been encrypted by Legion Locker"ascii wide
$s1text"passwordBytes"fullword ascii
$s2text"_start_enc_"ascii
$s3text"_del_desktop_"ascii
$s4text"Processhacker"wide
$s5text"/k color 47 && del /f /s /q %userprofile%\\"wide
$s6text"Submit code"fullword wide
$pdb1text"\\obj\\Debug\\LegionLocker.pdb"ascii
$pdb2text"\\obj\\Release\\LegionLocker.pdb"ascii

Condition

uint16( 0 ) == 0x5a4d and ( 1 of ( $m* ) or 1 of ( $pdb* ) or 4 of ( $s* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 1 patterns in ( $m* ) must match.
  • At least 1 patterns in ( $pdb* ) must match.
  • At least 4 patterns in ( $s* ) 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: 4e5c50d0-808e-5adb-bce9-804ddf66ca61

Tags:FILE