Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Babuk

Detects Babuk ransomware

MalwareBabukditekSHen 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 Babuk ransomware

Associated malware family: Babuk.

Targets: Windows PE.

It defines 15 patterns (14 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-babuk.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Babuk : FILE
{
	meta:
		description = "Detects Babuk ransomware"
		author = "ditekSHen"
		id = "6bb7093f-bbef-5b43-b4f9-be72ae4ef319"
		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#L3652-L3674"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "5ca5c5106747cf8f4ccd5df4ddbc78321fea3c8f533cb807a704d270eb956007"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "ecdh_pub_k.bin" wide
		$s2 = "How To Restore Your Files.txt" wide
		$s3 = /(babuk|babyk)\s(ransomware|locker)/ ascii nocase
		$s4 = "/login.php?id=" ascii
		$s5 = "http://babuk" ascii
		$s6 = "bootsect.bak" fullword wide
		$s7 = "Can't open file after killHolder" ascii
		$s8 = "Can't OpenProcess" ascii
		$s9 = "DoYouWantToHaveSexWithCuongDong" ascii
		$arg1 = "-lanfirst" fullword ascii
		$arg2 = "-lansecond" fullword ascii
		$arg3 = "-nolan" fullword ascii
		$arg4 = "shares" fullword wide
		$arg5 = "paths" fullword wide
		$arg6 = "gdebug" fullword wide

	condition:
		uint16( 0 ) == 0x5a4d and ( 3 of ( $s* ) or ( 3 of ( $arg* ) and 2 of ( $s* ) ) )
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$s1text"ecdh_pub_k.bin"wide
$s2text"How To Restore Your Files.txt"wide
$s3regex/(babuk|babyk)\s(ransomware|locker)/ascii nocase
$s4text"/login.php?id="ascii
$s5text"http://babuk"ascii
$s6text"bootsect.bak"fullword wide
$s7text"Can't open file after killHolder"ascii
$s8text"Can't OpenProcess"ascii
$s9text"DoYouWantToHaveSexWithCuongDong"ascii
$arg1text"-lanfirst"fullword ascii
$arg2text"-lansecond"fullword ascii
$arg3text"-nolan"fullword ascii
$arg4text"shares"fullword wide
$arg5text"paths"fullword wide
$arg6text"gdebug"fullword wide

Condition

uint16( 0 ) == 0x5a4d and ( 3 of ( $s* ) or ( 3 of ( $arg* ) and 2 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 3 patterns in ( $s* ) must match.
  • At least 3 patterns in ( $arg* ) must match.
  • At least 2 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: 6bb7093f-bbef-5b43-b4f9-be72ae4ef319

Tags:FILE

More Babuk rules