Back to Blog
Red Teaming Oct 3, 2026 121 views

Cached Logons & DCSync: Locking Down the Last Credential Stores

Cached domain logons (MSCache/DCC2) hand a stolen laptop's password verifier to offline cracking, and DCSync abuses replication rights to pull every hash in the domain. How both work, how to crack and detect them, and how to lock them down.

By Obaida Albasha, Security Researcher, Cytomate

Part 6 of our Windows Credential Protection series: what breaks when a control is off, how an attacker abuses that gap, and how to turn it on and keep it on. Earlier in the series: WDigest, Credential Guard, LSA Protection, Protected Users & tiering, LAPS & local admin. This post covers the two credential stores that survive all of them.

Two stores, two completely different problems

Everything in this series so far has been about one machine at a time: stop WDigest caching plaintext, isolate secrets in Credential Guard, wrap LSASS in PPL, shrink the accounts with Protected Users, kill local admin reuse with LAPS. This post is about the two credential stores those controls do not touch, and they could not be more different from each other.

The first lives on the endpoint. Every domain machine keeps a small cache of logon verifiers so a user can still sign in when no domain controller can be reached, on a plane, at home before the VPN is up, in a branch office with a dead WAN link. That cache is a feature, and a good one. It is also a crackable copy of a domain password sitting on every laptop in the estate.

The second lives on the domain controllers, and it is the whole directory. Domain controllers replicate their copy of Active Directory to each other constantly, password hashes included, over a dedicated replication protocol. DCSync is the attack that asks a domain controller to replicate those secrets to the attacker instead of to another DC. No file copy, no memory read, no code on the DC. Just a legitimate replication request from a principal AD has been told is allowed to make one. Get it right against krbtgt and you own the domain until that account is reset twice.

One is an offline cracking problem you fix by caching less and making what remains worthless. The other is an authorization problem you fix by auditing who can replicate and watching the ones who do. We will take them in that order.

Part A: Cached domain logons (MSCache / DCC2)

What the cache actually is

When a domain user logs on interactively to a domain-joined machine, Windows validates the credentials against a domain controller and then stores a verifier locally so the same user can log on later if a DC is unavailable. Windows caches the last 10 logons by default (every version except Server 2008, historically), and the count is tunable from 0 to 50. If you have ever seen the message "a domain controller for your domain could not be contacted, you have been logged on using cached account information," that is this cache doing its job.

The verifier is not the NT hash and it is not the plaintext. On Windows Vista / Server 2008 and later it is a DCC2 hash (Domain Cached Credentials version 2, also called MSCacheV2 or mscash2). DCC2 is built by running PBKDF2-HMAC-SHA1 over the user's NT hash, salted with the lowercase username, with a fixed iteration count of 10,240 rounds. That iteration count is the entire security story of this cache: it makes the verifier slow to crack, but it does not make it uncrackable, and it is far weaker than a well-tuned modern KDF.

The cache lives in the registry under the protected SECURITY hive, in HKLM\SECURITY\Cache, as values named NL$1, NL$2 and so on, encrypted with the machine's LSA key from the SYSTEM hive. That is why dumping it needs SYSTEM-level access: you need to read a hive normal users cannot touch, and you need the SYSTEM hive alongside it to derive the decryption key.

Why this matters even with everything else turned on. Credential Guard, PPL, and WDigest hardening all protect secrets in LSASS memory. The cached verifier is not in LSASS, it is at rest in the registry, and it survives reboots and shutdowns. A laptop stolen from a car boot, powered off, with full LSASS protection enabled, still carries a crackable copy of whoever last logged into it, offline, with no DC anywhere in sight. It is the credential store that leaves the building.

The one key that controls it

Registry key controlling cached logons: CachedLogonsCount under Winlogon
Value Behaviour
10The default. Verifiers for the last ten distinct users are kept.
1 - 50Keeps that many verifiers. CIS and most baselines recommend a low value such as 4 (workstations/servers) and 0 on systems that never roam.
0Caching off. No offline logon at all, the user is refused if no DC is reachable.

