🔒

Protected Content

This writeup is password protected

Incorrect password. Try again!
HTB - Conversor

HTB - Conversor

Step-by-step walkthrough of the HTB Conversor machine: exploiting XSLT file upload, cracking password hashes, and escalating privileges via needrestart CVE.


Details

IP: 10.10.11.92
Difficulty: Easy
Platform: Linux

First thing, as always, is to run a port scan to see what we’re dealing with here

Rustscan Rustscan2

We get an SSH port (which is typical), and an HTTP port on 80 that redirects to “convrsor.htb”.

So after adding that to /etc/hosts, and visiting the page, we are greeted with:

conversor.htb

And we can see that (most likely) it will be some type of file upload vulnerability.

For now, I did some research into what a “.xslt” file is because I had never heard of it.

Basically, it’s a template for organizing XML files.

Link: https://www.w3schools.com/xml/xsl_intro.asp

upload_page


So I made this malicious xslt file that will give me a reverse shell on the machine

(I forgot to mention it but the application uses flask meaning i can use python code on the system)

malicious_xslt

So we upload that and a blank xml file

reverse_shell

And boom, we get a reverse shell. From here, of course, we do some enumeration.

accounts

I checked what accounts are on the system and saw fismathack, so that’s my current target.

database_file

And after running ls -lR to go over all the files and subfolders in the directory, I find users.db. So I download the file and enumerate it offline.

account_hashes

And I find the users table with, wouldn’t you know it, a user named fismathack.

So I crack it with Hashcat offline.

We get a password!

cracked_hash

Using that password, I su into the account and get our first flag.

first_flag

Now from here we enumerate the account and see what we can do, and run sudo -l.

And find an application called needrestart.

sudo_permissions

After running the command with the --help flag to see what we can do with it, and some online research,

needrestart_usage

I looked up what kind of exploits are associated with this software and find a few, which all relate to privilege escalation.

needrestart_exploits

And I came across this GitHub repo for privilege escalation using a Python file and running the application as sudo.

CVE-2024-48990

So, after copying over the files, creating a listener on port 1337, and running needrestart as sudo,

we get root access!

root_shell

Then, of course, from here we just read the root flag.

And we’re done. That was very straightforward.

← HTB - Soulmate HTB - CodePartTwo →