完整的看就不一樣了。 當(dāng)鍵入為【liu】時:select * from user where uername = 'liu' and password ='liu123';
當(dāng)鍵入為【' or 1=1 #】時:select * from user where username = '' or 1=1 # and password = ; 這時,or 1=1 使得查詢成立。
當(dāng)quote后【\' or 1=1 #\'】:select * from user where username = '\' or 1=1 #\' and password = ; 這個時候,中間的條件語句【'\' or 1=1 #\'】,#號被包裹在兩個引號之中,成為了字符串,就沒有注釋的功能了。
2017-04-13
完整的看就不一樣了。
當(dāng)鍵入為【liu】時:select * from user where uername = 'liu' and password ='liu123';
當(dāng)鍵入為【' or 1=1 #】時:select * from user where username = '' or 1=1 # and password = ; 這時,or 1=1 使得查詢成立。
當(dāng)quote后【\' or 1=1 #\'】:select * from user where username = '\' or 1=1 #\' and password = ; 這個時候,中間的條件語句【'\' or 1=1 #\'】,#號被包裹在兩個引號之中,成為了字符串,就沒有注釋的功能了。