-1
我寫了這個功能我登錄的投入,使之安全:的登錄頁面自定義PHP函數來保護數據庫
function secureLogin($ary = array()){
try{
$securedArray = array();
foreach($ary as $val){
$val = str_replace("'","",$val);
//$val = str_replace("%","",$val);
$val = str_replace("drop ","",strtolower($val));
$val = str_replace("show ","",strtolower($val));
$val = str_replace("insert ","",strtolower($val));
$val = str_replace("create ","",strtolower($val));
$val = str_replace("update ","",strtolower($val));
$val = str_replace("select ","",strtolower($val));
$val = str_replace("or ","",strtolower($val));
$val = str_replace('"',"",$val);
$val = str_replace(";","",$val);
$securedArray[] = strip_tags($val);
}
}catch(Exception $exc){
return $exc->getMessage();
}
return $securedArray;
}
我也象SQLMAP,Havij和的Acunetix工具,顯示了一些工具進行了測試好的結果,但我想獲得一些專家的建議,使我的登錄頁面/輸入從登錄頁面儘可能安全應該是。
我認爲準備好聲明或pdo足夠 – JYoThI
亞,但我已經看到一些黑客仍然能夠繞過pdo安全與二級攻擊...... –