The login functionality for this lab is powered by a MongoDB NoSQL database. It is vulnerable to using MongoDB operators.
To solve the lab, log into the application as the administrator
user.
You can log in to your own account using the following credentials: wiener:peter
.
Upon accessing the lab, I immediately directed my attention to the login functionality, with the FoxyProxy extension activated to inspect requests in Burp Suite.
I sent the POST /login
request to repeater to begin experimenting with payloads. Starting with the provided credentials wiener:peter
, I attempted to identify any vulnerabilities in the authentication mechanism. First, I tried setting the username to wiener and used the $ne
parameter to bypass the password check:
This payload successfully granted access. Next, I attempted to change the username to administrator:
However, this attempt failed, indicating that administrator was not the correct username. To leverage regex to match the administrator's username, I first tested the approach with the wiener user:
This successfully logged me in, confirming that the regex wien.* matched wiener. Encouraged by this success, I applied the regex to the administrator user:
And just like that, I gained access, confirming that the administrator username begins with the string admin
. With that, I successfully solved the lab.