This hypothesis posits that adversaries are deploying destructive cleaning tools to sanitize artifacts or remove evidence following initial compromise activities within Azure Sentinel workloads. Proactive hunting for this specific YARA signature is essential to identify early-stage post-exploitation behaviors before they escalate into significant data loss or forensic challenges, despite the rule’s current low severity classification.
rule DestructiveTargetCleaningTool4
{
strings:
$BATCH_SCRIPT_LN1_0 = "goto x" fullword
$BATCH_SCRIPT_LN1_1 = "del" fullword
$BATCH_SCRIPT_LN2_0 = "if exist" fullword
$BATCH_SCRIPT_LN3_0 = ":x" fullword
$BATCH_SCRIPT_LN4_0 = "zz%d.bat" fullword
condition:
(#BATCH_SCRIPT_LN1_1 == 2) and all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 5 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the DestructiveTargetCleaningTool4 detection rule, tailored for an enterprise environment:
Scheduled System Maintenance by Windows Update Cleanup Utility
Schtasks service triggers a weekly maintenance job on domain-joined workstations that executes cleanmgr.exe (Disk Cleanup) with the /sagerun:1 flag. This tool scans and deletes temporary files, previous Windows update installations (Windows.old), and cached thumbnails, which matches the YARA signature for destructive cleaning behavior.C:\Windows\System32\cleanmgr.exe when launched by the SYSTEM or NT AUTHORITY\NetworkService account during defined maintenance windows (e.g., 02:00–04:00 local time).Enterprise Endpoint Protection Cache Purge
C:\ProgramData\Microsoft\Windows Defender\Scans\History) to free up disk space after large definition updates, triggering the destructive tool signature.MsMpEng.exe (Defender) or C:\Program Files\CrowdStrike\fsagent.exe, specifically when they spawn child processes targeting cache directories under C:\ProgramData.IT Admin Execution of Third-Party Disk Optimization Scripts
cclean64.exe) to perform a one-time deep clean on