HackTheBox - Mango
Last updated
Was this helpful?
Last updated
Was this helpful?
We have two webservers, one running with HTTP and other with HTTPS (Secure). Let's add staging-order.mango.htb
to /etc/hosts file. There are two different websites running on staging-order.mango.htb. One on HTTP Protocol and other on HTTPS.
I tried for SQL Injection on Mango Search Page but didn't get anything. Let's scan the website with gobuster for files and directories.
The login page for insecure i.e HTTP website looks suspicious. Let's try SQL Injection on that.
I tried all possible SQL Injection payloads but that didn't gave me anything. Also tried sqlmap tool to automate the process but no luck :((
We can also try for NoSQL Injection as the name of the box is similar to Mongo
which is a NoSQL database (Uses Key-Value pair to store the values)
NoSQL injection vulnerabilities allow attackers to inject code into commands for databases that don't use SQL queries, such as MongoDB.
And now if you will check the response, it will be a redirect to home.php
page.
But that doesn't give us anything. We can also enumerate the data and users using the same method. I have created a script to get all the users and their passwords.
Similarly we can also enumerate the user and get password for that user as well.
If you wonder what jjs stands for, it stands for Java JavaScript. The command is located in the JDK_HOME\bin directory. The command can be used to run scripts in files or scripts entered on the command-line in interactive mode. It can also be used to execute shell scripts.
Now we can edit the /etc/passwd file and change the root password. - This is one way
Another way is to copy the bash file to tmp directory and then changing its permission to 4555
(Setuid permissions)