
Python script for Kerberoasting with targeted ACL abuse: sets temporary SPNs on users without them, extracts Kerberos hashes, then removes the SPN. Supports NTLM, Kerberos, and pass-the-hash authentication.
targetedKerberoast는 다른 많은 도구(예: GetUserSPNs.py)와 마찬가지로 SPN이 설정된 사용자 계정에 대한 "kerberoast" 해시를 출력하는 Python 스크립트입니다.
이 도구는 다음과 같은 추가 기능을 제공합니다: SPN이 없는 각 사용자에 대해 하나의 SPN을 설정(servicePrincipalName 속성에 대한 쓰기 권한 남용)하고, "kerberoast" 해시를 출력한 다음, 해당 작업을 위해 설정된 임시 SPN을 삭제합니다. 이를 타겟 케르베로스팅(Targeted Kerberoasting)이라고 합니다.
이 도구는 도메인의 모든 사용자, 목록에 제공된 사용자, 또는 CLI에서 제공된 단일 사용자에 대해 사용할 수 있습니다.
이 공격에 대한 자세한 정보
이 도구는 다음 인증 방식을 지원합니다
그 외에도 targetedKerberoast는 다단계 상세 출력(verbosity)을 지원하며, 명령어에 -v, -vv, ...를 추가하기만 하면 됩니다 :)
usage: targetedKerberoast.py [-h] [-v] [-q] [-D TARGET_DOMAIN] [-U USERS_FILE] [--request-user username] [-o OUTPUT_FILE] [--use-ldaps] [--only-abuse] [--no-abuse] [--dc-ip ip address] [-d DOMAIN] [-u USER]
[-k] [--no-pass | -p PASSWORD | -H [LMHASH:]NTHASH | --aes-key hex key]
Queries target domain for SPNs that are running under a user account and operate targeted Kerberoasting
optional arguments:
-h, --help show this help message and exit
-v, --verbose verbosity level (-v for verbose, -vv for debug)
-q, --quiet show no information at all
-D TARGET_DOMAIN, --target-domain TARGET_DOMAIN
Domain to query/request if different than the domain of the user. Allows for Kerberoasting across trusts.
-U USERS_FILE, --users-file USERS_FILE
File with user per line to test
--request-user username
Requests TGS for the SPN associated to the user specified (just the username, no domain needed)
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Output filename to write ciphers in JtR/hashcat format
-f {hashcat,john}, --output-format {hashcat,john}
Output format (default is "hashcat", "john" prepends usernames)
--use-ldaps Use LDAPS instead of LDAP
--only-abuse Ignore accounts that already have an SPN and focus on targeted Kerberoasting
--no-abuse Don't attempt targeted Kerberoasting
authentication & connection:
--dc-ip ip address IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted it will use the domain part (FQDN) specified in the identity parameter
-d DOMAIN, --domain DOMAIN
(FQDN) domain to authenticate to
-u USER, --user USER user to authenticate with
secrets:
-k, --kerberos Use Kerberos authentication. Grabs credentials from .ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones specified in the
command line
--no-pass don't ask for password (useful for -k)
-p PASSWORD, --password PASSWORD
password to authenticate with
-H [LMHASH:]NTHASH, --hashes [LMHASH:]NTHASH
NT/LM hashes, format is LMhash:NThash
--aes-key hex key AES key to use for Kerberos Authentication (128 or 256 bits)
다음은 도구가 수행할 수 있는 작업의 예입니다.

Impacket 팀 전체와 기여자들에게 감사드립니다.