← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing AzureAD Conditional Access Bypass Legacy Authentication Dataset

This hunt uses a simulated Azure AD sign-in log dataset (aad_legacy_auth_bypass_2022-12-10T081500.json) capturing T1078.004: Valid Accounts: Cloud Accounts, where an attacker with stolen credentials authenticates via a legacy authentication protocol (IMAP, POP3, SMTP AUTH, or older Exchange ActiveSync) that does not support modern authentication, thereby bypassing Conditional Access policies requiring MFA that only apply to modern-auth sign-ins.

Step 1: Hypothesis Formation

Hypothesis: A successful sign-in event for a user account occurs via a legacy authentication protocol (clientAppUsed = "IMAP4", "POP3", "Authenticated SMTP", "Exchange ActiveSync") from a source location/IP inconsistent with the user's normal geography, and no MFA challenge is present in the sign-in log, indicating an attacker is deliberately using legacy protocols to bypass Conditional Access MFA enforcement. Indicators:

Null Hypothesis: The user is legitimately using an older mail client or a service account intentionally configured for legacy protocol access (e.g., a scanner/printer relay using SMTP AUTH) as a documented exception. Invalidate by checking the account against the legacy-auth exception inventory and confirming the source IP is a known, registered device/service location.

Rationale: Conditional Access policies that require MFA are commonly scoped to modern authentication flows; legacy protocols authenticate via a single username/password exchange with no interactive MFA prompt, so an account compromised via credential stuffing or phishing can be accessed with total MFA bypass as long as legacy authentication remains enabled for that user or tenant.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm r.patel authenticated via legacy IMAP4 from an unrecognized foreign IP with no MFA challenge, followed by creation of a hidden mailbox forwarding rule within 15 minutes.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-12-10 08:15:22AzureADSign-in LogClientAppUsed=IMAP4, ResultType=0 (success), AuthenticationRequirement=singleFactorAuthentication, source 103.216.220.14MFA-Bypass IOC: this account is covered by a Conditional Access policy requiring MFA, yet the legacy IMAP4 protocol allowed a single-factor successful authentication, confirming the CA policy gap for legacy auth.
2022-12-10 08:15:22AzureADSign-in Log (geolocation)Source geolocated to a country the user has never signed in from in the prior 90 days; ASN flagged as a known VPN-exit providerLocation-Anomaly IOC: this represents a significant deviation from the user's established sign-in baseline, consistent with an attacker using stolen credentials from a remote location.
2022-12-10 08:16:05AzureADSign-in LogSecond and third IMAP4 sign-ins from the same source IP within 45 seconds, consistent with automated mailbox-sync tooling (not a human reading email interactively)Automation IOC: rapid, repeated protocol-level authentication is typical of scripted mailbox access/exfiltration tools rather than a person checking email via a client.
2022-12-10 08:29:51Exchange OnlineAudit Log (New-InboxRule)Rule "..." created forwarding all mail matching finance-related keywords to an external address, then marking as read and moving to RSS Subscriptions folderPost-Compromise IOC: a hidden, keyword-targeted forwarding rule immediately following a legacy-auth sign-in is a well-established BEC/mailbox-takeover pattern (see also Report 2025-08-23 for full O365 rule-abuse detail).
--(Legacy-auth exception check)r.patel has no entry in the documented legacy-authentication exception listConfirms this account has no legitimate business need for IMAP/POP/legacy protocol access.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an attacker used stolen credentials to authenticate via legacy IMAP4 from an unrecognized foreign location, completely bypassing the account's Conditional Access MFA requirement, then established a hidden mailbox forwarding rule targeting finance-related emails!