PowerShell inbox rule created or modified to delete, move or hide mail
Matches AN0551's Windows leg: a PowerShell script block (EventID 4104) that both names the cmdlet MITRE's analytic calls out (`New-InboxRule` or `Set-InboxRule`) and sets one of the parameters that makes the rule actually hide mail rather than merely file it. AN0551's own description names the three verbs this technique performs against a mailbox — delete, move, hide — and `-DeleteMessage`, `-SoftDeleteMessage`, `-MoveToFolder`, `-StopProcessingRules` and `-MarkAsRead` are the real parameters of those two cmdlets that do each; that mapping is authored here from the cmdlets' own parameter set, not supplied by MITRE. MITRE's SuspiciousKeywords knob (terms like "phish" or "malware" inside a rule's own filter condition, e.g. `-SubjectContainsWords`) is a narrower, distinct signal this rule does not gate on, since an adversary hiding a security alert has no reason to name it in the rule that hides it; the UserContext knob (scope to high-value mailboxes) is a deployment-time filter this rule cannot express without a concrete username list. The macOS leg AN0552 (plist file edits under `macos:unifiedlog`) is not attempted: that log source has no standardised Sigma field vocabulary anywhere in this corpus, the same blocker already recorded for it elsewhere. The Linux leg AN0553 (execve of mail clients or sieve editors touching a filter config file) is not attempted either — it reduces to a text editor being launched with a filename argument, which is indistinguishable from routine maintenance of that same file and carries no evidence of what the edit actually did, unlike the PowerShell leg where the cmdlet parameters state the effect directly. This rule also only sees rule changes made through PowerShell, including calls made through the proxy functions a `Connect-ExchangeOnline` session generates locally; a rule created through the Outlook client UI, the Exchange admin centre, or the Graph API leaves no local script block and is invisible here — AN0551 itself is scoped to the PowerShell path only, and this brief offers no Office Suite or web-based alternative log source to cover the rest. EventID 4104 requires the *Turn on PowerShell Script Block Logging* policy, which is off in a default install and in the MS and CIS baselines; without it this rule returns zero rows because the host is blind, not because nothing happened. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0192, 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.
Event| where ((EventID == 4104 and (ScriptBlockText contains "New-InboxRule" or ScriptBlockText contains "Set-InboxRule")) and (ScriptBlockText contains "-DeleteMessage" or ScriptBlockText contains "-SoftDeleteMessage" or ScriptBlockText contains "-MoveToFolder" or ScriptBlockText contains "-StopProcessingRules" or ScriptBlockText contains "-MarkAsRead"))
Splunk · SPL
Run this as a search.
index=* ((EventID="4104" AND (ScriptBlockText="*New-InboxRule*" OR ScriptBlockText="*Set-InboxRule*")) AND (ScriptBlockText="*-DeleteMessage*" OR ScriptBlockText="*-SoftDeleteMessage*" OR ScriptBlockText="*-MoveToFolder*" OR ScriptBlockText="*-StopProcessingRules*" OR ScriptBlockText="*-MarkAsRead*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((event.code == 4104 AND (TO_LOWER(powershell.file.script_block_text) LIKE "*new-inboxrule*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*set-inboxrule*")) AND (TO_LOWER(powershell.file.script_block_text) LIKE "*-deletemessage*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*-softdeletemessage*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*-movetofolder*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*-stopprocessingrules*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*-markasread*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="EventID" type="pcre2">(?i)^4104$</field> <field name="ScriptBlockText" type="pcre2">(?i)(New-InboxRule|Set-InboxRule)</field> <field name="ScriptBlockText" type="pcre2">(?i)(-DeleteMessage|-SoftDeleteMessage|-MoveToFolder|-StopProcessingRules|-MarkAsRead)</field> <description>PowerShell inbox rule created or modified to delete, move or hide mail</description> <mitre> <id>T1564.008</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.