Caused when raw, unfiltered data entered by a user is used in an SQL query.
Use an SQL Injection to hack this site's login form yourself...
Use of unfiltered user input in the login script creates a vulnerability that allows a hacker to login to the site without having an account!
Here's how it works:
hacker' OR 'a'='aSee if you can derive a different "SQL injection" string that also by-passes authentication.
Hint: press the "Sign In" button with an empty form to see the basic layout of the query -
what text can be added to the "username" value to create a query that returns valid results?
hacker' OR 1=1 OR 'a'='ahacker' OR ('a'='ahacker' OR 'a'='a') and id='6The attack above works because the password is verified in the SQL query itself - if we can trick the query into ignoring the password, we're in.
Like most programmers, the login form to the right performs an explicit password check - Try It!
the hack above won't work on this form.
But that still won't stop a determined hacker ...
Here's how it works:
See if you can create an "SQL injection" that by-passes authentication on the form to the right.
Hint: the user DB table has 4 columns: id, username, password, personalInfo
2nd Hint: the UNION command in SQL combines the results of two SELECT queries.
' UNION SELECT '2','hacker','abc','abcNotice that by changing the ID number in the injected SELECT, we can use this injection to login as any user on the system!
Note: this attack will not work on this page - try it on any other page (which all use the explicit password check authentication script).