User Flag

I started by doing some nmaps scans:

Pasted image 20250410050229.png

Pasted image 20250410050237.png Pasted image 20250410050245.png I did some dir and dns enumeration on port 80, but couldn’t find anything, so let’s check the website:

Pasted image 20250410050411.png

On the website, I found nothing of interest except a download link for an apk file, so let’s download it and extract the code. To do this I used a visual code extension:

Pasted image 20250410050446.png

Pasted image 20250410050454.png Looking for config files in the extracted code I found: Pasted image 20250410050511.png Pasted image 20250410050516.pngThis means that there are two other vhosts for the application so let’s add them to the /etc/hosts file.

Looking in the code we can also find a jwt for an admin account:

Pasted image 20250410050549.png

Let’s see if we can use in the the vhost api we discovered.

Pasted image 20250410050616.png

Now we can do a bunch of api calls as the admin account. We can get some useful information:

Pasted image 20250410050630.png

This tells us that there is a user shirohigen in the machine. The api can also read logs from a file using the following request:

curl -X GET “[http://swagger-ui.instant.htb/api/v1/admin/read/log?log_file_name=](http://swagger-ui.instant.htb/api/v1/admin/read/log?log_file_name=)

This request might be vulnerable to LFI: Pasted image 20250410050720.pngSeems we are on to something. Let’s try to read the ssh key for the user we discovered: Pasted image 20250410050742.png Copy the ssh key and use it: Pasted image 20250410050800.pngAnd we get the user flag: Pasted image 20250410050912.png

Root Flag

Doing some basic linux enumeration we find something interesting:

Pasted image 20250410050947.png

Searching for solar putty exploits we immediately find :

https://github.com/VoidSec/SolarPuttyDecrypt

This contains a detailed script of a possible vulnerability. To exploit it we need a solar putty session backup, which we have, and a password. We don’t have the password, but we can try to bruteforce it:

Pasted image 20250410051115.png

This very crude python script, runs the exploit we the session that we found and iterates through the rockyou wordlist until it finds the correct password.

After running the script we find the password and a txt file in our Desktop with the result of the exploit:

Pasted image 20250410051158.png This file contains the password for the root user, so now we just have to try to login: Pasted image 20250410051214.pngAnd we find the root flag! Pasted image 20250410051222.png