NTDS secrets
MITRE ATT&CK™ Sub-technique T1003.003
Last updated
Was this helpful?
MITRE ATT&CK™ Sub-technique T1003.003
Last updated
Was this helpful?
NTDS (Windows NT Directory Services) is the directory services used by Microsoft Windows NT to locate, manage, and organize network resources. The NTDS.dit file is a database that stores the Active Directory data (including users, groups, security descriptors and password hashes). This file is stored on the domain controllers.
Once the secrets are extracted, they can be used for various attacks: , , , , pass-the-hash, or .
Since the NTDS.dit is constantly used by AD processes such as the Kerberos KDC, it can't be copied like any other file. In order to exfiltrate it from a live domain controller and extract password hashes from it, many techniques can be used.
Just like with SAM & LSA secrets, the SYSTEM registry hive contains enough info to decrypt the NTDS.dit data. The hive file (\system32\config\system
) can either be exfiltrated the same way the NTDS.dit file is, or it can be exported with reg save HKLM\SYSTEM 'C:\Windows\Temp\system.save'
.
's (Python) can be used to remotely dump NTDS.dit through Volume Shadow Copy. Several authentication methods can be used like (LM/NTLM), or (Kerberos).
(Python) can also be used to remotely dump NTDS.dit through Volume Shadow Copy or NTDSUtil. It offers several authentication methods like (NTLM), or (Kerberos)
In addition when using NetExec or Secretsdump, the -exec-method
option can be set to smbexec
, wmiexec
or mmcexec
to specify the remote command execution method on which the process should rely.
is a PowerShell script part of the PowerSploit suite able to "copy files off an NTFS volume by opening a read handle to the entire volume (such as c:) and parsing the NTFS structures. This technique is stealthier than the others.
Once the required files are exfiltrated, they can be parsed by tools like (Python, part of ) or (Go, faster for big files).
With the required files, it is possible to extract more information than just secrets. The NTDS file is responsible for storing the entire directory, with users, groups, OUs, trusted domains etc... This data can be retrieved by parsing the NTDS with tools like . With the NTDS alone, objects can be extracted from the NTDS such as user and machine accounts, with a lot of information about them: descriptions, user account control flags, last logon and password change timestamps etc. This information is stored as an SQLite database which is easier to browse and query.