2019-02-23
閱讀量:
947
mysql利用or運(yùn)算級(jí)較低的邏輯進(jìn)行注入攻擊?
問題描述:
最極端簡單的數(shù)據(jù)庫查詢邏輯下,例如where賬號(hào)和密碼和數(shù)據(jù)庫中一致,即可查詢出數(shù)據(jù),這樣的查詢邏輯會(huì)有什么Bug?
思路拓展:
select * from user
where username='aaa' and userpwd='xxx';
select * from user
where username='aaa' and userpwd='xxx' or 1='1';
- 在這里的運(yùn)算邏輯,就是or的運(yùn)算層級(jí)比較低,會(huì)在前面(username='aaa' and userpwd='xxx')執(zhí)行完,且報(bào)錯(cuò)的情況下,再去運(yùn)行or 1='1',從而查取出user表中的所有數(shù)據(jù)
- 那么如何防止這樣的注入攻擊呢?






評(píng)論(0)


暫無數(shù)據(jù)
CDA考試動(dòng)態(tài)
CDA報(bào)考指南
推薦帖子
0條評(píng)論
1條評(píng)論
0條評(píng)論
0條評(píng)論