Equivalent policy, which is how you should deliver this at scale, lives at Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> "Interactive logon: Number of previous logons to cache (in case domain controller is not available)." A reboot is required for a change to take effect, and the change only affects future logons; verifiers already in the cache stay until they age out.

A subtlety worth knowing before you touch this: the cached verifier is checked before a network check, and it is not updated when a password changes in the cloud or on another machine. So a user who changes their password elsewhere can still log into a disconnected laptop with the old password until that machine next authenticates online. That is a usability and incident-response wrinkle, not just a trivia point: a disabled or reset account can still unlock a roaming device offline.

Which logons even populate the cache

Not every logon writes a verifier, and this matters for both exposure and expectations. Interactive and cached-interactive logons (console, RDP interactive, runas with a domain account) populate it. Pure network logons (type 3, the kind behind file-share access and most service auth) generally do not. So the cache on a given host is essentially a list of the humans who have sat down and logged into it, which on a shared jump host or a frequently-serviced server can be a very interesting list indeed.

The attack: dump, then crack offline

Everything below runs in CYTOMATE.LOCAL, a lab we own. The attacker has already reached local SYSTEM on a workstation, WKSTN05, where a domain user and, on a bad day, a domain admin, has logged on interactively.

1. Dump the cache in memory with Mimikatz

With SYSTEM, the quickest path is Mimikatz. token::elevate gets to the SYSTEM token so LSA secrets are readable, and lsadump::cache walks the NL$ entries and prints the DCC2 verifiers.

mimikatz command to dump cached domain credentials
mimikatz lsadump::cache output showing MSCacheV2 (DCC2) verifiers
Figure 1. Mimikatz lsadump::cache reads the NL$ entries and prints each user's MSCacheV2 (DCC2) verifier.

2. Or dump it offline from saved hives

A quieter route, and the one you will see in real intrusions, is to save the two registry hives and parse them off the box. This avoids running a flagged tool like Mimikatz on the endpoint entirely.

reg save of the SYSTEM and SECURITY hives

Then, on the attacker's own machine, Impacket's secretsdump turns those hives into crackable hashes. The Cached section of the output is the DCC2 material.

secretsdump command to parse saved hives offline
secretsdump output with the DCC2 cached-credential block
Figure 2. secretsdump parsing the saved hives offline. The cached-credential block is emitted in the crackable $DCC2$ format.

3. What comes out, and why you cannot replay it

The output line looks like this (the iteration count, the username as salt, then the verifier):

Example DCC2 cached-credential line

This is the single most important property of cached credentials from an attacker's point of view, and the reason they behave nothing like an NT hash: DCC2 cannot be used in a Pass-the-Hash attack. It is a one-way verifier derived from the NT hash, not the NT hash itself. There is no protocol that accepts it. The only way to turn it into something usable is to crack it back to the plaintext password, and then that plaintext works everywhere the password does.

4. Crack it

Hashcat mode 2100 handles DCC2 directly, and John the Ripper calls the format mscash2.

hashcat and John the Ripper commands to crack DCC2
hashcat mode 2100 cracking a DCC2 verifier to plaintext
Figure 3. Cracking the DCC2 verifier with hashcat mode 2100. Note the speed, a few hundred kH/s against NTLM's tens of billions; the 10,240-round PBKDF2 slows this down but does not stop a weak or reused password from falling.

The 10,240 iterations mean DCC2 cracks far slower than a raw NT hash, so brute force across a full keyspace is impractical for a strong password. But that cuts both ways: a weak, reused, or short password in the cache still falls to a wordlist-and-rules run, and the account that logged into a helpdesk workstation is very often exactly the kind of account whose password was chosen by a human. This is why "it is slow to crack" is not a control; password strength and caching less are the controls.

Where cached logons still go wrong

