Pentest List Wiki
  • What is Pentest List Wiki?
  • OFFENSIVE SECURITY
    • External Infrastructure
      • Discovery
        • Email Address Discovery
        • Subdomain Discovery
        • Data Discovery
        • Port & Service Discovery
      • Exploitation
        • Password Spraying
        • Vulnerability Scanning
    • Internal Infrastructure
      • General Discovery
        • AD Attack Path Discovery
        • Port & Service Discovery
      • Credential Discovery
        • Passwords and NetNTLM
        • SAM & LSA secrets
        • NTDS.dit secrets
        • LSASS secrets
        • DCSync
        • DPAPI secrets
      • Movement
        • Credential Spraying
        • SMB Relaying
        • Pass The Hash
      • Infiltration/Exfiltration
        • Pivoting (Proxying)
    • Web Application
      • Discovery
        • Testing API Keys
        • Vulnerability Scan
        • Web Content Discovery
        • Parameter Discovery
        • VHOST Discovery
        • CMS Scanners
      • Exploitation
        • Authentication
          • Email Address Forms
          • AWS Cognito
        • JSON Web Tokens
        • Injection Attacks
          • SQL Injection
          • Cross-Site Scripting
          • HTTP Headers
      • Bypasses
        • Cloudflare Bypass
        • HTTP 403 Bypass
    • Mobile (iOS/Android)
      • iOS
        • IPA Decryption
        • Filesystem Analysis
        • Static Analysis
    • Cloud
      • AWS
        • Vulnerability Scanners
        • S3 Buckets
      • Azure
        • Vulnerability Scanners
        • m365 & Entra ID
  • DEFENSIVE SECURITY
    • Forged Kerberos Tickets
    • Logon Event Visualisation
Powered by GitBook
On this page
  • Overview
  • Local Dumping (With or Without Credentials)
  • Remotely Dumping (With Credentials)
  1. OFFENSIVE SECURITY
  2. Internal Infrastructure
  3. Credential Discovery

NTDS.dit secrets

How to find sensitive data in NTDS.dit.

PreviousSAM & LSA secretsNextLSASS secrets

Last updated 11 months ago

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.

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.

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.

The following command will dump the NTDS.dit data:

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.

secretsdump.py performs various techniques to dump password hashes and secrets.

The following command will dump hashes from NTDS.dit

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

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