Love
https://app.hackthebox.com/machines/344
Nmap
After performing standard enumeration against the non HTTP ports we are unable to pull any interesting information.
Looking at the HTTP ports we have 80,443,5000 and 47001. Apart from port 80 we get Forbidden on 443 and 5000. Port 47001 gives us a not found error.
The root page for 80 takes us to a voters login page.
Directory enumeration with feroxbuster
shows a few pages of interest. Namely the /admin
directory which redirects to /admin/index.php
.
Again, we are unable to leverage anything too interesting for the moment. I tried logging in with the username "admin" and was sent back an error for incorrect password. Using a different username presents an incorrect username and password error.
A password brute force on the admin account does not yield any successful logins.
At this point we can perform sub domain enumeration with wfuzz
to see if we can pull anything of interest.
Here, we get a hit for the "staging" sub domain.
Add "10.10.10.239 staging.htb.love" to /etc/hosts.
Where the root page for http://staging.love.htb takes us to the Free File Scanner page below.
Checking the link at the drop for "Demo" we are taken to http://staging.love.htb/beta.php.
From here I tried various PHP reverse shells and was unable to get them to execute as expected. Instead, this scanner appears to read the file contents only.
Where this gets interesting, is that it is important to remember, the web server is operating in a different service or user context than us.
We can potentially use this to read the root pages of the otherwise forbidden pages we pulled from initial enumeration.
We can now read the root page for http://127.0.0.1:5000.
Here we now the credentials: admin:@LoveIsInTheAir!!!!
Which can be used to login at http://love.htb/admin/index.php
.
From here, we notice we can interact with the users profile in the picture and use the "update" button to upload a new profile picture.
Knowing the web server is running PHP we can attempt to upload a PHP reverse shell. Using a webshell from: https://github.com/WhiteWinterWolf/wwwolf-php-webshell
Upload the shell as a profile picture on the web server. After the uploaded completes click on the profile again and right click -> open image in a new tab to execute the web shell: http://love.htb/images/shell.php
After doing some basic enumeration from within the web shell we see AlwaysInstallElevated is set to 0x1 (Enabled).
How to perform privilege escalation with AlwaysInstallElevated:
Firstly on the attacking system generate a msfvenom
MSI reverse shell.
Then use the web shell to upload the Application.msi
Then set a nc
listener the attacking system.
Then, execute the Application.msi through the web shell.
We then land a SYSTEM shell.
Last updated