This detection identifies the execution of the KeyFinder utility, which adversaries often leverage to enumerate and extract cryptographic keys from memory or file systems during early reconnaissance phases. Proactively hunting for this activity in Azure Sentinel is critical because its low severity classification may cause it to be overlooked as benign, allowing attackers to silently gather sensitive credentials before escalating their lateral movement.
rule keyfinder_tool
{
meta:
author = "@patrickrolsen"
reference = "Magical Jelly Bean KeyFinder"
strings:
$s1 = "chgxp.vbs"
$s2 = "officekey.exe"
$s3 = "findkey.exe"
$s4 = "xpkey.exe"
condition:
uint16(0) == 0x5A4D and 2 of ($s*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 4 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the keyfinder_tool detection rule in an enterprise environment, along with suggested filters or exclusions:
Enterprise Endpoint Management Deployments
ccmexec.exe or IvantiAgentService.exe) and restrict the alert scope to specific OU (Organizational Unit) paths where this deployment is active, excluding the rule for these parent-child relationships.Automated License Compliance Audits
keyfinder.exe with elevated privileges to scan for Microsoft Office and Windows Server license keys, storing the output in a shared audit folder (\\AuditServer\Compliance).TaskScheduler.exe) where the command line arguments contain specific flags (e.g., -audit or -output:csv) and the execution path matches the known audit server hostname.Software Asset Management (SAM) Scanning Agents
keyfinder_tool to extract detailed