Hey All,
I've been trying to work more on learning SQL syntax to better understand injection statements. I came across an example, and I'm not sure I understand it completely.
They are detailing a sample authentication bypass, initially they put a purposefully wrong statement of:
SELECT * FROM admins WHERE (user = '' OR '1'='1') AND (pass = '')
They said it was wrong, as it would only match user's with blank passwords and I can see that, the parentheses change the order of operation.
This is what they suggested as the correct statement:
SELECT * FROM admins WHERE user = '' OR 1=1 OR '1'='1' AND pass = ''
Why are the two true conditions in there.. not sure why that fixes it?
If anyone could explain that, I would really appreciate it - it's stuck in my head, so I've been trying to find an answer!
Thanks in advance for all the help!
-DV
