This detection identifies adversary behavior where malicious scripts execute self-deletion mechanisms to erase forensic artifacts and evade post-incident analysis within Azure Sentinel. Proactively hunting for this pattern is critical because early identification of these “suicide” scripts allows analysts to reconstruct deleted code before it disappears, significantly reducing the window for lateral movement and data exfiltration.
rule SuicideScriptR
{
// joanap, joanapCleaner
meta:
copyright = "2015 Novetta Solutions"
author = "Novetta Threat Research & Interdiction Group - [email protected]"
strings:
$ = ":R\nIF NOT EXIST %s GOTO E\ndel /a %s\nGOTO R\n:E\ndel /a d.bat"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
Here are 5 specific false positive scenarios for the SuicideScriptR detection rule in an enterprise environment, including suggested filters and exclusions:
Endpoint Protection Self-Update Mechanism
C:\Program Files\CrowdStrike\fsagent.exe or MsMpEng.exe) combined with a specific Command Line Argument containing keywords like /update, /scan, or --self-repair. Additionally, exclude file paths within the vendor’s installation directory (e.g., C:\ProgramData\Microsoft\Windows Defender).ITSM Automated Patch Deployment
HKLM\SOFTWARE\Policies, and may restart specific services (like wuauserv) to finalize the installation, mimicking “suicide” behavior where the orchestrator manages its own lifecycle during the update cycle.svchost.exe running under TaskScheduler) and the User Account belongs to a dedicated service account (e.g., DOMAIN\PatchAdmin$). Exclude file modifications occurring in the C:\Windows\SoftwareDistribution directory.Configuration Management Drift Correction