热线电话:13121318867

登录
2019-02-23 阅读量: 870
mysql利用or运算级较低的逻辑进行注入攻击?

问题描述:

最极端简单的数据库查询逻辑下,例如where账号和密码和数据库中一致,即可查询出数据,这样的查询逻辑会有什么Bug?


思路拓展:

select * from user 
where username='aaa' and userpwd='xxx';

select * from user
where username='aaa' and userpwd='xxx' or 1='1';

  • 在这里的运算逻辑,就是or的运算层级比较低,会在前面(username='aaa' and userpwd='xxx')执行完,且报错的情况下,再去运行or 1='1',从而查取出user表中的所有数据
  • 那么如何防止这样的注入攻击呢?
0.0000
4
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子