Every item here is a misconfiguration or a monitoring gap with a fix in the next section.

  • The default of 10 is almost always more than you need. Most desktops have one or two regular users. Ten slots means ten crackable verifiers, and on a shared or administrative host that list quietly accumulates privileged accounts that logged in once to fix something.
  • Privileged accounts logging into Tier 2 machines. The cache turns the Part 4 exposure (a domain admin typing a password on a workstation) into a persistent at-rest artifact. The live-session theft from Part 4 needs the session to still exist; the cached verifier does not.
  • Weak and reused passwords. DCC2's slow KDF only buys time. It does nothing for a password that appears in a wordlist.
  • Stale verifiers for disabled accounts. Because the cache is not updated on password change or account disable, a roaming laptop can keep validating a credential the directory has already killed.

Mitigating cached logons: practical steps

  1. Lower the count through Group Policy, per tier. Deliver CachedLogonsCount through a GPO rather than hand-setting it, so it re-applies and does not drift. A sensible baseline: 0 on domain controllers and any always-connected server (they never need offline logon), 0 on desktops that never leave the LAN, and a low value such as 2 to 4 on genuine laptops that must survive an outage. Do not blanket-set 0 on roaming devices without a plan, or a user on a plane with an expiring Kerberos session can be locked out.
    reg query to validate the effective CachedLogonsCount value
  2. Put privileged accounts in Protected Users. This is the direct control from Part 4 applied here: members of the Protected Users group do not get a cached logon verifier created for them at all. Tier 0 and Tier 1 admins in that group simply leave nothing in the cache to crack, on any host they touch. Combined with tiering that keeps them off Tier 2 machines in the first place, the cache stops being a privileged-credential store.
  3. Make what remains worthless with password strength. Since the only usable outcome is a cracked plaintext, long randomized passwords for admins and a strong user password policy are what defeat the attack. For local administrator accounts specifically, LAPS (Part 5) already gives you unique long randoms, which is another reason a dumped cache on one box does not help on the next.
  4. Encrypt the disk. The cache is an at-rest secret on a device that leaves the building. BitLocker with a TPM (ideally TPM plus PIN for high-value laptops) means a powered-off, stolen machine does not give up its SECURITY hive to an attacker who boots from USB. This is the control that addresses the stolen-laptop scenario head-on.
  5. Watch for the dump, not just the crack. Cracking happens offline where you will never see it, so detection has to catch the extraction. Alert on access to the registry hives (Sysmon and Security auditing, below) and on tools that read HKLM\SECURITY\Cache.
  6. Test it on a schedule. Put a canary into a lab host's cache, confirm your GPO holds the count where you set it, dump it, and confirm your SIEM fires on the hive access. That controlled exercise is what breach and attack simulation is built for: run the technique, measure what the stack catches, and close the gap before someone else finds it.
SYSMON EVENT ID 13

Registry access to the cache

Sysmon registry events on HKLM\SECURITY\Cache (and the LSA secrets path) catch tools reading the verifier store. On a clean host, almost nothing legitimately touches this key outside of the OS itself.

SYSMON 1 / SECURITY 4688

Hive save & dump tooling

Process-creation logging shows the literal reg save HKLM\SECURITY and reg save HKLM\SYSTEM, plus known dumpers (secretsdump, cachedump, LaZagne). The hive-save pair against SECURITY + SYSTEM in quick succession is a strong signal.

SECURITY 4663 + SACL

Object access on the hive files

With a SACL on the hive files and Audit Object Access enabled, 4663 records reads of the backing files. Pair with handle-open events to catch raw hive copying that bypasses reg.exe.

LSASRV 45058 (context)

Offline logon used

Event 45058 marks a cached logon being used because no DC was reachable. Not an attack on its own, but a cached logon on a host that should always be online, or one for a privileged account, is worth a look.

Part B: DCSync and replication-rights abuse

From one host's cache to the whole directory

Cached logons leak one user at a time from one machine. DCSync leaks the entire domain from a single request, and it does it by using Active Directory exactly as designed.

Domain controllers keep each other in sync with the Directory Replication Service Remote Protocol (MS-DRSR), carried over RPC on the DRSUAPI interface. When one DC needs changes from another, it calls IDL_DRSGetNCChanges (you will see it written as DsGetNCChanges), and the peer replies with the changed objects, password hashes included. That is normal, constant, healthy behaviour between domain controllers.

