Sauna – HackTheBox Walkthrough

Introduction:

The purpose of this blog is to document the steps I took to complete hacking task of HackTheBox (https://www.hackthebox.eu/) machine that included capturing user and root flag of Sauna (https://www.hackthebox.eu/home/machines/profile/229).

Resources/Tools Used:

Process Followed:

After connecting to HTB lab through VPN, started Sauna (10.10.10.175) box. To check the available services, I scanned the box with nmap scanning all ports and doing a quick scan as follows:

nmap quick scan

Quick scan showed quite a few open ports including DNS(53), Kerberos (88), RPC (135), LDAP(389), and SMB (445). To detect services running on these ports and OS scanned using -A option as follows:

nmap aggressive scan
nmap ldap scan

As ldap (active directory) was running on target, scanned the box with nmap ldap scripts that confirmed domain name as “EGOTISTICAL-BANK.LOCAL”.

nmap ldap scan
nmap ldap scan
nmap ldap scan

Tried anonymously connecting and listing SMB shares but listing was denied. Since port 80 was open, checked if there is website up and running. Browsed to website to check if we can find any useful information there. Upon reviewing “about.html” found the names of team members.

Team members

From this information prepared a “team.txt” file to check using the naming convention first alphabet of first name and last name. Following list was compiled from website team information.

User list

Used this information to perform kerbroasting and get TGTs for those users that have the property ‘Do not require Kerberos preauthentication’ set (UF_DONT_REQUIRE_PREAUTH). If this property is enabled, TGTs for affected user can be exported and cracked. The key used of encrypting/signing essentially is user’s domain password.

fsmith TGT

We got TGT for user fsmith and now we can crack it to get user password. Used john (with “rockyou.txt” wordlist) to crack the password for user fsmith.

fsmith password cracking

Connected to SMB shares again using the newly discovered credentials but no interesting information was available.

SMB Shares listing using user fsmith

Used Evil-WinRM to login target machine with user “fsmith”.

fsmith login using Evil-WinRM

Browsed to Desktop folder to capture the user flag.

User flag

Checked privileges of user fsmith to see if it is member of any special privilege group.

fsmith privileges

Checked the available users on the system.

Available users

Uploaded winPEAS to check what options are available for privilege escalation from user “fsmith” to Administrator.

winPEAS upload

Executed winPEAS to see if we can find any interesting vector to use for privilege escalation to administrator.

winPEAS execution

After reviewing the output of winPEAS found credentials for the user “svc_loanmgr”. No other useful information was available in the output.

svc_loanmanager password using winPEAS

Used Evil-WinRM to login again with user “svc_loanmgr” and the newly discovered password.

svc_loanmgr login using Evil-WinRM

Uploaded mimikatz to the target machine to see if we can gather Administrator credentials. Mimikatz can be used to perform DCSync attack. DCSync command in mimikatz simulates a domain controller and asks for replication of domain information from active directory. This information includes password hashes from active directory as well.

Upload mimikatz

Used mimikatz to dump administrator password hash using “lsadump::dcsync” command.

Administrator hash using mimikatz

After getting Administrator password hash logged in using Evil-WinRM.

Administrator login using Evil-WinRM

Then browsed to Desktop folder under Administrator user and there was “root.txt” file stored in this directory. Read the contents of file root.txt to capture the root flag. Submitted the flags (user and root) on HTB website to own machine.

I hope this helped. Thanks for your time and attention.

Leave a comment

Design a site like this with WordPress.com
Get started