HackTheBox Passage
Table of Contents
Passage from HackTheBox is medium, fun but straightforward machine, it starts with two open ports SSH on 22 and HTTP on 80, we find CuteNews (which is a free, powerful and easy-to-use news management system based on flat files as a storage with quick installation, search function) it has an upload vulnerability that gives us a shell on the box and from there we hunt for some credentials for user paul who shares private ssh key with the user nadav, finaly we find vulnerable version of the program USBCreator installed that we use it for privilege escalation to root
Recon #
Nmap #
Nmap full TCP scan shows us two open ports 80 for HTTP and 22 for SSH.
Port 80 #
We check port 80 and we find what looks like blog posts titled Passage News.
Registering a user #
Checking website more took us to http://passage.htb/CuteNews which is a login/registration system for CuteNews.
Note: the version of CuteNews is revealed to be 2.1.2.
User shell #
Uploading a shell (manual) #
By clicking on personal options we are taken to our profile infos, looks normal but what if we try to upload php file instead of picture in avatar option? (uploads options usually vulnerable).
User shell (automated) #
That was the manual method but someone created a script to exploit CuteNews 2.1.2 automaticly on exploit-db.
Finding hashes #
After inspecting all php files we hit jackpot with b0.php.
Su as paul #
We su as paul and we get in.
Login as nadav #
Trying the private key to login as nadav.
Root shell #
Now let’s use linpeas.sh to try to find a way to escalate to root.