
Script de Python para Kerberoasting con abuso de ACL dirigido: establece SPNs temporales en usuarios sin ellos, extrae hashes Kerberos y luego elimina el SPN. Compatible con autenticación NTLM, Kerberos y pass-the-hash.
targetedKerberoast es un script de Python que, al igual que muchos otros (por ejemplo, GetUserSPNs.py), puede imprimir hashes "kerberoast" para cuentas de usuario que tengan un SPN configurado.
Esta herramienta ofrece la siguiente característica adicional: para cada usuario sin SPNs, intenta establecer uno (abuso de un permiso de escritura en el atributo servicePrincipalName), imprime el hash "kerberoast" y elimina el SPN temporal configurado para esa operación. Esto se denomina Kerberoasting dirigido.
Esta herramienta se puede utilizar contra todos los usuarios de un dominio, o bien proporcionar una lista, o un único usuario desde la línea de comandos.
Más información sobre este ataque:
Esta herramienta admite las siguientes autenticaciones:
Entre otras cosas, targetedKerberoast admite verbosidad multinivel; solo hay que añadir -v, -vv, ... al comando :)
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)
A continuación se muestra un ejemplo de lo que la herramienta puede hacer.

Créditos a todo el equipo detrás de Impacket y sus colaboradores.