Azure AD Connect / Entra ID Connect: The Hybrid Attack Bridge
Concept
Section titled βConceptβMicrosoft Entra Connect (formerly Azure AD Connect) is the enterprise synchronization engine that replicates on-premise Active Directory objects and authentication secrets into the Microsoft Entra ID cloud tenant.
It relies on three foundational components:
- The On-Premise Active Directory Synchronization Account (
MSOL_XXXXX): Automatically provisioned at the root of the local domain, this account holds directory Extended Replication Rights (DS-Replication-Get-Changes-All) to harvest NTLM hashes for Password Hash Synchronization (PHS). - The Cloud Synchronization Account (
Sync_XXXXX): A high-privilege service account provisioned in Entra ID holding theDirectory Synchronization Accountsdirectory role. - The Local Database (LocalDB or SQL Server): Houses the synchronization engine configuration and stores symmetric encryption keys protected by Windows DPAPI and local LSA secrets.
Why It Matters in DFIR
Section titled βWhy It Matters in DFIRβTriage of the Entra Connect server is critical during hybrid intrusions:
- Trivial Extraction of
MSOL_Credentials: Using public research tooling (e.g., PowerShellAzureAD_Decrypt_MSOL.ps1or the AADInternals module), any local administrator on the Entra Connect server can decrypt the plaintext password of theMSOL_XXXXXaccount directly from the local database. - Immediate DCSync Execution: Because the
MSOL_account possesses directory replication rights by design, an attacker possessing its password can execute a DCSync against any DC, dumping the enterprisekrbtgtkey and all domain accounts. - On-Premise to Cloud Pivoting: Leveraging the cloud synchronization identity or altering synchronized directory attributes (e.g., configuring Seamless SSO spoofing or modifying
UserPrincipalNameattributes), an attacker expands on-premise domain dominance into Microsoft 365 / Azure.
How It Works
Section titled βHow It WorksβHybrid Synchronization Bridge Architecture
Section titled βHybrid Synchronization Bridge Architectureββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ MICROSOFT ENTRA CONNECT SERVER βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β Synchronization Engine (miiserver.exe) ββ DPAPI / LSA Cryptographic Master Key ββ ADSync SQL Database (Stores encrypted sync credentials)ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ β ββββββββββββββββββ΄βββββββββββββββββ βΌ βΌββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ On-Premise Active Directory β β Microsoft Entra ID Cloud βββββββββββββββββββββββββββββββββ€ ββββββββββββββββββββββββββββββββ€β Account: MSOL_XXXXXXXXXXXX β β Account: Sync_XXXXX_XXXXX ββ Rights: Replication-Get-All β β Role: Directory Sync ββ (Enables DCSync!) β β Accounts βββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββ- DPAPI Key Decryption: The
ADSyncdatabase encrypts theMSOL_account password using an encryption key stored in the machineβs local LSA secret store. An attacker with local administrative privileges invokes DPAPI to unprotect the key, subsequently extracting the cleartextMSOL_password. - Malicious Password Writeback: If Password Writeback is enabled for Self-Service Password Reset (SSPR), an attacker compromising an identity in the cloud can push password changes downward into the on-premise Active Directory.
What Is Possible
Section titled βWhat Is Possibleβ- Extracting
MSOL_Credentials in Seconds: Any member of the localAdministratorsorADSyncAdminsgroup can extract cleartext credentials without generating DC alerts. - Impersonating Cloud Users via PHS Manipulation: An adversary controlling the sync engine can inject synthetic password hashes into Entra ID, hijacking cloud sessions of synchronized users.
- Bypassing Cloud MFA: Cloud synchronization service accounts (
Sync_) are frequently excluded from Conditional Access and multi-factor authentication policies to maintain unattended service continuity.
What Is Not Possible
Section titled βWhat Is Not Possibleβ- Decrypting the ADSync Database Remotely Without Host Access: Encryption keys are bound to local DPAPI and LSA secrets; the attacker must establish code execution on the Entra Connect server itself.
- Modifying Pure Cloud-Native Accounts from On-Premise: Accounts authored directly in Entra ID (where
Source of Authority: Cloud) cannot be modified by the on-premise synchronization engine. - Masking the DCSync Telemetry Generated by the MSOL Account: While
MSOL_is a legitimate account, its replication queries generate Event ID 4662 on the target DC.
Common DFIR Confusions
Section titled βCommon DFIR Confusionsβ| Frequent Confusion | Verifiable Forensic Reality |
|---|---|
| βThe Entra Connect server is merely a Tier 1 application server.β | Critical architectural error. Entra Connect holds AD replication rights and cloud tenant control: it is an absolute Tier 0 / Control Plane asset. |
| βResetting the MSOL account password does not disrupt synchronization.β | False. Resetting MSOL_ in Active Directory without updating the Entra Connect configuration wizard halts synchronization immediately. |
| βDCSync alerts can safely whitelist the MSOL account.β | Whitelisting the account name is a severe mistake. If the source IP of the DCSync event differs from the authorized Entra Connect server IP, MSOL_ credentials were stolen. |
Concrete Forensic Example
Section titled βConcrete Forensic ExampleβDuring an investigation at a legal advisory firm:
- Threat actors compromise
SRV-AADSYNCby exploiting a vulnerable secondary monitoring service running on the host. - The attackers run AADInternals to dump synchronization keys from the local database.
- They extract the cleartext password for
MSOL_9d8f37a1e0b4. - From an external pivot workstation
10.0.5.99, they invokesecretsdump.pytargeting primary domain controller10.0.1.10. - DFIR Discovery: DC Event ID 4662 logs
SubjectUserName: MSOL_9d8f37a1e0b4. However, corresponding Event 4624 records network source IP10.0.5.99rather than the authorized Entra Connect IP10.0.2.15. - Finding: Definite proof of credential harvesting from the Entra Connect bridge resulting in total local domain compromise.
Key Forensic Artefacts
Section titled βKey Forensic Artefactsβ- Entra Connect Host Logs:
- Application Event Log: Events from source
Directory Synchronization(Event IDs 100, 102, 107). - Process Telemetry: DLL injection or memory access targeting
miiserver.exeorlsass.exe. - Database Queries: Direct queries accessing
mms_management_agentin theADSyncdatabase.
- Application Event Log: Events from source
- Domain Controller Security Logs:
- Event ID 4662: Replication queries executed by
MSOL_XXXXX. Verify source network addresses in matching Event 4624 records.
- Event ID 4662: Replication queries executed by
- Microsoft Entra Cloud Audit Logs:
- Activities initiated by the
Sync_XXXXXservice account updating sensitive user attributes or group memberships.
- Activities initiated by the
Investigation Methods
Section titled βInvestigation Methodsβ- Identify the Exact Local Synchronization Account:
Run
Get-ADUser -Filter 'Name -like "MSOL_*"' -Properties *. - Correlate MSOL DCSync Queries with Authorized Source IPs:
Audit Event IDs 4662 and 4624 across all DCs to verify that 100% of
MSOL_queries originate strictly from the Entra Connect server IP. - Audit Local Administrators on the Entra Connect Server:
Inspect membership of the local
AdministratorsandADSyncAdminsgroups.
Investigative Tooling
Section titled βInvestigative Toolingβ- PowerShell AD Module:
Terminal window # Query MSOL account metadataGet-ADUser -Filter 'Name -like "MSOL_*"' -Properties PasswordLastSet, whenCreated, Description - AADInternals (Lab / Audit):
Terminal window Import-Module AADInternalsGet-AADIntSyncCredentials
Key Takeaways
Section titled βKey Takeawaysβ- The Entra Connect server is an authoritative Tier 0 asset bridging on-premise and cloud infrastructure.
- The local
MSOL_XXXXXaccount holds DCSync directory replication rights by default. - Any local administrator on the Entra Connect host can decrypt
MSOL_credentials. - Any
MSOL_replication activity originating from an unapproved IP signifies a critical credential theft event.
References & Further Reading
Section titled βReferences & Further Readingβ- Microsoft Learn: Microsoft Entra Connect security considerations
- Card 03 β Built-in Accounts and Privileged Accounts
- Card 10 β Administrative Boundaries in Windows and Active Directory
- Card 26 β DCSync: Mechanics, Prerequisites, and Forensic Artefacts
- Card 28 β Domain Controllers as Lateral Movement Hubs