比如:在用户名输入框中输入:’or 1=1#,密码随便输入,这时候的合成后的SQL查询语句为:
      select * from users where username='' or 1=1#' and password=md5('')
  语义分析:“#”在mysql中是注释符,这样井号后面的内容将被mysql视为注释内容,这样就不会去执行了,换句话说,以下的两句sql语句等价:
      select * from users where username='' or 1=1#' and password=md5('')
  等价于
      select * from users where username='' or 1=1
  因为1=1永远都是成立的,即where子句总是为真,将该sql进一步简化之后,等价如下select语句:
      select * from users
  没错,该sql语句的作用是检索users表中的所有字段

相关文章:

  • 2021-04-07
  • 2021-10-14
  • 2021-12-02
  • 2021-12-02
  • 2021-05-22
  • 2021-12-17
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2022-01-04
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案