This detection targets adversaries executing self-deleting scripts to erase forensic artifacts and evade post-incident analysis within Azure Sentinel. Proactive hunting for this behavior is essential to identify early-stage persistence mechanisms that might otherwise remain undetected due to their low-severity classification and transient nature.
rule SuicideScriptR1_Multi
{
meta:
copyright = "2015 Novetta Solutions"
author = "Novetta Threat Research & Interdiction Group - trig@novetta.com"
strings:
$ = "\" goto R1\ndel /a \""
$ = "\"\nif exist \""
$ = "@echo off\n:R1\ndel /a \""
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
Here are 5 specific false positive scenarios for the SuicideScriptR1_Multi detection rule in an enterprise environment, along with suggested filters or exclusions:
Antivirus Self-Update and Service Restart
WdNisSvc service. These scripts often include commands like Stop-Service, Remove-Job, and del .\*.exe within the same execution context, mimicking a “suicide” script designed to disable security controls before deleting itself.C:\Program Files\CrowdStrike\, C:\ProgramData\Microsoft Defender) and specifically whitelist the parent process names (csfalcon.exe, MsMpEng.exe). Additionally, exclude scripts containing standard update keywords like “Update,” “Signature,” or “Patch” in the script body.Scheduled IT Asset Cleanup Jobs
ParentProcessName is svchost.exe or TaskSchedulerService and the UserAccount matches a dedicated service account (e.g., svc-it-maintenance). Exclude script paths located in standard system directories like C:\Windows\System32\Tasks or `C:\ProgramData\Microsoft