DCSync is a machine, which is not a domain controller, making that same DsGetNCChanges call and asking a real DC to replicate secrets to it. The DC, seeing a caller that holds the right permissions, happily replies with the hashes. Crucially, this is not a copy of the NTDS.dit file and it is not a memory read; it is a replication operation over the wire. The attacker never needs code execution on the domain controller, never touches its disk, and never reads its LSASS. That is what makes DCSync so clean and so hard to catch: it looks almost exactly like legitimate replication.

The payoff is total. Target one user and you get their NT hash and Kerberos keys. Target krbtgt and you get the key to forge Golden Tickets, arbitrary Kerberos TGTs for any user, valid until krbtgt is reset twice. Target /all and you replicate every credential in the domain in one pass. This is routinely the last step before a ransomware actor has the whole estate.

Everything hinges on three extended rights

DCSync is an authorization problem, not a vulnerability. To replicate secrets, the calling principal needs extended rights on the domain object itself:

Extended right Schema GUID Role
DS-Replication-Get-Changes1131f6aa-9c07-11d1-f79f-00c04fc2dcd2Replicate changes (base).
DS-Replication-Get-Changes-All1131f6ad-9c07-11d1-f79f-00c04fc2dcd2Replicate secrets (the one that leaks hashes).
DS-Replication-Get-Changes-In-Filtered-Set89e95b76-444d-4c62-991a-0facbeda640cReplicate filtered attributes (RODC scenarios).

A principal needs both Get-Changes and Get-Changes-All to pull password material. By default these are held only by Domain Admins, Enterprise Admins, Administrators, and the Domain Controllers group. The danger is that they can also be granted, deliberately or accidentally, to any principal via an ACE on the domain head. That is the quiet persistence trick: an attacker who reaches domain admin once grants an unremarkable service account the two replication rights, cleans up their obvious footholds, and comes back weeks later to DCSync at will from a low-value account that raises no eyebrows. Mis-scoped delegations, over-broad groups, and leftover ACEs from old products create the same exposure without any attacker involved.

The attack in practice

Same lab, CYTOMATE.LOCAL. The attacker has reached a context that holds replication rights, either a compromised Domain Admin or a non-privileged account that was granted the ACEs.

1. From Windows, with Mimikatz

Mimikatz runs the DCSync in-process. Target a single high-value account first; krbtgt is the usual choice because its hash forges Golden Tickets.

mimikatz lsadump::dcsync targeting krbtgt
mimikatz lsadump::dcsync output: krbtgt NT hash and Kerberos keys
Figure 4. Mimikatz lsadump::dcsync replicating the krbtgt account's hash and keys. No code ran on the domain controller; this was a replication request over RPC.

To take the entire domain in one pass:

mimikatz lsadump::dcsync of the whole domain

2. From Linux, with Impacket

Off the Windows host entirely, secretsdump performs the DCSync remotely using a password, an NT hash (pass-the-hash), or a Kerberos ticket. -just-dc pulls the domain's credentials via replication.

impacket secretsdump -just-dc commands
secretsdump -just-dc output replicating the full domain hash set
Figure 5. secretsdump -just-dc replicating the full credential set remotely. The hashes come back over DRSUAPI; the Kerberos keys follow.

3. The payoff: forge a Golden Ticket

With the krbtgt key in hand, the attacker no longer needs to dump anything again. They mint a TGT for any user, including ones that do not exist, with arbitrary group membership. This is the persistence that makes a krbtgt compromise a full-domain event, and the reason the only clean recovery is a double reset of krbtgt.

mimikatz kerberos::golden command forging a Golden Ticket
Golden Ticket forged and used to reach the domain controller
Figure 6. A Golden Ticket forged from the DCSync-replicated krbtgt key, injected into the session, then used to reach the domain controller's C$ with no further authentication.

A note on the one "bypass": relay, not evasion

