Nicholas Quirk
Systems Administrator
Documentation / Responding to an AiTM phishing compromise in Microsoft 365

Responding to an AiTM phishing compromise in Microsoft 365

A reference runbook for the case where a user entered credentials and completed MFA on an attacker-controlled proxy page. The attacker then holds a valid session token, so a password reset alone will not evict them.

1. Confirm and scope

  • Review Entra sign-in logs for the user. Look for unfamiliar IPs or ASNs, a new user agent, and non-interactive sign-ins that follow an interactive one.
  • Record the first suspicious timestamp. Everything after it is in scope.
  • Check the user's authentication methods for anything they do not recognize. An attacker-registered authenticator or phone number is a persistence backdoor.

2. Contain, in this order

  1. Revoke sessions: Revoke-MgUserSignInSession -UserId user@domain.com
  2. Remove attacker-added MFA methods under the user's Authentication methods in Entra.
  3. Reset the password.
  4. Block sign-in until the user is re-enrolled if they cannot be reached live.

3. Hunt for persistence

  • Inbox rules: Get-InboxRule -Mailbox user@domain.com. Look for rules that delete, move to RSS or Archive, or forward.
  • Forwarding: Get-Mailbox user@domain.com | Format-List ForwardingSmtpAddress,ForwardingAddress,DeliverToMailboxAndForward
  • Enterprise applications and consent grants made during the window. Remove the service principal and its grants.
  • Delegates and mailbox permissions: Get-MailboxPermission and Get-RecipientPermission.

4. Scope the damage

  • Run a Purview audit search across the incident window for mail access, file access, sharing and rule creation.
  • Check for internal phishing sent from the account and for downstream compromised users.

5. Recover

  • Re-enroll MFA with the user live, by video or phone, never by email.
  • Confirm their devices and re-check sign-in logs for 24 hours.

6. Harden

  • Require phishing-resistant MFA for admins and high-risk users.
  • Conditional Access: require compliant or hybrid-joined devices for sensitive apps and consider token protection where supported.
  • Restrict user consent to third-party apps and require admin approval.

7. Document

Keep a timestamped record of the timeline, indicators, actions taken, client communication and follow-ups.

Reference runbook. Test commands in a non-production tenant first and adapt names to your environment.