Cascade HTB Walkthrough

Oct 16, 2024    #box   #htb   #active-directory   #windows   #ldap   #rpc   #sql   #csharp  

Cascade Hack The Box Walkthrough/Writeup:

How I use variables & Wordlists:

1. Enumeration:

NMAP:

DNS 53:

Kerberos 88:

Using Kerbrute to bruteforce Usernames:

SMB 445:

Attempting to connect with NULL & Guest sessions:

RPC 111:

As RPC is running on the host we can attempt to enumerate using it.

49154/tcp open  msrpc         Microsoft Windows RPC
49155/tcp open  msrpc         Microsoft Windows RPC
49157/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49158/tcp open  msrpc         Microsoft Windows RPC
49165/tcp open  msrpc         Microsoft Windows RPC

Enumerating users with rpcclient:

Discovering User Login Scripts with rpcclient:

Enumerating Groups with rpcclient:

Why so many different rpcclient group enumeration commands?

Enumerating the password policy with rpcclient:

Understanding password_properties:

LDAP 389:

Using LDAP anonymous bind to enumerate further:

LDAP User & Group Enumeration Using Anonymous Bind:

2. Foothold:

Finding a password in the cascadeLegacyPwd field:

+It dawns on me, it’s base64 encoded!!!+

Enumerating the domain as r.thompson:

Pillaging the IT SMB Share:

Pillaging the NETLOGON share:

Finding that there is a TempAdmin account with the same password as normal admin:

Finding a TightVNC password in VNC Install.reg

Running a bloodhound collection:

Enumerating as s.smith:

Enumerating & pillaging the audit$ share:

3. Privilege Escalation:

Examining DB\Audit.db:

Finding a hardcoded decryption key in the CascAudit.exe binary using DNSpy:

Let’s break this code down:

Extracting the ArkSvc password from CascAudit.exe:

5. Ownership:

Enumerating as arksvc:

Finding the Administrator Password in the cascadeLegacyPwd field of a deleted object:

4. 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 sync my clock with the target:

    • sudo ntpdate -s casc-dc1.$domain
  4. I load the ticket into the KRB5CCNAME Variable:

    • export KRB5CCNAME=./administrator.ccache
  5. I connect using impacket-psexec:

    • impacket-psexec casc-dc1.$domain -k

Lessons Learned:

What did I learn?

  1. I actually had a lot fun using RPC to enumerate, purely as a test, to see how much I could get from the box before I had to switch to other means. It was fun.
  2. It was also nice to have a box where the approach wasn’t web based or something in an open share etc, it was fun to use LDAP (which I enjoy) extensively.
  3. I never knew about recovering items from the AD Recycling Bin.
  4. I learned more about C# decompiling etc, however I am going to do more work on this so I have a better understanding. This is one of my weaker points.

What silly mistakes did I make?

  1. Oh, one day I couldn’t sleep so woke up at 4:30am and wondered why it wouldn’t connect for ages until I realized I hadn’t updated /etc/hosts that was fun.
  2. Again, I spent alot of time on the C# decompiling etc as it’s one of my weaker areas.
  3. Oh not realizing the first found password was base64 encoded for a few mins was funā€¦.

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: Monteverde HTB Walkthrough