Skip to content
WETNav

Credential accessCritical

NTDS.dit Theft

Also known as NTDS dumping, Active Directory database extraction

How NTDS.dit theft shows up on a DC: ESENT 216/325/326/327 naming ntds.dit, plus vssadmin or ntdsutil process creation in 4688.

Signals in the logs

  1. 01Application325ESENT database engine created a new databaseDomain controller

    The ESENT database engine reports creating a new database whose name or path is the directory database, consistent with an extracted copy.

    Provider
    ESENT
    Data
    contains ntds.dit, often under a Temp, Users, or root-of-drive path
  2. 02Application327ESENT database engine detached a databaseDomain controller

    The engine detaches a database copy of ntds.dit, the counterpart to the attach/create during extraction.

    Provider
    ESENT
    Data
    contains ntds.dit
  3. 03Application216ESENT database location change detectedDomain controller

    A database location change involving the directory database, seen when the file is copied or mounted elsewhere.

    Provider
    ESENT
    Data
    contains ntds.dit
  4. 04Security4688A new process has been createdDomain controller

    Creation of the tools used to snapshot or export the database on a domain controller.

    NewProcessName
    ends with vssadmin.exe, ntdsutil.exe, esentutl.exe or diskshadow.exe
    CommandLine
    references ntds, a shadow copy, or an 'ifm' / 'create full' operation

What happens

The Active Directory database file holds the password hashes of every domain account. Because the live file is locked, an adversary copies it through a volume shadow copy or the directory maintenance tooling, then extracts the hashes offline. Creating and mounting that copy drives the database engine to open a second instance of the file, which it records in the Application log, and the tools that create the shadow copy or export the database appear as process creations on the domain controller. Both traces name the database file or the shadow path.

Logging you need

  • ESENT events (216, 325, 326, 327) are written to the Application log by the database engine on domain controllers without extra audit policy; raise the Application log size so they survive.
  • Audit subcategory Detailed Tracking > Process Creation = Success on domain controllers (for 4688), with 'Include command line in process creation events' enabled so the CommandLine field is populated.

Hunt queries

Starting points. Tune thresholds and exclusions to your environment before alerting on them.

Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='ESENT'; Id=216,325,326,327} |
    Where-Object { $_.Message -match 'ntds\.dit' } |
    Select-Object TimeCreated, Id, Message

Benign look-alikes

  • Legitimate system-state and Active Directory backups create shadow copies and touch the database, producing the same ESENT events.
  • Promoting a new domain controller via Install From Media (IFM) runs ntdsutil and creates a database copy as designed.
  • Backup and monitoring agents invoke vssadmin and shadow copies on a schedule.

Notes

  • Extraction yields offline hashes just like DCSync, but leaves file and database traces instead of replication reads; an environment may see one path or the other.
  • Remote execution of the snapshot tooling may also leave a service install (7045) or a WMI or scheduled-task trace that pairs with the ESENT events.

References