DCSync has no clever exploit; it is permissions plus a legitimate API. The closest thing to a bypass of the "you need an account with rights" prerequisite is doing it through a relayed NTLM authentication, but the DRSUAPI always requires signing, so this only works where the target DC is vulnerable to Zerologon (CVE-2020-1472). On a patched domain that path is closed, which is one more reason Zerologon patching is non-negotiable. Beyond that, attackers do not evade DCSync detection so much as blend in: they run it from a context that already looks privileged, which is exactly why the detections below focus on where the request came from rather than whether it happened.

Detection: it looks like replication, so watch who is replicating

DCSync is hard precisely because the request is legitimate. The signal is not the operation, it is the source: a replication request that did not come from a domain controller. Cover it in two places, the directory and the network.

SECURITY EVENT ID 4662

Replication rights exercised

With Audit Directory Service Access enabled on DCs, event 4662 fires when an object operation uses the replication control-access rights. Alert on 4662 with access mask 0x100 (Control Access) and a Properties field containing DS-Replication-Get-Changes, -All, or their GUIDs, where the SubjectUserName is not a machine account (does not end in $). Filter known replicators: real DCs, and Azure AD Connect MSOL_ accounts.

NETWORK IDS/NDR

DRSUAPI from a non-DC

At the wire, a DRSUAPI bind followed by a DsGetNCChanges request sourced from anything other than a known DC IP is the cleanest DCSync indicator. Suricata/Zeek rules (and NDR products) key on the DRSUAPI interface UUID e3514235-4b06-11d1-ab04-00c04fc2dcd2 and the DsGetNCChanges opnum, scoped to traffic to DCs that did not originate from DCs.

SECURITY 4624 CORRELATION

Tie the request to a logon

Correlate 4662 with the 4624 (logon type 3) that shares its Logon ID on the receiving DC. That tells you the source host of the replication request. If it is not a DC, investigate. This is the step that turns a noisy 4662 into an attributable alert.

ACL BASELINE DRIFT

New replication ACEs

Monitor the domain head's ACL (event 5136 on the domain object, plus periodic ACL enumeration) for new grants of the Get-Changes rights. A fresh replication ACE on a non-admin principal is persistence being planted, catchable before it is ever used.

Event 4662 is famously noisy and does not record the target of the replication, only that replication rights were used. Treat it as a lead, not a verdict: the high-fidelity signal is the combination of non-machine subject plus replication right plus a source host that is not a DC, which is why the network view and the 4624 correlation carry so much weight.

Preventing DCSync: audit the rights, then watch them

There is no switch that disables replication, because the domain needs it. Prevention is about making sure only the right principals can do it, and making any change to that list loud.

  1. Find everyone who can replicate, today. Enumerate the ACEs on the domain head and list every principal holding Get-Changes / Get-Changes-All. Anything beyond Domain Controllers, Domain Admins, Enterprise Admins, Administrators (and a known, documented Azure AD Connect account) is a finding.
    PowerShell listing principals with replication rights on the domain head
    BloodHound makes the same finding visually: the DCSync / GetChanges+GetChangesAll edges to the domain node show every path that leads to replication, including the indirect ones through group nesting and ACL chains that are easy to miss by hand.
  2. Remove rogue replication ACEs. For any unexpected principal, strip the grant. Treat a replication ACE on a service account or a custom group as high severity; it is either a misconfiguration or planted persistence, and both need to go. Re-check after every product install that touches AD, since backup, sync, and identity tools sometimes grant themselves these rights.
  3. Enforce least privilege on the groups that have it by default. The real exposure is usually not a rogue ACE, it is bloated Domain Admins / Enterprise Admins / Administrators membership. Everything the earlier posts argued, Protected Users, tiering, admin hygiene, LAPS, is what keeps the set of accounts that can DCSync small enough to watch. Audit these groups (and Backup Operators, Account Operators, Server Operators, Schema Admins, which can escalate into replication) on a schedule.
  4. Constrain replication at the network layer where you can. Replication should only ever flow between domain controllers. RPC filters / Windows Defender Firewall rules and segmentation that restrict the DRSUAPI interface to DC-to-DC traffic turn a workstation's DCSync attempt into a blocked connection, and a blocked connection is itself an alert. This does not replace the ACL work, it backstops it.
  5. Patch Zerologon and keep DCs current. The only relay path into DCSync runs through Zerologon. A fully patched DC estate closes it. This is table stakes, but it is on this list because it is the one thing that removes a no-credentials route to replication.
  6. Have the krbtgt playbook ready. If DCSync against krbtgt is even suspected, assume Golden Ticket persistence and reset krbtgt twice (with the replication interval between resets), on top of a full privileged-credential rotation. Decide this before you need it.
  7. Prove detection fires. Run a controlled DCSync in a lab from a non-DC host and confirm your 4662 rule, your network signature, and your 4624 correlation all light up and attribute it correctly. Detection rules rot and exceptions creep in; the only way to trust the 4662 alert is to generate the event and watch what happens. Again, exactly what breach and attack simulation exists for.

