1. Resources
  2. Detection rules
  3. NTDS.dit Extraction

NTDS.dit Extraction detection rules

Copying the Active Directory database (NTDS.dit) from a domain controller, through ntdsutil install-from-media or a volume shadow copy, gives the attacker every password hash in the domain offline.

Platform
Active Directory
Severity
Critical
Log source
Windows Security event log
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Administrative rights on a domain controller, which groups such as Backup Operators and Server Operators also give, and a way to move the copied files off it.
Impact
The attacker can extract every account's hash offline, including krbtgt, and use them for pass-the-hash, Golden Tickets and password cracking.
Response
Disable the account that made the copy, reset the krbtgt password twice, and reset the credentials of every privileged account and every service account.
Mitigation
Restrict logon to domain controllers to Tier 0 administrators, keep the operator groups empty, and treat IFM media and domain controller backups as Tier 0 assets.
Event IDs
46885145

How the attack works

NTDS.dit is the Active Directory database on every domain controller. Together with the SYSTEM registry hive, which holds the boot key that protects it, it contains the password hashes and Kerberos keys of every account in the domain. AD DS keeps the file locked while it runs, so attackers copy it in ways that avoid the lock: ntdsutil's Install From Media (IFM) feature, which writes a copy of the database and registry for building new domain controllers, or a volume shadow copy from which the file is read.

Both methods need administrative access to a domain controller and run as processes on it. With "Audit Process Creation" and "Include command line in process creation events" enabled, each step is logged in event 4688 with the executable in NewProcessName and the arguments in CommandLine. Interactive ntdsutil sessions and shadow copies created through scripts or backup APIs leave less on the command line, so the rules cover the common, scripted forms. The copy still has to leave the server, and where "Audit Detailed File Share" is enabled, reading it through a network share of the domain controller is logged in event 5145 with the file name in RelativeTargetName.

What an attacker needs

  • Administrative rights on a domain controller (Domain Admins, Administrators, or groups such as Backup Operators and Server Operators that can log on to domain controllers).
  • A way to move the copied files off the domain controller.

Impact

The attacker can extract every account's hash offline, including krbtgt, and use them for pass-the-hash, Golden Tickets and password cracking. Recovery requires resetting krbtgt twice and every privileged and service account credential.

Detection rules

NTDS.dit Referenced on a Command Line or Shadow Copy Created

Detects process creation (4688) whose command line references the ntds.dit file, as when the database is copied out of a volume shadow copy, and shadow copies created with vssadmin, the usual way to get a readable copy of the locked file. Deploy on domain controllers; requires process creation auditing with command lines.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: NTDS.dit Referenced on a Command Line or Shadow Copy Created
id: 3904a817-caf8-4398-af7b-a6ad29427a11
status: experimental
description: >-
  Detects process creation (4688) whose command line references the ntds.dit
  file, as when the database is copied out of a volume shadow copy, and
  shadow copies created with vssadmin, the usual way to get a readable copy of
  the locked file. Deploy on domain controllers; requires process creation
  auditing with command lines.
references:
  - https://attack.mitre.org/techniques/T1003/003/
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4688
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
author: Forestall
date: 2026-11-10
tags:
  - attack.credential-access
  - attack.t1003.003
logsource:
  product: windows
  service: security
detection:
  selection_ntds_file:
    EventID: 4688
    CommandLine|contains: 'ntds.dit'
  selection_shadow_copy:
    EventID: 4688
    NewProcessName|endswith: '\vssadmin.exe'
    CommandLine|contains: 'create shadow'
  condition: 1 of selection_*
falsepositives:
  - Database maintenance such as offline defragmentation or recovery with ntdsutil or esentutl, and backup software that calls vssadmin. Confirm with the administrator and exclude the backup service account by SubjectUserName.
level: high

False positives

  • Database maintenance such as offline defragmentation or recovery with ntdsutil or esentutl, and backup software that calls vssadmin. Confirm with the administrator and exclude the backup service account by SubjectUserName.

File Named ntds.dit Accessed Through a Network Share of a Domain Controller

Detects access over the network (5145) to a file named ntds.dit on a domain controller. Install-from-media output and copies taken from a volume shadow copy are ordinary files that the attacker still has to move off the server, and reading them through an administrative or other share is logged with the file name in RelativeTargetName, whatever process created the copy. Microsoft recommends monitoring Share Name and Relative Target Name for critical files. Requires "Audit Detailed File Share" on the domain controllers. A copy moved off the server another way, or renamed before it is read, is not detected.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: File Named ntds.dit Accessed Through a Network Share of a Domain Controller
id: f2e62622-f826-49fe-ae16-71bfc17fc911
status: experimental
description: >-
  Detects access over the network (5145) to a file named ntds.dit on a
  domain controller. Install-from-media output and copies taken from a volume
  shadow copy are ordinary files that the attacker still has to move off the
  server, and reading them through an administrative or other share is logged
  with the file name in RelativeTargetName, whatever process created the copy.
  Microsoft recommends monitoring Share Name and Relative Target Name for
  critical files. Requires "Audit Detailed File Share" on the domain
  controllers. A copy moved off the server another way, or renamed before it
  is read, is not detected.
