
도메인 비밀번호 감사 도구 (Pentester용)
DPAT는 Active Directory 도메인 컨트롤러에서 추출한 비밀번호 해시를 분석하는 Python 기반 보안 도구입니다. NTDS 덤프와 비밀번호 크래킹 결과로부터 비밀번호 사용 통계, 정책 위반 및 보안 인사이트를 종합한 HTML 보고서를 생성합니다.



핵심 종속성 설치:
pip install -r requirements.txt
개발 및 테스트용:
pip install -r requirements-dev.txt
개별적으로 종속성을 설치하려는 경우:
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 파일 (secretsdump.py 출력)-c, --crackfile: 비밀번호 크래킹 출력 파일 (hashcat.potfile, john.pot 등)-p, --minpasslen: 도메인 정책의 최소 비밀번호 길이-o, --outputfile: HTML 보고서 파일 이름 (기본값: _DomainPasswordAuditReport.html)-d, --reportdirectory: 출력 디렉터리 (기본값: "DPAT Report")-s, --sanitize: 보고서에서 비밀번호 및 해시 정제-g, --groupsdirectory: 그룹 구성원 파일이 포함된 디렉터리-m, --machineaccts: 분석에 컴퓨터 계정 포함-k, --krbtgt: 분석에 krbtgt 계정 포함-kz, --kerbfile: Kerberoastable 계정이 포함된 파일-w, --writedb: 검사용 SQLite 데이터베이스를 디스크에 쓰기--no-prompt: 브라우저 프롬프트 건너뛰기 (자동화에 유용)-dbg, --debug: 디버그 출력 활성화기본 분석:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8
그룹 분석 포함:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -g /path/to/groups
정제된 보고서:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -s
Kerberoastable 계정 포함:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -kz kerberoastable.txt
NTDS 파일은 secretsdump.py가 출력하는 형식이어야 합니다:
domain\username:RID:lmhash:nthash:::
Hashcat 형식:
nthash:password
lmhash:password
John the Ripper 형식:
$NT$nthash:password
$LM$lmhash:password
16진수 인코딩된 비밀번호:
nthash:$HEX[68656c6c6f]
그룹 구성원 파일은 한 줄에 하나의 사용자 이름을 포함해야 합니다:
domain\username
도메인 컨트롤러에서 IFM(설치 미디어에서) 백업을 생성합니다:
ntdsutil "ac in ntds" "ifm" "cr fu c:\temp" q q
그러면 다음이 생성됩니다:
c:\temp\Active Directory\ntds.ditc:\temp\registry\SYSTEMsecretsdump.py를 사용하여 백업을 변환합니다:
secretsdump.py -system registry/SYSTEM -ntds "Active Directory/ntds.dit" LOCAL -outputfile customer
비밀번호 이력(사용 가능한 경우):
secretsdump.py -system registry/SYSTEM -ntds "Active Directory/ntds.dit" LOCAL -outputfile customer -history
Hashcat 사용:
hashcat -m 1000 customer.ntds /path/to/wordlist
John the Ripper 사용:
john --format=NT customer.ntds
DPAT는 다음을 포함한 종합 보고서를 생성합니다:
저장소에는 테스트용 sample_data/ 디렉터리에 샘플 데이터가 포함되어 있습니다:
customer.ntds: 샘플 NTDS 파일oclHashcat.pot: 샘플 크래킹된 비밀번호history/: 비밀번호 이력이 포함된 샘플 데이터샘플 데이터로 테스트:
python dpat.py -n sample_data/customer.ntds -c sample_data/oclHashcat.pot -p 8
PowerShell을 사용하여 그룹 구성원 파일을 생성합니다:
Get-NetGroupMember -Recurse -GroupName "Domain Admins" > "Domain Admins.txt"
CypherHound의 parse-kerberoastable.py 스크립트를 사용하여 향상된 분석을 위한 Kerberoastable 계정 파일을 생성합니다.
CypherHound에서 생성된 파일을 DPAT에 연결하여 DPAT 보고서에 더 많은 통계를 제공할 수 있습니다. 현재 추가 통계는 다음과 같습니다:
이러한 추가 통계를 제공하기 위해 활용하려면 여기에 있는 스크립트를 사용해야 합니다:
-g 플래그로 전달합니다.-kz 플래그로 전달합니다.이는 간단한 스크립트이며, 사용법은 위 링크에 나와 있으므로 사용법은 간단합니다.
-s 플래그를 사용하여 공유에 적합한 정제된 보고서를 생성합니다:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -s
"'distutils' 모듈이 없습니다"
빈 보고서
세부정보 링크 누락
문제 해결을 위해 디버그 출력 활성화:
python dpat.py -n customer.ntds -c hashcat.potfile -p 8 -dbg
테스트 스위트 실행:
python -m unittest tests.unit.test_core -v
python -m unittest tests.integration.test_integration -v
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
문제, 질문 또는 기여 사항은 GitHub 이슈 트래커를 사용해 주세요.