CTF
50 - No Sequels - Web
The prequels sucked, and the sequels aren't much better, but at least we always have the original trilogy.
Author: SirIan
The server side source code is given to us, it seems to be Nodejs.
We can notice that the server is expecting data to be formated in JSON and that a JWT token will be set.
Let's try a legitimate request:
Of course the server answered us we provided wrong credentials.
Looking at the HTML source we can see this comment:
MongoDB is a NoSQL database, so let's try a NoSQL injection:
Seems to work be we are redirected on a bad page.
If we code the JWT token, we have:
So with the payload {"$ne": "noraj"}
we revealed the existence of the the user admin
.
Now we can try a blind NoSQL injection with the use of the regex operator and brute-force to obtain the admin password.
Let's execute our script:
The flag: actf{no_sql_doesn't_mean_no_vuln}
.