Executable artefact deleted from a staging directory
AN0392 asks for deletion of dropped payloads and evidence files, so the rule pairs the two things Sysmon's FileDelete event actually carries: the path the deleted file sat in and its extension. The path list is MITRE's `FilePathPattern` knob, populated here with the world-writable and per-user staging directories a payload is normally dropped into, and the extension list restricts matches to executable and script content, because deletion of documents and data from those same directories is constant and carries no signal. A second, separate selection matches the secure-deletion utility named in MITRE's own technique description by `Image` alone, with no path or extension gate, because that tool renames a file repeatedly before unlinking it and the recorded `TargetFilename` is therefore not the name the payload was dropped under. Limits: Sysmon is not present in a default install, and FileDelete (EventID 23/26) is off or heavily path-restricted in most published configurations, so this rule returns nothing until those directories are in scope — zero rows means blind, not quiet. The rule is written in the Sysmon FileDelete vocabulary the brief names, `TargetFilename` and `Image`; the brief's Security 4663 leg is mapped onto the Sysmon-shaped `file_event` category but splits the same data across `ObjectName` and `ProcessName`, so it needs a field mapping and a SACL on each directory before it could carry this logic at all, and cannot simply be substituted. A payload deleted from a directory outside the list, or one that never had an executable extension, is not seen. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0140, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceFileEvents| where (((FolderPath contains "\\AppData\\Local\\Temp\\" or FolderPath contains "\\AppData\\Roaming\\" or FolderPath contains "\\Windows\\Temp\\" or FolderPath contains "\\Users\\Public\\" or FolderPath contains "\\ProgramData\\" or FolderPath contains "\\PerfLogs\\") and (FolderPath endswith ".exe" or FolderPath endswith ".dll" or FolderPath endswith ".ps1" or FolderPath endswith ".bat" or FolderPath endswith ".cmd" or FolderPath endswith ".vbs" or FolderPath endswith ".js" or FolderPath endswith ".hta" or FolderPath endswith ".scr")) or (InitiatingProcessFolderPath endswith "\\sdelete.exe" or InitiatingProcessFolderPath endswith "\\sdelete64.exe"))
Splunk · SPL
Run this as a search.
index=* (((TargetFilename="*\\AppData\\Local\\Temp\\*" OR TargetFilename="*\\AppData\\Roaming\\*" OR TargetFilename="*\\Windows\\Temp\\*" OR TargetFilename="*\\Users\\Public\\*" OR TargetFilename="*\\ProgramData\\*" OR TargetFilename="*\\PerfLogs\\*") AND (TargetFilename="*.exe" OR TargetFilename="*.dll" OR TargetFilename="*.ps1" OR TargetFilename="*.bat" OR TargetFilename="*.cmd" OR TargetFilename="*.vbs" OR TargetFilename="*.js" OR TargetFilename="*.hta" OR TargetFilename="*.scr")) OR (Image="*\\sdelete.exe" OR Image="*\\sdelete64.exe"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (((TO_LOWER(file.path) LIKE "*\\\\appdata\\\\local\\\\temp\\\\*" OR TO_LOWER(file.path) LIKE "*\\\\appdata\\\\roaming\\\\*" OR TO_LOWER(file.path) LIKE "*\\\\windows\\\\temp\\\\*" OR TO_LOWER(file.path) LIKE "*\\\\users\\\\public\\\\*" OR TO_LOWER(file.path) LIKE "*\\\\programdata\\\\*" OR TO_LOWER(file.path) LIKE "*\\\\perflogs\\\\*") AND (TO_LOWER(file.path) LIKE "*.exe" OR TO_LOWER(file.path) LIKE "*.dll" OR TO_LOWER(file.path) LIKE "*.ps1" OR TO_LOWER(file.path) LIKE "*.bat" OR TO_LOWER(file.path) LIKE "*.cmd" OR TO_LOWER(file.path) LIKE "*.vbs" OR TO_LOWER(file.path) LIKE "*.js" OR TO_LOWER(file.path) LIKE "*.hta" OR TO_LOWER(file.path) LIKE "*.scr")) OR (TO_LOWER(process.executable) LIKE "*\\\\sdelete.exe" OR TO_LOWER(process.executable) LIKE "*\\\\sdelete64.exe"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,file_delete,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <!-- 2 rules: the Sigma condition ORs across different fields, which one rule cannot express. Any one matching is a hit. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="TargetFilename" type="pcre2">(?i)(\\AppData\\Local\\Temp\\|\\AppData\\Roaming\\|\\Windows\\Temp\\|\\Users\\Public\\|\\ProgramData\\|\\PerfLogs\\)</field> <field name="TargetFilename" type="pcre2">(?i)(\.exe$|\.dll$|\.ps1$|\.bat$|\.cmd$|\.vbs$|\.js$|\.hta$|\.scr$)</field> <description>Executable artefact deleted from a staging directory (1/2)</description> <mitre> <id>T1070.004</id> </mitre> </rule> <rule id="100001" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\sdelete\.exe$|\\sdelete64\.exe$)</field> <description>Executable artefact deleted from a staging directory (2/2)</description> <mitre> <id>T1070.004</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.