Monteverde HTB Walkthrough

Oct 14, 2024    #box   #htb   #medium   #windows   #ldap   #active-directory   #azure-ad-connect   #azure   #sql   #mssql   #download-cradle  

Monteverde Hack The Box Walkthrough/Writeup:

How I use variables & Wordlists:

1. Enumeration:

NMAP:

LDAP 389:

Using LDAP anonymous bind to enumerate further:

LDAP User Enumeration:

LDAP Group Enumeration:

DNS 53:

Kerberos 88:

Using Kerbrute to bruteforce Usernames:

SMB 445:

Attempting to connect with NULL & Guest sessions:

Trying Usernames as Passwords:

2. Foothold:

Enumerating the Domain SABatchJobs:

Running a bloodhound collection:

Enumerating SMB Shares:

Finding azure.xml in the user mhope’s user share:

Finding a hard-coded password in azure.xml:

Discovering that mhope re-uses passwords:

Connecting to the host as mhope:

3. Privilege Escalation:

Discovering mhope is part of the azure admins group:

Enumerating the Azure Service:

Checking Azure Connect Directory Exists & The Service Is Running:

Checking for the ADSync Database:

What is SQL Server Express LocalDB?

Looking for LocalDB binary:

Finding SQLCMD.EXE in 110:

Connecting to the SQL Instance:

4. Ownership:

Modifying XPN’s POC to work:

Running the Exploit to Extract the Administrator Password:

5. Persistence:

Dumping NTDS.dit:

Creating a Golden Ticket:

  1. Using impacket-lookupsid to extract the domain SID:

    • impacket-lookupsid $domain/administrator@$box -domain-sids
  2. I use impacket-ticketer to create the ticket:

    • It kicks out a bunch of errors but creates the administrator.ccache
  3. I load the ticket into the KRB5CCNAME Variable:

    • export KRB5CCNAME=./administrator.ccache
  4. I sync my clock with the target:

    • sudo ntpdate -s monteverde.$domain
  5. I connect using impacket-psexec:

    • impacket-psexec monteverde.$domain -k

Lessons Learned:

What did I learn?

  1. I learned ALOT about Azure AD Connect. I would not have been able to do this without the post from xpn:
  2. Honestly so much about the AD Connect service. I have done a more thorough writeup and have actually broken down xpn’s exploit in this post:

What silly mistakes did I make?

  1. Not too bad this time, it was more about just getting my head around Azure AD Connect and understanding XPN’s script took me the longest

Sign off:

Remember, folks as always: with great power comes great pwnage. Use this knowledge wisely, and always stay on the right side of the law!

Until next time, hack the planet!

ā€“ Bloodstiller

ā€“ Get in touch bloodstiller at proton dot me



Next: Outdated HTB Walkthrough