Bypassing Logins with SQLi
Now that you understand the concept, it is time to apply it.
A classic SQL injection bypass payload for a login form is:
Username: admin'-- Password: anything
Or alternatively:
Username: ' OR '1'='1 Password: ' OR '1'='1
The second payload makes the WHERE clause always true, returning all rows.
Your Mission
The target has a login form at:
Use SQL injection to bypass the login without knowing the real password.
Once you get in, find the flag on the page you are redirected to.
Step by Step
- Go to the login page
- Enter the payload in the username field: admin'--
- Enter anything in the password field
- Submit and see what happens