NTDS secrets
MITRE ATT&CK™ Sub-technique T1003.003
Theory
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: credential spraying, stuffing, shuffling, cracking, pass-the-hash, overpass-the-hash or silver or golden tickets.
Practice
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'
.
Secretsdump.py
Impacket's secretsdump (Python) can be used to remotely dump NTDS.dit through Volume Shadow Copy. Several authentication methods can be used like pass-the-hash (LM/NTLM), or pass-the-ticket (Kerberos).
NetExec
NetExec (Python) can also be used to remotely dump NTDS.dit through Volume Shadow Copy or NTDSUtil. It offers several authentication methods like pass-the-hash (NTLM), or pass-the-ticket (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.
Resources
Last updated