Mustacchio

Hello, i made a writeup for the THM - Mustacchio room. Enjoy!!

musttt

Starting with an Nmap scan;

mustanmap

so we visit the webpage on port 80

musta80

But we find nothing interesting so we bruteforce for directories;

mustffuf

Upon visiting /custom directory we find a js folder & inside we find an interesting Users.bak file

mustacustom

Downloading the file & upon inspecting, we find out it contains a user “Admin” & a password hash (cropped here)

mustapassha

we can crack this hash on crackstation.net to get the plaintext password

Now we can try to ssh with known creds now but it doesn’t work so Looking back at our Nmap scan we see there’s another web server hosted on port 8765

must8765

Now trying the creds here again and we get logged in

mustalogged

I tried sending a random text at first like “hello” and noticed a few things;

(1) It has a parameter called xml (2) a url in comment Example=/auth/dontforget.bak (2) Also in the html comment i see the user has an ssh key i’m suppose to get somehow

so i have to test for xxe here apparently

mustburp

on the webpage we see we can make a valid xml request with the name, author & comment parameter and so we have to provide that

so sending a GET request to the url from the html comment we find an example we can use going forward

And with this now we can read the /etc/passwd file and also grab the ssh keys from this machine

mustetcxxe

and now the ssh key

mustsshxxe

now we can save the file locally and try to ssh but we find out the key password protected

For this we can use the ssh2john tool to convert the key to hash & then crack hash with john

mustsshpas

After changing the perms for the key Now we can ssh into the Barry machine successfully using the key & password and we can find our user.txt right there;

mustuser

Time to root!

Moving around & enumerating we find 2 users on the machine a an interesting binary on the Joe user;

Looking for suid bits set & we find some interesting stuff;

mustsuid

Still enumerating, we find out we are able to execute the file so running strings on the file reveals to us that this binary runs the tail command without the absolute path. That makes me think of Path Variable attack.

muststrings

Exploiting to root!

createa file in /tmp that executes /bin/bash and give it permission to run export the PATH variable to point to the /tmp directory Now run the file

mustroot

External refrences;

https://tryhackme.com/room/mustacchio
https://crackstation.net/
https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
  • Displaying External Posts on Your al-folio Blog
  • Statica — Bypassing AI Assistant Secret Masking
  • Ashwick
  • Snobble AI