alt text

Rustscan

Rustscan finds HTTP, SSH, and port 3000 open. I am not sure what is running on port 3000 so I should look into it later.

rustscan --addresses 10.10.11.25 --range 1-65535

alt text

Enumeration

HTTP - TCP 80

After adding greenhorn.htb to /etc/hosts, I can access the website:

alt text

http://greenhorn.htb/login.php shows a login page and a Pluck version:

alt text

Exploitation

CVE-2023-50564

Googling for known exploits for pluck 4.7.18, I found cve-2023-50564:

alt text

Let’s use this github POC to exploit this web server:

alt text

Reading the code, it seems like the default password is iloveyou1:

alt text

I tried testing it out on login.php and it worked:

alt text

Shell as www-data

Before running the exploit, let’s first install related module using:

pip install requests requests_toolbelt

Now clone the exploit git repository:

sudo git clone https://github.com/Rai2en/CVE-2023-50564_Pluck-v4.7.18_PoC.git

alt text

Modify ip and port from the shell.php:

alt text

Next, create shell.zip with shell.php in it:

alt text

Modify the hostname in poc.py:

alt text

Lastly, let’s run the exploit:

alt text

We get a reverse shell spawned as www-data on our netcat listener:

alt text

Privesc: www-data to junior

Let’s first make the shell more complete using Python:

python3 -c 'import pty; pty.spawn("/bin/bash")'

alt text

Trying out the password iloveyou1 for the user junior, it worked, and now we our privilege escalated:

alt text

Privesc: junior to root

On junior’s home directory, there is a file Using OpenVAS.pdf. Let’s transfer it to our Kali attacker machine:

alt text

Reading the pdf, it has a pixelated password on it:

alt text

Using toolds.pdf24, let’s first convert pdf to image and download the image file.

depix

Now that we have the pdf as image file, we will use depix to recover pixelated password.

Run depix and we get the recovered password:

python3 depix.py -p ~/Downloads/0.png -s images/searchimages/debruinseq_notepad_Windows10_closeAndSpaced.png -o ~/Documents/htb/greenhorn/output.png

alt text

Recovered password(sidefromsidetheothersidesidefromsidetheotherside) worked for root, and now we have a shell as root:

alt text

References