最贊回答 / Lydiar3308665
沒用預處理,語句參數相當于把表單提交的數據當參數傳遞之后拼接成完整語句再查詢,在執行的時候執行了別的語句。比如例子中的那個語句,本來是selete * from user where username=[參數1] and password=[參數2],但是拼接了用戶傳遞的參數之后,執行時候是:select * from user where username='' or 1=1 # and password =[參數2],#之后相當于注釋了,實際執行的就是select * from user where ...
2016-11-08
select * from user where username='' or 1=1 #' and password=''
其中#代表注釋到行尾,變為:
select * from user where username='' or 1=1
where語句恒真
其中#代表注釋到行尾,變為:
select * from user where username='' or 1=1
where語句恒真
2016-11-07