php環境設定

 

//程式串寫時建議將error_report全部開啟,已嚴謹方式進行撰寫

error_report(E_ALL);

 

//正式上線的production請務必設定此項,避免錯誤回報

ini_set("display_errors","0");

 

//啟用錯誤log紀錄

ini_set("log_errors","1");

 

//POST/GET/SESSION/COOKIE變數分開,PHP 5以後預設為關閉的

ini_set("register_globals","0");

 

SQL Injection

 

        GET資料時無檢查很危險,可加入任何的資料庫語法

http://xxxxx/MyWebApp/show.php?id=1

http://xxxxx/MyWebApp/show.php?id=’ or 1=1; //

http://xxxxx/MyWebApp/show.php?id=’; Delete From Table; //

 

 

Script Injection


GET資料時無檢查可加入任何的Script語法,如cookie被截取即可以以相同身分登入您的網頁中,且無需經過認證

http://xxxxx/MyWebApp/index.php?message=hello

http://xxxxx/MyWebApp/index.php?message=<script>alert(document.cookie)</script>

 

POST欄位中如無檢查,則可嵌入Sciprt運作跨腳本攻擊(XSS, Cross-Site Script)

<Script src=”http://xxxxx/test.js”></Script>

arrow
arrow
    全站熱搜

    miggo 發表在 痞客邦 留言(0) 人氣()