11.8 Eradication
Eradication
Containment (11.7) stopped the attacker’s access. Eradication removes the persistence mechanisms the attacker established. If you skip eradication, the attacker regains access when the containment measures expire or are removed.
Execute each action for every confirmed compromised account. The post-compromise activity summary from subsection 11.6 is your checklist.
Required role: Exchange Administrator (for inbox rules and forwarding), Authentication Administrator (for MFA methods), Application Administrator or Cloud Application Administrator (for OAuth consents).
Action 1: Remove malicious inbox rules
For each compromised user, remove the inbox rules identified in subsection 11.6 Step 1.
Execute via PowerShell:
| |
Or via Outlook Web Access: Settings → Mail → Rules → delete the malicious rules.
Blast radius: Only the specified inbox rules are removed. No impact on other email functionality or other users. Per-rule scope.
Rollback: If you remove a legitimate rule by mistake: recreate it from the Get-InboxRule output you captured before deletion. Always capture the full rule list before removing anything.
Verify:
| |
Expected result: No rules with external forwarding, redirect, or delete actions remain. If the legitimate user has rules with internal forwarding (e.g., forwarding to a shared mailbox), those should remain.
Do this BEFORE sending the password reset notification email. If the attacker’s inbox rule is still active when you send the password reset link, the rule deletes the email — the user never receives it, and you do not notice.
Action 2: Remove mailbox-level forwarding
| |
Blast radius: Removes forwarding only. No impact on other mailbox functionality. Per-mailbox scope.
Verify: Re-run the Get-Mailbox command. ForwardingSmtpAddress, ForwardingAddress, and DeliverToMailboxAndForward should all be null/false.
Action 3: Remove attacker’s MFA registration
For s.chen (where MFA modification was detected in subsection 11.6 Step 4):
Execute: Entra ID → Users → s.chen → Authentication methods. Identify the attacker’s registered method: it will be the method registered from the attacker IP or at the time of compromise. Remove it.
Or via PowerShell/Graph API:
| |
Blast radius: Only the specified authentication method is removed. The user’s other MFA methods remain functional. If you accidentally remove the user’s legitimate MFA method, they must re-register — manageable disruption. Per-method scope.
Before executing: Confirm which method is the attacker’s and which is the user’s. Compare registration timestamps with the compromise timeline. The attacker’s method was registered AFTER the compromise timestamp from the attacker’s IP. The user’s legitimate method was registered before the incident.
Verify: Re-list authentication methods. Only the user’s pre-incident methods should remain.
Action 4: Revoke malicious OAuth application consents
If subsection 11.6 Step 5 found OAuth consents granted by compromised users:
Execute: Entra ID → Enterprise applications → find the application by AppId → Properties → Delete. Or revoke the user’s consent: Enterprise applications → application → Users and groups → remove the compromised user.
Blast radius: Deleting the application revokes access for ALL users who consented — verify it is not a legitimate application. Revoking user consent only removes the specific user’s grant. Per-application or per-user scope.
Rollback: If a legitimate application was accidentally removed, the users must re-consent. The application registration can be restored from soft-delete within 30 days.
Verify:
| |
Action 5: Remove attacker device registrations
If the attacker registered a device to the compromised user’s account (T1098.005):
| |
If device registrations from the attacker IP exist: delete the device from Entra ID → Devices. This prevents the attacker from using the registered device to satisfy device-based conditional access policies in the future.
Eradication verification checklist
Run this final verification after completing all eradication actions:
| |
Every check must return clean results before eradication is considered complete.
Subsection artifact: The eradication action sequence with verification commands. This is the eradication section of your AiTM investigation playbook. Each action maps directly to the post-compromise findings from subsection 11.6.
Knowledge check
Check your understanding
1. You need to send a password reset email to the compromised user. The attacker created an inbox rule that deletes emails containing "password" and "reset." What do you do first?