> For the complete documentation index, see [llms.txt](https://wiki.pentestlist.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.pentestlist.com/offensive-security/internal-infrastructure/credential-discovery/ntds.dit-secrets.md).

# NTDS.dit secrets

## Overview

Windows domain controllers use a database file known as NTDS.dit (Windows NT Directory Services), to store Active Directory data and use it to manage domain and network resources. This file is very powerful with secrets extraction, as the extracted data can be used for many attack paths. &#x20;

## Local Dumping (With or Without Credentials)

**Dumping NTDS.dit**

NTDS.dit can be dumped **locally** using the Windows ntdsutil.exe tool. This tool saves a snapshot of the Active Directory data. To use this tool, you must be on a domain controller via credentialled login or have gained access without credentials via other means.&#x20;

The following command should be used:

`powershell "ntdsutil.exe 'ac i ntds' 'ifm' 'create full c:\temp' q q"`

After executing ntdsutil.exe, the NTDS.dit, SYSTEM and SECURITY registry hives will be in c:\temp:

**Credential Extraction**

To extract the data from NTDS.dit, secretsdump.py can be used which performs various techniques to dump password hashes and secrets.&#x20;

* <https://github.com/fortra/impacket/blob/master/examples/secretsdump.py>

The following command will dump the NTDS.dit data:&#x20;

`secretsdump.py -system SYSTEM -security SECURITY -ntds ntds.dit local`

## Remotely Dumping (With Credentials)

NTDS.dit can be dumped **remotely** using secrets-dump. However, a domain administrator is required.&#x20;

secretsdump.py performs various techniques to dump password hashes and secrets.&#x20;

* <https://github.com/fortra/impacket/blob/master/examples/secretsdump.py>

**The following command will dump hashes from NTDS.dit**

`secretsdump.py -just-dc-ntlm <DOMAIN>/<USER>@<TARGET>`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.pentestlist.com/offensive-security/internal-infrastructure/credential-discovery/ntds.dit-secrets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
