課程
/后端開發
/PHP
/PDO—數據庫抽象層
這是輸入的用戶名:' or 1=1 #',使用quote方法之后變為'\' or 1=1 #\'',前邊的\'和1=1相或為1,然后后邊的#為注釋,結果還是1啊,感覺和未處理的并沒有什么區別
2017-04-08
源自:PDO—數據庫抽象層 3-1
正在回答
完整的看就不一樣了。當鍵入為【liu】時:select * from user where uername = 'liu' and password ='liu123';
當鍵入為【' or 1=1 #】時:select * from user where username = '' or 1=1 # and password = ; 這時,or 1=1 使得查詢成立。
當quote后【\' or 1=1 #\'】:select * from user where username = '\' or 1=1 #\' and password = ; 這個時候,中間的條件語句【'\' or 1=1 #\'】,#號被包裹在兩個引號之中,成為了字符串,就沒有注釋的功能了。
舉報
本教程主要通過實戰演練深入剖析PDO以加深理解
1 回答php sql注入
1 回答防止sql注入
1 回答好像少了防sql注入
1 回答預處理語句防止SQL注入的原理是什么
1 回答$sql。。。。。
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-04-13
完整的看就不一樣了。
當鍵入為【liu】時:select * from user where uername = 'liu' and password ='liu123';
當鍵入為【' or 1=1 #】時:select * from user where username = '' or 1=1 # and password = ; 這時,or 1=1 使得查詢成立。
當quote后【\' or 1=1 #\'】:select * from user where username = '\' or 1=1 #\' and password = ; 這個時候,中間的條件語句【'\' or 1=1 #\'】,#號被包裹在兩個引號之中,成為了字符串,就沒有注釋的功能了。