BEC & Exchange Forensics · T1078.004 / T1110

Legacy Exchange Protocols (IMAP, POP3, SMTP Auth) Audit Log Hunting

Direct Answer (Key Forensic Takeaway)

Legacy authentication protocols—including IMAP4, POP3, Authenticated SMTP, and older Exchange ActiveSync clients—cannot display interactive MFA challenges, making them prime vectors for password spraying and silent mail harvesting. AuditVane rule AV-002 automatically flags every event whose clientAppUsed or protocol signature uses legacy auth.

Detection Objective & Threat Scope

Many organizations proudly report 100% Conditional Access MFA enforcement—until an incident investigation uncovers a forgotten printer exception, a legacy service mailbox, or a Conditional Access policy excluding "Other clients" that left IMAP4 or Authenticated SMTP exposed to the internet.

Even though Microsoft deprecated legacy Basic Authentication globally across Exchange Online, OAuth-enabled legacy exceptions, SMTP Auth overrides, and residual non-modern protocol telemetry still surface regularly during password-spray sweeps and BEC investigations.

In Entra ID Sign-In JSON exports, inspect `clientAppUsed` carefully: modern browser and Office 365 clients log as `Browser` or `Mobile Apps and Desktop clients`, whereas legacy protocols log explicitly as `IMAP4`, `POP3`, `SMTP`, `Authenticated SMTP`, `Exchange ActiveSync`, `MAPI Over HTTP`, or `Other clients`.

AuditVane rule AV-002 flags all legacy `clientAppUsed` protocols as Critical—whether the login succeeded (`errorCode: 0`) or failed (`50126`/`53003`)—because failed legacy bursts prove automated password spraying targeting valid usernames.

1. RAW TELEMETRY BEC & Exchange Forensics T1078.004 / T1110 2. CLIENT-SIDE PARSE AuditVane Engine IMAP4 POP3 SMTP Auth Entra sign-in 0 Bytes Uploaded 3. SOC OUTCOME Scoped Containment IOCs · CSV · KQL
Local browser DFIR workflow for IMAP4 POP3 SMTP Auth Entra sign-in hunting (T1078.004 / T1110)
AdSense-Ready In-Article Placement

Forensic Telemetry Fields & High-Signal Indicators

Telemetry Field / Pattern Meaning in M365 / Entra High-Signal Threat Indicator
clientAppUsed = IMAP4 / POP3Legacy non-MFA mailbox retrievalHigh risk of silent bulk email harvesting
clientAppUsed = Authenticated SMTP / SMTPLegacy outbound SMTP mail relay authAbused for mass spam & phishing campaigns
clientAppUsed = Exchange ActiveSyncOlder mobile mail sync protocolsVerify MDM enrollment & modern auth support
clientAppUsed = Other clientsUnclassified legacy ADAL / autodiscover / EWSFrequently missed by narrow CA policies
status.errorCode = 0 on legacy authSuccessful legacy login without MFA!Treat as immediate Critical account compromise
status.errorCode = 50126 on IMAP4Active credential spray hitting legacy endpointBlock protocol at Exchange AuthenticationPolicy layer

Hunt Legacy Auth in Sentinel KQL & Block at Exchange Front Door

// Sentinel KQL hunt:
SigninLogs
| where ClientAppUsed in ("IMAP4","POP3","SMTP","Authenticated SMTP","Exchange ActiveSync","Other clients")
| summarize Attempts=count(), Successes=countif(ResultType == 0), IPs=make_set(IPAddress) by UserPrincipalName, ClientAppUsed

# PowerShell: Enforce Exchange Authentication Policy + per-mailbox block
Set-AuthenticationPolicy -Identity "Block Legacy Auth" -AllowBasicAuthImap:$false -AllowBasicAuthPop:$false -AllowBasicAuthSmtp:$false
Get-CASMailbox -Identity "sales.rep@domain.com" | Set-CASMailbox -ImapEnabled $false -PopEnabled $false -SmtpClientAuthenticationDisabled $true

Sample Legacy Auth Hunting Summary

UserPrincipalName                  ClientAppUsed Attempts Successes IPs
-----------------                  ------------- -------- --------- ---
hr.lead@contoso-demo.invalid       IMAP4         4        1         ["45.155.205.19"]

Blocking Legacy Auth: Conditional Access vs. Exchange Auth Policy

