Transport agent installed or enabled on a mail server
Matches the configuration half of AN0472: a script block naming one of the management cmdlets that registers, activates or reprioritises a transport agent on an Exchange server. Registration is the step that turns an attacker DLL into persistence — the assembly does nothing until it is installed into the transport pipeline and enabled — and it is a cmdlet call, so ScriptBlockText under EventID 4104 is the field that carries it whether it was typed into the Exchange Management Shell, pasted into a remote session or wrapped in an encoded one-liner. Set-TransportAgent is included because moving an agent to the front of the pipeline is how it guarantees it sees every message; the read-only Get-TransportAgent is deliberately excluded, because listing the agents is how ordinary administration and every troubleshooting session also begins. The brief's other three log sources were not used, and the reasons are worth stating: EdgeTransport.exe legitimately loads a large set of assemblies from the GAC and the Exchange install tree, so a Sysmon EventID 7 selector needs a verified baseline of that set which this corpus does not have, and MITRE's own AssemblyPath knob says the install paths vary by deployment, which removes the one anchor an EventID 11 file-creation rule would need. The rule therefore sees the registration, not the DLL: an agent installed by editing the pipeline configuration directly, or one already registered before logging was turned on, produces nothing here. EventID 4104 requires *Script Block Logging* to be enabled by policy — it is off in a default install and in the MS and CIS baselines — and because these cmdlets run against the Exchange server, the log has to be collected from that server rather than from the administrator's workstation. With either missing the rule returns zero rows, which reads as quiet when it means blind. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0166, 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 "Install-TransportAgent" or ScriptBlockText contains "Enable-TransportAgent" or ScriptBlockText contains "Set-TransportAgent"))
Splunk · SPL
Run this as a search.
index=* (EventID="4104" AND (ScriptBlockText="*Install-TransportAgent*" OR ScriptBlockText="*Enable-TransportAgent*" OR ScriptBlockText="*Set-TransportAgent*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (event.code == 4104 AND (TO_LOWER(powershell.file.script_block_text) LIKE "*install-transportagent*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*enable-transportagent*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*set-transportagent*"))
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="7"> <!-- 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)(Install-TransportAgent|Enable-TransportAgent|Set-TransportAgent)</field> <description>Transport agent installed or enabled on a mail server</description> <mitre> <id>T1505.002</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.