01step · watch first
How one quote mark can break the bank.
A short walkthrough of the classic login-bypass trick — what you type, what the database actually does with it, and why the whole problem comes down to one character a builder forgot to handle. Watch it through, then move on to the animated walkthrough.
▶
Lesson · SQL injection login bypass
~6 min
≡
Summary
what to remember
- 1A login form looks like two text boxes. But the website turns your typing into a question for its database — and one forgotten safeguard changes everything.
- 2The website pastes your text straight into that question — so your quote mark slips out of the text box, and the rest of what you type becomes part of the command, not just words.
- 3
OR 1=1means "or 1 equals 1" — always true, so it matches everyone;--tells the database to ignore the password check. Two characters delete the whole login. - 4The first account it hands back is the boss (admin). The first account ever created is usually the admin — so the website logs you in as them.
- 5Labelled slots stop this cold. Hand the database your text in a separate slot marked "just words" — it can never be mistaken for a command.
?
Quick check · before you continue
1 question · pick one
QA login form pastes whatever you type straight into its database question. What is the shortest thing you can type to skip the password check and get logged in?