Skip to main content
Service accounts run services, scheduled tasks, and background processes under a dedicated identity. They are high-value targets: they tend to carry elevated privileges, often have SPNs registered, and receive far less operational scrutiny than user accounts.

Account Types

Regular user accounts as service accounts compound risk: passwords are rarely rotated, SPNs are frequently registered, and the account is directly Kerberoastable. A cracked hash is valid until someone manually resets it. MSA (Managed Service Account) automates password rotation but is bound to a single host. Rarely seen in modern environments. gMSA (Group MSA) extends MSA to multiple hosts. The password is derived from the KDS root key and never exposed as plaintext. Retrievable only by accounts listed in msDS-GroupMSAMembership. dMSA (Delegated MSA) is new in Windows Server 2025, designed to replace regular service accounts via a migration mechanic. The predecessor’s SIDs are inherited into the dMSA’s PAC, which is the root of CVE-2025-53779 (BadSuccessor).

gMSA

How It Works

The domain-wide KDS root key is created once per domain. Each gMSA’s 256-bit password is derived deterministically from:
  • The KDS root key
  • The account name and domain
  • A time counter that advances every 30 days
The KDC recomputes this derivation server-side. Hosts that appear in the msDS-GroupMSAMembership ACL can retrieve msDS-ManagedPassword from LDAP, a blob containing the current and previous NT hashes. The password never travels as plaintext.

Enumeration

Attack: Retrieve NT Hash via msDS-ManagedPassword

If your controlled account is listed in msDS-GroupMSAMembership, or you have write access to add yourself there, you can retrieve the password blob and extract the NT hash directly.
The NT hash can be used directly for pass-the-hash without cracking.

Mitigations

  • Restrict msDS-GroupMSAMembership to the minimum set of hosts that actually run the service.
  • Audit GenericWrite / GenericAll over gMSA objects via BloodHound or ACL enumeration.
  • Monitor LDAP reads of msDS-ManagedPassword (Event 4662, property msDS-ManagedPassword).

dMSA and BadSuccessor (CVE-2025-53779)

How dMSA Migration Works

dMSA provides a migration path from regular service accounts. The key attributes:
  • msDS-ManagedAccountPrecededByLink: points to the predecessor account DN
  • msDS-DelegatedMSAState: tracks migration state
    • 0: not started
    • 1: migration in progress (dMSA accumulates predecessor SIDs, predecessor still active)
    • 2: migration complete (predecessor disabled, dMSA fully inherits SIDs)
When the DC issues a TGT for a dMSA in state 1 or 2, it includes the predecessor account’s objectSid and all group SIDs in the PAC. A dMSA linked to a Domain Admin effectively becomes that Domain Admin from the KDC’s perspective.

KERB-DMSA-KEY-PACKAGE

The AS-REP for a dMSA contains a KERB-DMSA-KEY-PACKAGE in its encrypted payload. It holds two key sets:
  • current-keys: the dMSA’s own Kerberos keys (AES256, AES128, RC4)
  • previous-keys: the predecessor account’s keys at migration time
The predecessor’s NT hash (RC4 key) ends up in previous-keys because the DC preserves the old credential for compatibility during the migration window. Since you created the dMSA and set its password, you can decrypt the AS-REP, parse the key package, and extract the predecessor’s NT hash.

Why the Attack Works

Any principal with CreateChild rights on an OU can:
  1. Create a dMSA in that OU
  2. Set msDS-ManagedAccountPrecededByLink to any account in the domain (no write on the predecessor required)
  3. Set msDS-DelegatedMSAState to 2
  4. Request a TGT: the PAC contains the predecessor’s SIDs and the AS-REP contains the predecessor’s NT hash in the key package
No write access on the predecessor is needed. The only prerequisite is CreateChild on any OU.

Enumeration

Attack Chain

dMSA_keydump

Parses the KERB-DMSA-KEY-PACKAGE from a dMSA ccache and extracts the predecessor NT hash

Patch Status

Microsoft patched CVE-2025-53779 by requiring a bidirectional link: msDS-ManagedAccountPrecededByLink on the dMSA and a corresponding back-link on the predecessor object. Post-patch, write access on the predecessor is required to establish the link, which defeats the attack for most scenarios. Verify patch status before attempting.

Detection

Monitor for msDS-DelegatedMSAState set to 2 by non-privileged accounts, and for msDS-ManagedAccountPrecededByLink pointing to privileged accounts.

Kerberoasting Service Accounts

Service accounts with SPNs are Kerberoastable regardless of account type. gMSAs are Kerberoastable but the password is 256 bits of random data and practically uncrackable: target msDS-ManagedPassword instead. dMSAs do not use RC4 by default and are not Kerberoastable.

Enumeration

Requesting and Cracking

See Kerberoasting for the full targeted attack chain, AES downgrade, and faketime usage.