{"id":166,"date":"2023-03-09T22:01:45","date_gmt":"2023-03-09T22:01:45","guid":{"rendered":"https:\/\/merrillnewman.tech\/?p=166"},"modified":"2023-03-09T22:09:42","modified_gmt":"2023-03-09T22:09:42","slug":"as-rep-roasting","status":"publish","type":"post","link":"https:\/\/merrillnewman.tech\/?p=166","title":{"rendered":"AS-REP Roasting"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Overview<\/h3>\n\n\n\n<p>AS-REP roasting is a technique that enables us to steal the password hashes of accounts without Kerberos pre-authentication enabled. In this article I will show how to perform an AS-REP roast attack.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">Why AS-REP Roasting is Possible<\/h3>\n\n\n\n<p>Without getting into the weeds of the Kerberos authentication protocol the easiest way to think about it is this. When Kerberos pre-authentication is disabled for a user we are able to request authentication data for that user, since part of this data is encrypted using the users password we are able to brute force it offline.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AS-REP Roasting With Impacket<\/h3>\n\n\n\n<p>We can use <code>impacket-GetNPUsers<\/code>, which is installed by default on kali, to perform the attack. The basic syntax is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>impacket-GetNPUsers -dc-ip &lt;IP&gt; '&lt;DOMAIN&gt;\/' -request<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"966\" height=\"272\" src=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-2.png\" alt=\"\" class=\"wp-image-167\" srcset=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-2.png 966w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-2-300x84.png 300w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-2-768x216.png 768w\" sizes=\"auto, (max-width: 966px) 100vw, 966px\" \/><figcaption class=\"wp-element-caption\">AS-REP roasting with Forest from HTB<\/figcaption><\/figure>\n\n\n\n<p>It&#8217;s worth noting that the DC will not always return all users for us like this, we may have to give it a list of users. In this case we would use a syntax like so.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>impacket-GetNPUsers -dc-ip &lt;IP&gt; '&lt;DOMAIN&gt;\/' -usersfile users.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"278\" src=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io-1024x278.png\" alt=\"\" class=\"wp-image-168\" srcset=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io-1024x278.png 1024w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io-300x81.png 300w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io-768x208.png 768w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io-1536x416.png 1536w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/njknjknjk_censored_via_10015_io-1_censored_via_10015_io-1_censored_via_10015_io_censored_via_10015_io.png 1896w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">AS-REP roasting with user file<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Cracking The Hash With Hashcat<\/h3>\n\n\n\n<p>Once we have obtained the hash we can crack it offline with hashcat. The syntax for the command would look like so.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hashcat -m 18200 hashes.krb \/usr\/share\/wordlists\/rockyou.txt --force\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"43\" src=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3-1024x43.png\" alt=\"\" class=\"wp-image-169\" srcset=\"https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3-1024x43.png 1024w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3-300x12.png 300w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3-768x32.png 768w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3-1536x64.png 1536w, https:\/\/merrillnewman.tech\/wp-content\/uploads\/2023\/03\/image-3.png 1903w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Cracking the password with hashcat<\/figcaption><\/figure>\n\n\n\n<p>In this case the hash was able to be cracked easily with hashcat and rockyou, however it might not always be this easy to crack the hash.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remediation<\/h3>\n\n\n\n<p>The best way to protect yourself against this attack it to only disable Kerberos pre-authentication when it is absolutely necessary, other than this having a long and complex password that someone could not easily crack is also a way to remediate this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview AS-REP roasting is a technique that enables us to steal the password hashes of accounts without Kerberos pre-authentication enabled. In this article I will show how to perform an AS-REP roast attack.<\/p>\n","protected":false},"author":1,"featured_media":170,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"hide_page_title":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_mi_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-166","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/posts\/166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166"}],"version-history":[{"count":4,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":175,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions\/175"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=\/wp\/v2\/media\/170"}],"wp:attachment":[{"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merrillnewman.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}