Web Web Web Application Mapping Cookie Manipulation Custom






網頁程式安全漏洞的來源 • Web應用程式的安全漏洞的 三大來源: Web管理 檢查副檔名 常用檔名檢查 Web平台 已知的安全漏洞 資料副檔名檢查 備份檢查 列舉目錄 網頁程式 Application Mapping Cookie Manipulation Custom Scripting 70% 的攻擊來自 Parameter Manipulation 網頁程式 - Garner Directory Transversal Brute Force Cookie Poisoning/ Theft Buffer Overflow 目錄截斷 SQL Injection 隱藏網站目錄 Cross-site scripting 允許目錄瀏覽





Ajax風格的地圖服務網頁 • Virtual Earth

傳統的網頁vs Ajax網頁 • Thin Client vs Rich Client • Clear Box vs Black Box






Ajax網頁提供更多的攻擊面 • 傳統網頁的攻擊面 – Form Input, Cookie, Header – 參數(例如Query String), File, Database, … • Ajax網頁暴露的攻擊面 – Web Service提供的方法 – Bridge (*. asbx) 資料來源 IDC and IBM Systems Sciences Institute

查詢Web Service提供的功能 • http: //IP/虛擬目錄/Test. asmx? wsdl – 可以透過設定關閉查詢功能 <web. Services> <protocols> <remove name="Http. Post"/> <remove name="Http. Get"/> <remove name="Documentation"/> </protocols> </web. Services> • http: //IP/虛擬目錄/Test. asmx? js 資料來源 IDC and IBM Systems Sciences Institute

示範: 查詢Web Service功能






盜取剪貼簿中的資料 • 在網頁中加入以下的Javascript就可以盜取剪 貼簿(Clipboard)中的資料 <script Language="Java. Script"> var content = clipboard. Data. get. Data("Text"); alert(content); </script>









Microsoft Anti-XXS Library的功能 • 最新版本 : ver 1. 5, 提供: – 更多的Encoding方法, 除了Html. Encode和 Url. Encode方法外, 另外還提供了 Html. Attribute. Encode, Java. Script. Encode, Visual. Basic. Script. Encode, Xml. Encode, 以及 Xml. Attribute. Encode等5個方法 – 支援Allow Partially Trusted Caller Attribute (APTCA) – 說明文件 – 範例



使用編碼方法注意事項 • 只能編碼一次 • 在輸出前才進行編碼 不正確的用法 String Input = Text. Box 1. Text; // 進行編碼 Input = Anti. Xss. Html. Encode(Input); // 處理使用者輸入的資料 // 輸出編碼後的內容 Response. Write( "The input you gave was"+Input); 正確的用法 String Input = Text. Box 1. Text; // 處理使用者輸入的資料 // 輸出編碼後的內容 Response. Write( "The input you gave was" + Anti. Xss. Html. Encode(Input)); );

對網頁輸出的內容加上編碼處理 • 加入參考 – 參考Anti. Xss. Library. dll • 引入Microsoft. Security. Application名稱空間 <%@ Import Namespace= "Microsoft. Security. Application" %> • 使用Html. Encode編碼方法 <%# Anti. Xss. Html. Encode(Eval("Message")) %>

示範: Microsoft Anti-XSS Library






參考資料 • How to prevent XSS in asp. net (http: //msdn 2. microsoft. com/enus/library/ms 998274. aspx) • Design Guidelines for Secure Web Applications (http: //msdn 2. microsoft. com/enus/library/aa 302420. aspx) • Safe. Html - Anti-Cross Site Scripting (XSS) HTML parser (http: //directory. fsf. org/all/Safe. HTML. html)

下載 • Microsoft Anti-Cross Site Scripting Library V 1. 5 (http: //www. microsoft. com/downloads/details. aspx? familyid=EFB 9 C 819 -53 FF-4 F 82 -BFAF-E 11625130 C 25&displaylang=en) • OWASP Top Ten Project – 十大駭客攻擊技巧解析 (http: //www. owasp. org/index. php/Category: OWASP_Top_Ten_Proje ct) • OWASP Web. Scarab Project – 網站安全功能測試 具 (http: //sourceforge. net/project/showfiles. php? group_id=64424&packa ge_id=61823) • Hacme. Bank – 有安全漏洞的虛擬銀行網站 (http: //owasp. net/forums/63/Show. Post. aspx) • JBro. Fuzz – 穿透測試 具 (http: //sourceforge. net/project/showfiles. php? group_id=180679&pack age_id=209088&release_id=461300)


範例下載 – 台灣微軟網站 • 台灣微軟網站 – http: //www. microsoft. com/taiwan/msdn/event sdownload/default. htm
- Slides: 49