
Domain Password Audit Tool for Pentesters
DPAT is a Python-based security tool that analyzes password hashes extracted from Active Directory domain controllers. It generates comprehensive HTML reports showing password usage statistics, policy violations, and security insights from both NTDS dumps and password cracking results.



Install core dependencies:
pip install -r requirements.txt
For development and testing:
pip install -r requirements-dev.txt
If you prefer to install dependencies individually:
pip install pycryptodome
poetry install
python dpat.py -n customer.ntds -c hashcat.potfile -p 8
python dpat.py -n <ntds_file> -c <cracked_file> -p <min_password_length>
-n, --ntdsfile: NTDS file (output from secretsdump.py)-c, --crackfile: Password cracking output file (hashcat.potfile, john.pot, etc.)-p, --minpasslen: Minimum password length from domain policy-o, --outputfile: HTML report filename (default: _DomainPasswordAuditReport.html)-d, --reportdirectory: Output directory (default: "DPAT Report")-s, --sanitize: Sanitize passwords and hashes in reports-g, --groupsdirectory: Directory containing group membership files-m, --machineaccts: Include machine accounts in analysis-k, --krbtgt: Include krbtgt account in analysis-kz, --kerbfile: File containing Kerberoastable accounts-w, --writedb: Write SQLite database to disk for inspection--no-prompt: Skip browser prompt (useful for automation)-dbg, --debug: Enable debug outputBasic analysis:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8
With group analysis:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -g /path/to/groups
Sanitized report:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -s
With Kerberoastable accounts:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -kz kerberoastable.txt
The NTDS file should be in the format output by secretsdump.py:
domain\username:RID:lmhash:nthash:::
Hashcat format:
nthash:password
lmhash:password
John the Ripper format:
$NT$nthash:password
$LM$lmhash:password
Hex encoded passwords:
nthash:$HEX[68656c6c6f]
Group membership files should contain one username per line:
domain\username
On a domain controller, create an IFM (Install From Media) backup:
ntdsutil "ac in ntds" "ifm" "cr fu c:\temp" q q
This creates:
c:\temp\Active Directory\ntds.ditc:\temp\registry\SYSTEMUse secretsdump.py to convert the backup:
secretsdump.py -system registry/SYSTEM -ntds "Active Directory/ntds.dit" LOCAL -outputfile customer
For password history (if available):
secretsdump.py -system registry/SYSTEM -ntds "Active Directory/ntds.dit" LOCAL -outputfile customer -history
Using Hashcat:
hashcat -m 1000 customer.ntds /path/to/wordlist
Using John the Ripper:
john --format=NT customer.ntds
DPAT generates comprehensive reports including:
The repository includes sample data in the sample_data/ directory for testing:
customer.ntds: Sample NTDS fileoclHashcat.pot: Sample cracked passwordshistory/: Sample data with password historyTest with sample data:
python dpat.py -n sample_data/customer.ntds -c sample_data/oclHashcat.pot -p 8
Create group membership files using PowerShell:
Get-NetGroupMember -Recurse -GroupName "Domain Admins" > "Domain Admins.txt"
Use CypherHound's parse-kerberoastable.py script to generate Kerberoastable account files for enhanced analysis.
You can plug files into DPAT generated by CypherHound in order to provide more statistics to DPAT reports. Currently, the extra statistics are:
If you would like to utilize it for providing these extra statistics you will need to utilize the scripts here:
-g flag.-kz flag.They are simple scripts with usage linked above and using them should be straightforward.
Use the -s flag to create sanitized reports suitable for sharing:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -s
"No module named 'distutils'"
Empty reports
Missing details links
Enable debug output for troubleshooting:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -dbg
Run the test suite:
python -m unittest tests.unit.test_core -v
python -m unittest tests.integration.test_integration -v
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions, please use the GitHub issue tracker.