Mango

Mango

Mango Is a medium difficulty Linux box that dives into the usage of NoSQL

Recon

we start off by scanning Mango's IP 10.10.10.162 with nmap

From our results we get the following

We see that port 80, 443 & 22 are open in adittion to this we see a ssl-cert being issued with the name staging-order.mango.htb We can now add

Navigating to mango.htb we find a search engine but not anything useful, moving onto staging-order.mango.htb however we find a login page

Let's fire up burp and intercept all the requests

We have tailtale hint of what the DB might be in the name MongoDB which itself is a NoSQL DB, lets see what we can gooogle up on it.

We can use a simple login in

We get back a status code 302 and with any other credentials 200 with this we can guess that a brute force attack

We can also use the regex to find the correct letters that are present in the username and pass, so lets write up a script for it.

Right we have a base to start of with

We now know there are 2 users with the usernames starting with either a or m

Now finally to get the passwords

And finally

We can now ssh into the server with the passwords we gathered

Exploit

We see that there is another user besides mango

Luckily we've already cracked admin so lets su into him

And Voila! we are admin and with that we have user

Post Exploitation

Running Linpeas https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS we find that we have jjs running. Checking GTFOBins https://gtfobins.github.io/gtfobins/jjs/ we see that we can actually use it to priv esc

For this we'll be getting bin/bash and setting its SUID

And we have root!

Last updated