Control LayerWhere It EvaluatesWhy Both Layers Matter
Entra Conditional Access (Legacy Auth Block)After primary username/password validationBlocks token issuance (53003), but attackers can still validate passwords!
Exchange Set-AuthenticationPolicyAt the Exchange protocol front doorRejects Basic Auth before password check—stops Smart Lockout & spray validation
Set-CASMailbox per-mailbox disablePer individual user mailboxDisables IMAP/POP/SMTP Auth completely unless explicitly required

Legacy IMAP4 Sign-In JSON Record Bypassing Conditional Access

{
  "createdDateTime": "2026-12-02T14:18:33Z",
  "userPrincipalName": "hr.lead@contoso-demo.invalid",
  "appDisplayName": "Legacy Mail Sync",
  "clientAppUsed": "IMAP4",
  "userAgent": "curl/8.7.1",
  "ipAddress": "45.155.205.19",
  "conditionalAccessStatus": "notApplied",
  "status": { "errorCode": 0 }
}

Notice conditionalAccessStatus = "notApplied" combined with clientAppUsed = "IMAP4" and status.errorCode = 0—proving the attacker found an unguarded legacy gap and authenticated directly without MFA.

Real-World Incident Walkthrough

A manufacturing firm blocks modern browser logins from outside the US via Conditional Access, yet forgets to enable Authenticated SMTP blocking on a legacy scan-to-email exception group. Attackers spray stolen breach-list credentials against `IMAP4` and `Authenticated SMTP` from Bucharest (`45.155.205.19`) using `curl/8.7.1`.

Dropping the Entra Sign-In JSON into AuditVane immediately fires `AV-002` (Critical) alongside `AV-003` (`curl/8.7.1`), exposing both the successful `errorCode: 0` IMAP session and 38 sprayed accounts.

Step-by-Step Triage, Containment & Verification

  1. Export Entra Sign-In JSON (Interactive + Non-Interactive) and load into AuditVane to surface all AV-002 hits.
  2. Separate successful legacy logins (errorCode 0) for immediate password reset + containment from failed spray attempts (50126 / 53003).
  3. Check conditionalAccessStatus on every legacy hit—if "notApplied", locate which exclusion group or policy gap missed it.
  4. Deploy a tenant-wide Conditional Access policy blocking "Exchange ActiveSync clients" and "Other clients" with zero broad user exclusions.
  5. Enforce Set-AuthenticationPolicy and disable SmtpClientAuthenticationDisabled=$false exceptions across mailboxes using Set-CASMailbox.
  6. Migrate remaining scan-to-email copiers to OAuth/SMTP relay connectors or Azure Communication Services rather than leaving user SMTP Auth enabled.

How to Verify Containment Completed Cleanly

  • Zero successful legacy clientAppUsed logins observed across 30 days.
  • Conditional Access policy targeting legacy clients set to On (not Report-Only).
  • Exchange OrganizationConfig SmtpClientAuthenticationDisabled verified True globally.

Analyst Blind Spots, Licensing Quirks & False Positives

Blocking legacy auth solely via Conditional Access still permits password validation against Entra before CA triggers—letting password sprayers identify valid passwords via error 53003 vs. 50126! Always combine Conditional Access with Exchange Authentication Policies.

Be especially careful with "Other clients" in Conditional Access—many admins target Exchange ActiveSync only and forget to check the "Other clients" checkbox.

Frequently Asked Questions

Did Microsoft already turn off Basic Authentication in Exchange Online?

Microsoft deprecated Basic Auth for IMAP/POP/EWS, yet SMTP Auth exceptions, OAuth-wrapped IMAP clients, and legacy telemetry still appear in Entra logs and must be blocked explicitly.

What does clientAppUsed = Other clients cover?

It represents legacy non-browser protocols including older Office clients, MAPI/RPC basic auth, Autodiscover, and older EWS integrations.

Does AuditVane flag failed IMAP4 password sprays too?

Yes, AV-002 alerts on all legacy clientAppUsed entries regardless of errorCode so you spot active spray campaigns early.

How do I disable SMTP Auth globally across Exchange Online?

Run Set-TransportConfig -SmtpClientAuthenticationDisabled $true and enable it only per dedicated relay mailbox if genuinely required.

Related Forensics Guides