SQL注入的原理你要先了解,因为以前SQL语句是用字符串拼接来组的.所以就有人想到如果我输入一个单引号来闭合原本程序里的单引号  然后在自己加些条件呢.

加入原本代码
String SQLStr = "select * from t_users where username='"+ txtusername.Text +"'";

如果你输入'or 1=1 -- 我们的SQLStr会变成什么呢

select * from t_users where username = '' or 1=1 --'
--后面属于sql的注释  所以都忽略了 即使后面有其他条件也忽略了

相关文章:

  • 2021-06-10
  • 2021-07-15
  • 2022-01-15
  • 2021-11-24
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2021-11-30
  • 2022-01-11
  • 2021-08-19
  • 2022-12-23
  • 2021-09-24
  • 2021-11-27
相关资源
相似解决方案