Hackthebox Mantis Writeup
11 Aug 2019
Explanation
To practice pentesting for Active Directory environment, solved an old machine “Mantis” on Hackthebox.
Solution
1. Initial Enumeration
TCP Port Scanning:
SMB enumeration:
Gobuster HTTP:
2. Getting Root
By enumeration, We found an interesiting page on port 1337.
We can decode this unknown base64 encoded string with following way.
Besides, if we scroll down the text file, there are some hidden(?) lines.
We can decode this binary with following way.
Meaning currently we have 2 credentials.
Then, try to login to the SQL server.
We have “mssqlclient.py” in the package Impacket installed by default.
Then, list all databases.
Next, try to find a user table for orcharddb.
Then, get user credential from the table ‘blog_Orchard_Users_UserPartRecord’
To confirm if we can use this credential, we can run smbclient.
After that, we can use “goldenPac.py” for MS14-068, which is installed by default on the Kali Linux.
At first, add following lines in “/etc/hosts”
Then, execute the script with following way to forge a “Golden ticket” and execute psexec.
We can achieve an system shell.
root.txt is in the home directory of Administrator.