This rule detects the presence of CodeLockvxx, a known malware family often associated with ransomware operations or initial access trojans, by matching its specific code signatures. Proactively hunting for this indicator in Azure Sentinel allows the SOC to identify compromised endpoints or suspicious artifacts before the adversary progresses to lateral movement or encryption, reducing the potential impact of a low-severity but high-impact threat.
rule CodeLockvxx
{
meta:
author="malware-lu"
strings:
$a0 = { 43 4F 44 45 2D 4C 4F 43 4B 2E 4F 43 58 00 }
condition:
$a0 at pe.entry_point
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Scenario: A developer or DevOps engineer uses a commercial code obfuscation tool (e.g., Dotfuscator or ProGuard) to prepare a Java or .NET application for production release, intentionally adding control flow flattening or string encryption that matches the “CodeLock” heuristic.
C:\Builds\Release\, target/, bin/) or exclude processes associated with known build tools (e.g., msbuild.exe, gradle.bat, dotnet.exe) when the file is being written or modified.Scenario: An IT administrator uses a legitimate software protection suite (e.g., Flexera or Thinstall) to create a standalone executable from a complex application, which embeds a licensing or anti-tampering module that mimics the CodeLock signature.
.exe or .dll that are signed by known corporate code-signing certificates (e.g., CN=Contoso IT, O=Contoso Corp) and reside in standard application installation paths (e.g., C:\Program Files\, C:\Program Files (x86)\).Scenario: A scheduled maintenance job runs a custom PowerShell or Python script that uses a library for lightweight code obfuscation or packing (e.g., PyInstaller or Nuitka) to protect internal utility scripts from casual inspection, triggering the YARA rule on the resulting binary.
schtasks.exe or Task Scheduler service) where the parent process is svchost.exe (specifically the Task Scheduler service) and the file path contains keywords like \Scripts\, `\Utilities\