The short version

Two credential stores outlive host hardening. Cached domain logons keep a DCC2 verifier on every machine so users can work offline; it cannot be replayed, only cracked, so you defeat it by caching less (a low CachedLogonsCount through GPO, 0 where offline logon is not needed), putting admins in Protected Users so no verifier is written, enforcing strong passwords, and encrypting the disk that leaves the building. DCSync is the other extreme: a legitimate replication request that hands over the whole directory, krbtgt included, with no code on the domain controller, gated only by the Get-Changes and Get-Changes-All rights. You defeat it by auditing exactly who holds those rights (PowerShell and BloodHound), stripping rogue ACEs, keeping the default privileged groups small, patching Zerologon, and detecting the request by its source: a replication call from something that is not a domain controller. Cache less and make what remains worthless; replicate only between DCs and watch anyone who tries otherwise. Do both, and the last two credential stores stop being free wins.

Coming up in this series

This post closed the credential stores. The next post takes the credential abuse paths that remain through the same lens: what breaks when the control is off, exactly how an attacker abuses the gap, and how to turn it on and keep it on, with a lab walkthrough and detections.

  1. Kerberoasting & delegation: Weak service-account secrets and unconstrained / constrained / RBCD delegation, from the offensive test to the hardening.

Sources & Further Reading Microsoft, Cached domain logon information (KB172931: CachedLogonsCount, default 10, range 0-50)
Microsoft, Protected Users Security Group (no cached verifier for members)
MITRE ATT&CK: T1003.005 (Cached Domain Credentials) and T1003.006 (DCSync)
The Hacker Recipes, DCSync and Cached Domain Credentials (MS-DRSR, DsGetNCChanges, extended rights, secretsdump/mimikatz commands)
cyberkhalid, Cached Domain Credentials | ViperOne Pentest Everything, Cached Domain Credentials (DCC2 format, hashcat 2100 / john mscash2)
NCC Group, Defending Your Directory: Securing Active Directory Against DCSync Attacks (event 4662, replication GUIDs, least privilege, group auditing)
Elastic Security, Potential Credential Access via DCSync (4662 detection logic, 0x100 access mask, MSOL_ / machine-account filtering)
Trellix, DCSync Detection Without Signatures (NDR) | NVISO / Didier Stevens / Black Lantern, Detecting DCSync on the wire (DRSUAPI UUID, DsGetNCChanges from non-DC)
CIS Microsoft Windows Benchmarks (number of previous logons to cache) | Safelink IT, Limit cached domain logons

Everything shown here was performed in an isolated lab domain we own (CYTOMATE.LOCAL), for defensive research and authorised testing. A domain controller holds the credentials for the entire domain, so take a snapshot first and never run any of this against a machine or directory you do not have explicit permission to test.

More from the Blog

Threat Intelligence Nov 29, 2026

The Build-Pipeline Backdoor: Inside the NullReceiver Supply-Chain Campaign

Read More
Deception Nov 29, 2026

Lying to the Machines: The Secret Weapon Against AI Attacks

Read More
Agentic Security Nov 24, 2026

Your AI Coding Agents Need an EDR Too: Introducing cADRe

Read More