
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 で指定された 1 人のユーザーに対して使用できます。
More information about this attack
This tool supports the following authentications
その他にも、targetedKerberoast はマルチレベルの冗長性をサポートしており、コマンドに -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 とその貢献者のチーム全体に感謝します。