references:
  - https://attack.mitre.org/techniques/T1003/003/
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5145
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/simplified-administration-appendix
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1003.003
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5145
    RelativeTargetName|endswith: 'ntds.dit'
  condition: selection
falsepositives:
  - Planned install-from-media builds where the media is copied to the new domain controller through a share, and backup products that read the database files over the network. Match the event to a change record by SubjectUserName and IpAddress, and exclude a documented backup account by exact SubjectUserName.
level: high

False positives

  • Planned install-from-media builds where the media is copied to the new domain controller through a share, and backup products that read the database files over the network. Match the event to a change record by SubjectUserName and IpAddress, and exclude a documented backup account by exact SubjectUserName.

Active Directory Installation Media Created with Ntdsutil

Detects ntdsutil.exe started with the ifm (Install From Media) menu on the command line (4688). IFM writes a copy of NTDS.dit and the registry hives needed to read it, which is also a convenient way for an attacker with administrative access to a domain controller to take the whole directory database. Requires process creation auditing with command lines.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: Active Directory Installation Media Created with Ntdsutil
id: 3c9fc3eb-b8c8-4968-a760-d270b8297b6e
status: experimental
description: >-
  Detects ntdsutil.exe started with the ifm (Install From Media) menu on the
  command line (4688). IFM writes a copy of NTDS.dit and the registry hives
  needed to read it, which is also a convenient way for an attacker with
  administrative access to a domain controller to take the whole directory
  database. Requires process creation auditing with command lines.
references:
  - https://attack.mitre.org/techniques/T1003/003/
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4688
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/simplified-administration-appendix
author: Forestall
date: 2026-11-10
tags:
  - attack.credential-access
  - attack.t1003.003
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4688
    NewProcessName|endswith: '\ntdsutil.exe'
    CommandLine|contains: 'ifm'
  condition: selection
falsepositives:
  - Planned creation of install-from-media sets for new domain controllers. Confirm with the change record.
level: high

False positives

  • Planned creation of install-from-media sets for new domain controllers. Confirm with the change record.

Triage

  • Identify the account (SubjectUserName) and whether an approved domain controller build or recovery task, such as creating IFM media for a new DC, was scheduled.
  • Check the target folder in CommandLine and look for the files being archived or copied off the server shortly afterwards.
  • Review how the account logged on to the domain controller (4624) and what else it ran in the same session.
  • If not explained, assume all domain credentials are exposed and start the krbtgt and privileged password reset procedure.

Response

Once the attack is confirmed:

  1. Disable the account that made the copy, end its sessions on the domain controller and block the ways the files could leave it. Establish where the copy was written and whether it was archived or moved.
  2. Reset the krbtgt password twice, following the documented procedure, so that tickets forged with the stolen krbtgt key stop working.
  3. Reset the credentials of every privileged account and every service account. Then plan a password change for all remaining users, because the file held the hash of every account in the domain.
  4. Delete the install-from-media set and the shadow copies that were created for the theft, on the domain controller and on any host the files passed through.
  5. Find how the account obtained administrative access to the domain controller and remove that path. Empty the operator groups if one of them was the way in.
  6. After the resets, hunt for use of the old hashes, such as NTLM logons and RC4 Kerberos tickets for privileged accounts from unexpected hosts.

Mitigation

  • Restrict logon to domain controllers to Tier 0 administrators, and keep Backup Operators, Server Operators and Print Operators empty.
  • Treat IFM media and domain controller backups as Tier 0 assets that are encrypted and access controlled.
  • Enable process creation auditing with command lines on domain controllers and forward the events.
  • Monitor administrative logons to domain controllers and alert on interactive sessions outside change windows.

Frequently asked questions

Which ways of copying NTDS.dit do these rules not see?

The process rules read command lines. An interactive ntdsutil session, where the commands are typed inside the tool, and shadow copies created through scripts or backup APIs leave little on the command line. The share access rule sees a file named ntds.dit read through a network share of the domain controller, whatever created it, but not a copy that is renamed first or moved off another way. Monitor administrative logons to domain controllers as well.

What must be enabled for event 4688 to show the command line?

Audit Process Creation and the policy setting Include command line in process creation events, both on the domain controllers. Without the second setting the event carries no command line, and neither rule can match the ntds.dit file name, the shadow copy arguments or the ifm keyword.

How do I tell planned install-from-media from theft of the database?

A planned set is created for a new domain controller, has a change record and is made by a Tier 0 administrator. Theft shows an unexpected account or logon source, an unusual target folder, and the files being archived or copied off the server shortly afterwards.

Is resetting the passwords of administrators enough after NTDS.dit was copied?

No. Together with the SYSTEM registry hive, the database gives the attacker the password hashes and Kerberos keys of every account, including krbtgt. Recovery requires resetting krbtgt twice and every privileged and service account credential. Until then the attacker can authenticate with the hashes and forge tickets with the krbtgt key.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.