{"id":67,"date":"2025-03-12T05:55:11","date_gmt":"2025-03-12T05:55:11","guid":{"rendered":"http:\/\/racrx.io\/?p=67"},"modified":"2025-03-15T00:31:07","modified_gmt":"2025-03-15T00:31:07","slug":"as-rep-roasting-explained","status":"publish","type":"post","link":"https:\/\/racrx.io\/?p=67","title":{"rendered":"AS-REP Roasting Explained"},"content":{"rendered":"\n<p>AS-REP Roasting is a post-exploitation attack technique that targets user accounts in Active Directory (AD) that have the &#8220;Do not require Kerberos preauthentication&#8221; setting enabled. This allows an attacker to request and retrieve AS-REP (Authentication Server Response) messages, which contain an encrypted NTLM hash of the user\u2019s password, and crack them offline.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. The Kerberos Authentication Process<\/strong><\/h2>\n\n\n\n<p>In a standard Kerberos authentication flow, the client requests a Ticket Granting Ticket (TGT) from the Key Distribution Center (KDC). This process involves:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The client sends an Authentication Service Request (AS-REQ).<\/li>\n\n\n\n<li>The KDC responds with an Authentication Server Response (AS-REP), containing an encrypted TGT.<\/li>\n\n\n\n<li>The encryption key for the AS-REP is derived from the user\u2019s NTLM hash.<\/li>\n<\/ol>\n\n\n\n<p>Normally, Kerberos preauthentication is required, meaning the AS-REQ must be encrypted using the user\u2019s password-derived key to prove their identity before getting an AS-REP.<\/p>\n\n\n\n<p>However, when the &#8220;Do not require Kerberos preauthentication&#8221; setting is enabled on an account, anyone can request an AS-REP without needing prior knowledge of the user&#8217;s password.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Attack Execution: AS-REP Roasting<\/strong><\/h2>\n\n\n\n<p>To perform <strong>AS-REP roasting<\/strong>, an attacker follows these steps:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Enumerate User Accounts Without Preauthentication<\/strong><\/h3>\n\n\n\n<p>The attacker first identifies accounts that have preauthentication disabled. This can be done using PowerShell:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} -Properties DoesNotRequirePreAuth<br><\/code><\/pre>\n\n\n\n<p><strong>PowerView<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-DomainUser -PreauthNotRequired<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Request an AS-REP Ticket for a Target User<\/strong><\/h3>\n\n\n\n<p>The attacker requests an AS-REP for a vulnerable user using <strong>Impacket&#8217;s GetNPUsers.py<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>python3 GetNPUsers.py domain.local\/ -usersfile users.txt -format hashcat -output hashes.txt<br><\/code><\/pre>\n\n\n\n<p>Since preauthentication is disabled, the KDC directly responds with an AS-REP message containing an encrypted NTLM hash of the user&#8217;s password.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Extract and Save the AS-REP Hash<\/strong><\/h3>\n\n\n\n<p>The AS-REP response contains an encrypted NTLM hash, which follows the Kerberos 5 AS-REP etype 23 format. The extracted hash looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$krb5asrep$23$user@DOMAIN:HASH<br><\/code><\/pre>\n\n\n\n<p>This is then saved to a file (e.g., <code>hashes.txt<\/code>) for offline cracking.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Crack the Hash Offline<\/strong><\/h3>\n\n\n\n<p>The attacker attempts to recover the user&#8217;s password by brute-forcing the AS-REP hash using <strong>Hashcat<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>hashcat -m 18200 hashes.txt \/path\/to\/wordlist.txt --force<br><\/code><\/pre>\n\n\n\n<p>If the user\u2019s password is weak, Hashcat will recover it.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Impact of AS-REP Roasting<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If a privileged account (e.g., Service Account, Domain Admin) is targeted, an attacker could escalate privileges.<\/li>\n\n\n\n<li>Enables lateral movement across the domain.<\/li>\n\n\n\n<li>Can be performed by any domain user, requiring no special privileges.<\/li>\n\n\n\n<li>AS-REP hashes are crackable offline, so detection is difficult.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. Mitigation Strategies<\/strong><\/h2>\n\n\n\n<p>To prevent AS-REP roasting, organizations should:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Enforce Kerberos Preauthentication<\/strong> on all accounts.\n<ul class=\"wp-block-list\">\n<li>Ensure that the \u201cDo not require Kerberos preauthentication\u201d option is unchecked for all user accounts.<\/li>\n\n\n\n<li>Run this PowerShell command to disable the setting: <code>Set-ADUser -Identity &lt;User&gt; -DoesNotRequirePreAuth $false<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Use Strong Passwords<\/strong>\n<ul class=\"wp-block-list\">\n<li>Enforce long, complex passwords to make brute-force cracking infeasible.<\/li>\n\n\n\n<li>Implement password policies using tools like LAPS or gMSAs.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Monitor for Unusual AS-REP Requests<\/strong>\n<ul class=\"wp-block-list\">\n<li>Look for Event ID 4768 in domain controller logs, which tracks AS-REP requests.<\/li>\n\n\n\n<li>Use SIEM solutions (Splunk, ELK, Microsoft Sentinel) to detect multiple AS-REP requests from a single source.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Disable Unused Accounts<\/strong>\n<ul class=\"wp-block-list\">\n<li>Remove or disable stale accounts that may have preauthentication disabled.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>AS-REP Roasting is an effective attack that allows attackers to obtain encrypted NTLM hashes without triggering authentication failures. Since the attack is offline, it is difficult to detect in real time. Organizations should enforce Kerberos preauthentication, strong password policies, and continuous monitoring to mitigate this risk.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AS-REP Roasting is a post-exploitation attack technique that targets user accounts in Active Directory (AD) that have the &#8220;Do not require Kerberos preauthentication&#8221; setting enabled.&hellip; <a href=\"https:\/\/racrx.io\/?p=67\" class=\"apace-readmore-link\"><span class=\"screen-reader-text\">AS-REP Roasting Explained<\/span>Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-pentesting","category-red-team"],"_links":{"self":[{"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/racrx.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":4,"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/racrx.io\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/racrx.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/racrx.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/racrx.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}