This hunt hypothesis targets adversaries executing the unique custom hashing algorithm associated with the LockBit 4.0 ransomware variant to identify early-stage unpacking activities indicative of an active infection. Proactive hunting for this signature in Azure Sentinel is critical because it enables the SOC team to detect and isolate compromised systems before the encryption phase begins, thereby minimizing potential data loss and operational downtime.
rule mal_lockbit4_hashing_alg_win_feb24
{
meta:
author = "0x0d4y"
description = "This rule detects the custom hashing algorithm of Lockbit4.0 unpacked"
date = "2024-02-16"
score = 100
reference = "https://0x0d4y.blog/lockbit4-0-evasion-tales/"
hash = "062311F136D83F64497FD81297360CD4"
id = "e91aedba-6f70-4ca2-9217-2991cbbc6e8d"
license = "CC BY 4.0"
rule_matching_tlp = "TLP:WHITE"
rule_sharing_tlp = "TLP:WHITE"
malpedia_family = "win.lockbit"
strings:
$hashing_alg = { 41 89 d0 46 0f be 04 00 45 09 c0 74 ?? 45 8d 48 ?? 45 8d 50 ?? 41 80 f9 ?? 45 0f 43 d0 44 31 d1 44 8d 04 3a 45 0f af c2 41 01 c8 89 d1 31 f9 09 d2 0f 44 ca 41 0f af c8 44 01 d1 ff c2 eb ?? 49 ff c6 }
condition:
uint16(0) == 0x5a4d and
$hashing_alg
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Here are 3-5 specific false positive scenarios for the Lockbit4.0 Unpacked Custom Hashing Algorithm detection rule, including suggested filters and exclusions:
Scenario: Enterprise Backup Software Performing Integrity Checks
VeeamAgent.exe, commvault_service.exe) from the detection scope. Additionally, filter out events where the parent process is a known backup scheduler (e.g., vssvc.exe or Task Scheduler triggering vbragent64.exe).Scenario: Antivirus/EDR Deep Scan of Compressed Archives
.zip, .7z, or .tar archives during real-time protection. When these tools extract nested archives, their internal decompression engines may utilize a hashing mechanism that shares statistical similarities with Lockbit4.0’s algorithm, causing the rule to fire on legitimate file extraction events.Cnsys.exe, MsMpEng.exe, Rtvscan64.exe). Furthermore, add a filter to ignore detections where the file extension is `.zip