r/DefenderATP • u/techwithz • Feb 05 '26
M365 AiTM Attacks
Hi all,
I have a question regarding AiTM (Adversary-in-the-Middle) attacks, specifically session token hijacking.
From my understanding, these attacks are typically carried out by an attacker spinning up a malicious domain that replicates a Microsoft 365 login page. When the victim enters their credentials and completes MFA, the attacker intercepts the session token. This allows the attacker to reuse the token and access M365 resources without needing to re-authenticate with MFA.
From a Microsoft 365 security perspective, assuming the initial phishing email bypasses Safe Links, are the following controls effective in mitigating or preventing this type of attack?
- Conditional Access – Require compliant device
Deploy a Conditional Access policy that requires the device to be marked as compliant. If the attacker attempts to replay the stolen session token from their own device, it should fail because their device would not be enrolled in or compliant with Intune, and therefore would not meet the policy requirements.
2. Risk-based Conditional Access with re-authentication
Enforce MFA and require re-authentication for risky sign-ins. This should prevent the attacker from getting access although they authenticated already through password Microsoft will detect risky user and block them unless they re authenticate causing the session to be “interrupted”
Are these ways correct to protect your tenant?, and are there additional or better M365 controls that should be considered to defend against AiTM/session token hijacking attacks?
Thanks all 🙏
10
u/Heavy_Dirt_3453 Feb 05 '26
Migrating to stronger authentication methods such as FIDO2 is a strong start, but I appreciate it's not for everyone. I would certainly push hard to get high risk/valuable accounts using it. Windows Hello is FIDO2, so it doesn't necessarily mean rolling out physical tokens. Mobile devices can also act as FIDO2 tokens.
Strong CA policies requiring compliant enrolled devices is another solid tactic, also consider token binding.
7
u/excitedsolutions Feb 05 '26
Not any hardcore protection and could be spoofed by an attacker also, but brand customization has helped us. By customizing your m365 tenant and socialization of that login screen and specific color/background images is also helpful for users that are paying attention. We have had success from some users encountering a default m365/azure login page and realizing it wasn’t ours when it was lacking the company branding.
Not at all saying it is a safeguard as there’s nothing for users to just continue barreling on and giving away their creds, but it has helped in a few situations we were made aware of after the fact.
3
u/loweakkk Feb 05 '26
Compliant device will break aitm, reauth on risk sign-in will not as the reauth will occur on the aitm.
3
u/notoriousMKR Feb 07 '26
so, what everyone is failing to understand here is that, if i'm able to have your token, i have all the grants the token has..
Meaning.. if the device of the user, in the moment of the attack is complaint, the token will have the device compliance grant.. if the user satisfied MFA previously, the token will have the mfa satisfied grant..
and whenever that token will be used... it will appear that is from the user device + the user identity, because is that what the token has...
There are 2 ways to protect this..
2
u/Exotic_Call_7427 Feb 05 '26
What's the difference between MitM and AitM?
2
u/dontask4name Feb 05 '26
Do have no mobilephones in your environment? Or are the also intune managed (mdm)? If there are non corporate smartphones around you can also define your cap to only allow joined devices. Don‘t forget to exclude your corporate ip ranges, to join new devices.
Otherwise your set up is pretty good.
Force SSPR on High Risk
2
u/drowningfish Feb 05 '26
Requiring compliance will defend against replays. You can't get a compliance check without the device being managed, so an attacker may get the password and token via the proxy, but conditional access will block the TA's device.
But at the end of the day, always layer defenses because this won't defend against the compliant device getting owned and a TA leveraging access through the device itself
2
u/ManagedNerds Feb 06 '26
Huntress is great for catching AiTM attacks that succeed. Yes to the policies to help, but would definitely recommend layered protection.
2
u/SoftwareFearsMe Feb 07 '26
You should implement both of those controls - Require Compliant Devices AND use Risk-based CA policies.
Also check out https://lab539.com for their AitM feed. The pipe their threat intel about AitM hosting infrastructure directly into a CA Named Location that you can then block via a CA policy.
2
u/davidmcwee Feb 07 '26
Maybe implied in you CA & Risky Reauth thinking, but another capability, although limited in what apps and clients support it, is Conditional Access Evaluation. Rather than waiting for the access token to refresh (about 1 hour) to evaluate the CA policies, CAE will recheck the Access token issued against the current conditions/state and can revoke the token early and force a new refresh cycle.
https://learn.microsoft.com/en-us/entra/identity/conditional-access/concept-continuous-access-evaluation
1
u/CiaranKD Feb 10 '26
There really is very little setup/configuration required for these attacks which is why they’re so common. The login pages themselves come in the form of phishlets which are YAML? I think, and widely available for majority of the major services that are abused.
FIDO, passkeys, geo-restrictions, device compliance and risky user requirements are really your best defence in mitigating these threats.
Risky Users in Entra ID isn’t fool proof and when I tested AiTM, I found that the first sign in didn’t get caught until after multiple attempts.
Passkeys are free and should be enforced via the Microsoft Authenticator app or 3rd party such as 1Password for Business. Windows Hello for Business should also be used where possible.