CozyHosting

Recon

nmap_scan.log

HTTP (80)

Standard landing page, with login

Writeup.png

From the error the backend should be Spring Boot Framework, Java

Writeup-1.png

Spring Actuator is debugging tool implemented in Spring Boot, which shouldn't be used in prod.https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/spring-actuatorsarrow-up-right

http://cozyhosting.htb/actuator/envarrow-up-right - validate that endpoint exists. Not useful information, but endpoint existing means exploit vector exists too.

sessions is unusual endpoint

Looks like we can login with the cookies. We already have JSESSIONID cookie (second one is us), modify it with kanderson cookie and go to /admin

Writeup-2.png

Command injection is successful inside the Username, username can't contain whitespaces and hostname should be valid?

Writeup-3.png

There's a weird command injection tho, curl IP|bash didn't work, but sh worked without reverse shell...

Writeup-4.png

LFI is possible (partially)

Writeup-5.png

We can also leak the command with more semicolons.

Revshell was possible with this type of chain:

Download the server jar file

Use jd-gui to decompile the jar file.

Writeup-6.png

Crack the password for admin

SSH (22)

Josh is the only user on box, so he's probably admin. SSH is successful.

Creds: josh:manchesterunited

User.txt

Privilege Escalation

https://gtfobins.github.io/gtfobins/ssh/arrow-up-right

Root.txt

Last updated