§ 瀏覽學位論文書目資料
  
系統識別號 U0002-2106201017365100
DOI 10.6846/TKU.2010.00628
論文名稱(中文) 網頁應用程式原始碼弱點分析之研究─以淡江大學為例
論文名稱(英文) Source code vulnerability analysis study of web application – a case study of TamKang University
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊管理學系碩士班
系所名稱(英文) Department of Information Management
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 98
學期 2
出版年 99
研究生(中文) 蔡震天
研究生(英文) Chen-Tien Tsai
學號 697630035
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2010-05-29
論文頁數 59頁
口試委員 指導教授 - 黃明達
委員 - 林開榮
委員 - 魏士杰
關鍵字(中) 網頁應用程式安全
原始碼檢測
網頁弱點
關鍵字(英) Web Application Security
Source Code Analysis
Web Vulnerability
第三語言關鍵字
學科別分類
中文摘要
根據IBM Internet Security Systems 2009年 「X-Force年中安全趨勢與風險評估報告」中指出在 2009 年上半年間,X-Force 共分析並記錄 3,240 筆弱點,其中有50.4%是網頁應用程式弱點,然而從2006年至2009年,每年均有高達6,000多筆以上新弱點被揭露,但2009年上半年統計卻有49%已知弱點尚未進行修補。目前網頁應用程式主要有兩種弱點檢測手法:原始碼檢測(Source Code Analysis)與弱點掃描(Vulnerability Assessment),弱點掃描可從駭客角度實際對系統進行測試,但卻有高漏報率、低準確性與無法明確指出原因等特性,且模擬攻擊的行為可能直接影響資料庫造成運行不便。而原始碼檢測則是最基本的網頁應用程式稽核方式,也是可以找出最多網頁弱點的檢測類型,並可直接指出原始碼弱點處,易於改善。
本研究收集淡江大學部分學院與系所網站之網頁應用程式原始碼,透過原始碼檢測工具做弱點檢測,並搭配弱點掃描工具,進一步驗證原始碼修補後之改善結果。本研究成果包含:透過本研究之結果可發現目前校園內系所網頁應用程式之原始碼弱點分類比例為跨網站指令碼(15.04%)、跨網站的偽造要求(14.75%)、注入缺失(3.7%)、資訊揭露與不當錯誤訊息處理(3.67%)、不安全的加密與儲存器(2.82%)與其他不能分類至OWASP之弱點(60.04%)。針對淡江大學資訊中心所導入的原始碼檢測軟體,本研究已透過實際操作擬定了一個弱點檢測與修補流程,此流程整合校內資安服務隊之運作,透過此流程可作為未來進行校內其他網頁應用程式原始碼弱點檢測之參考。此外,針對較嚴重與部分較多弱點之類別本研究已整理出6類共13項的修補範例,透過此修補範例日後將可幫助各系所網站或其他相關之網頁應用程式維護人員能針對各弱點類別進行改善。
英文摘要
According to IBM Internet Security Systems 2009 "X-Force security trends in the risk assessment report" in the first half of 2009, the total record of 3,240 document analysis and weaknesses, among 50.4% were web application vulnerabilities; however, during 2006 to 2009, each year up to more than 6,000 new vulnerabilities were discovered. Solely in the first half of 2009, there are 49% of known vulnerabilities yet to be repaired .Currently, there are two web application techniques for vulnerability detection: Source Code Analysis and Vulnerability Assessment, while the Source Code Analysis is the basic model, which is able to identify most types of Web vulnerability detection and is able to direct the easy way to improve weaknesses Department.
This research contains the collected web application source code of some departments in Tamkang University.  By conducting source code analysis and vulnerability assessment could further resolve the aftermath of vulnerable exploitation.  The dedication of this study is discovering web application vulnerability proportion among campus. The distribution on web application vulnerability includes 15.04% of Cross-Site Scripting, 14.75% of Cross-Site Request Forgery, 3.7% of Injection Flaw, 3.67% of Leakage and Improper Error Handling, 2.82% of Insecure Cryptographic Storage and other vulnerability which can’t be classified into that of OWASP.  With a view to make the best of Source Code Analysis software installed by Tamkang University Centre, we perform a series of vulnerability detection and resolution process by working with information security think-tank on campus. Through the operation of this process, the results can be used as a reference for future web security improvement. In addition, for the most serious weaknesses of the categories, our research has come up with a total of 6 groups overall 13 solutions. Hopefully, in the future it will help to reduce the potential weaknesses.
第三語言摘要
論文目次
目錄
中文提要	I
英文提要	II
表目錄	IV
圖目錄	V
第壹章	緒論	1
第一節	研究背景及動機	1
第二節	研究目的	2
第三節	研究範圍與限制	2
第四節	論文架構	2
第貳章	文獻探討	4
第一節	網頁應用程式架構	4
第二節	網頁應用程式之威脅	6
第三節	弱點之定義	6
第四節	OWASP十大弱點	7
第五節	網頁應用程式安全性檢測	10
第參章	研究方法與過程	12
第一節	研究對象描述	12
第二節	資料來源	13
第三節	使用工具	13
第四節	研究過程與手法	15
第肆章	研究結果與分析	17
第一節	原始碼弱點行數分析	17
第二節	原始碼弱點類型分析	19
第三節	研究分析彙整	24
第四節	安全原始碼撰寫與分析	30
第伍章	 結論與建議	47
第一節	結論	47
第二節	建議與未來改善方向	48
參考文獻	49
附錄一	53
附錄二	54
附錄三	57

	
 
表目錄
表2-1    網站各種安全性威脅	6
表2-2    原始碼檢測手法之差異	11
表2-3    網頁應用程式安全性檢測方法比較	11
表3-1    研究對象校園學院分類	12
表3-2    各系所網站原始碼行數與頁面檔案數	13
表4-1    各單位原始碼檢測報告彙整-SCA檢測	18
表4-2    各單位網頁應用程式平均弱點密度-SCA檢測	18
表4-3    弱點風險分類統計-SCA檢測	20
表4-4    可歸類OWASP弱點分類比例-SCA檢測	20
表4-5    可歸類OWASP弱點之分類細項-SCA檢測	20
表4-6    A2弱點分類-SCA檢測	20
表4-7    SCA弱點分類排名整理	20
表4-8    SCA弱點於研究對象出現頻率排名整理	21
表4-9    校內檢測結果與各方報告之情況整理	23
表4-10  網頁應用程式實際修補後結果	24
表4-11  M2系原始碼資料	27
表4-12  M2系原始碼檢測結果(不含低風險弱點)	27
表4-13  M2系弱點掃瞄結果	28
表4-14  M2系第二次弱點檢測之結果	28
表4-15  M2系第三次弱點檢測之結果	29
表4-16  修補範例分類	30


圖目錄	
圖1-1    研究流程圖	3
圖2-1    網頁執行流程	5
圖2-2    網頁原始碼範例-以PHP為例	10
圖3-1    原始碼弱點檢測與修補流程	16
圖4-1    2004年至2009上半年網頁應用程式弱點	22
圖4-2    2009上半年網頁應用程式攻擊	22
圖4-3    2008 WASC網頁應用程式弱點統計	23
圖4-4    資安事件申請系統畫面	25
圖4-5    淡江大學資安服務隊原始碼修補處理流程	26
參考文獻
一.	中文文獻
[1]	ChinaZ,<跨站腳本攻擊深入解析:跨站危害及cookie盜竊>,網址:http://big5.chinaz.com:88/www.chinaz.com/Prime/Blog/110EH362009_3.html,上網日期:2010年2月22日。
[2]	ChinaZ,<PHP會話—session 時間設定使用入門>,網址:http://big5.chinaz.com:88/www.chinaz.com/z/0822/23.htm,上網日期:2010年2月21日。
[3]	Fortify,<Insecure Randomness>,網址:http://www.fortify.com/vulncat/zh_TW/vulncat/dotnet/insecure_randomness.html,上網日期:2010年2月22日。
[4]	IBM,<IBM Internet Security Systems 2009 年 X-Force年中安全趨勢與風險評估報告>,2009年8月。
[5]	ITHome,<政府資安規範與參考指引發展 Web AP、E-mail將為導入重點>,網址:http://www.informationsecurity.com.tw/article/article_detail.aspx?aid=4945,上網日期:2010年3月2日。
[6]	ITHome,<什麼是網頁應用程式原始碼檢測>,網址:http://ithelp.ithome.com.tw/question/10000009,上網日期:2010年2月22日。
[7]	台灣微軟,<『資料隱碼』SQL Injection的源由與防範之道>,網址:http://www.microsoft.com/taiwan/sql/SQL_Injection.htm,上網日期:2010年2月22日。
[8]	台灣微軟,<Web 應用程式安全基礎>,網址: http://www.microsoft.com/taiwan/msdn/secmod/html/secmod74.mspx,上網日期:2010年2月29日。
[9]	台灣微軟,<安全性弱點的定義>,網址:http://www.microsoft.com/taiwan/technet/archive/community/columns/security/essays/vulnrbl.aspx,上網日期:2010年2月22日。
[10]	台灣微軟,<設計 .NET 應用程式>,網址:http://www.microsoft.com/taiwan/msdn/library/2002/Jun-2002/article/DesignNetApp.htm,上網日期:2010年2月28日。
[11]	吳少琳,《利用搜尋引擎Google進行網站安全性檢測之研究》,碩士論文,中央警察大學資訊管理研究所,2007年。
[12]	德瑞工作室、楊立峰、陳彥平等,《黑客入侵網頁攻防修煉》,電子工業出版社,2008年6月。
[13]	柯志杰譯,GIJOE著,《網頁應用程式駭客攻防實戰-以 PHP 為例》,旗標書局,2007年3月。
[14]	行政院研究發展考核委員會,<Web 應用程式安全參考指引v.2>, 2009年3月。
[15]	賀宙才,《網站弱點分析與管理之研究─以警察機關為例》,碩士論文,中央警察大學資訊管理研究所, 2007年。
[16]	賴榮樞譯,William Stallings,《網路安全精要-應用與標準》,台灣培生教育出版股份有限公司,2005年。
[17]	陳奕明、黃世昆,《資訊與通訊系統之程式安全-資通安全專輯之十三(資通安全第2輯)》,國家實驗研究院科技,2000年。







二.	英文文獻
[18]	Armorize, Secure Web Application A Black and White Approach., http://armorize.com/pdfs/resources/blackandwhite.pdf, accessed 2010/3/3.
[19]	Gaurav, S. K., Angelos, D. K., and Vassilis, P., "Countering code-injection attacks with instruction-set randomization, " Proceedings of the 6th ACM Conference on Computer and Communications Security, Washington, USA, pp. 145-151, 2003.
[20]	Jeffrey, E. F. F., Mastering Regular Expressions, 3 rd, O'Reilly Media, 1997.
[21]	OWASP, Code_Review_Guide_V1.1.,  http://www.owasp.org.tw/index.php/Category:OWASP_Code_Review_Project#Code_Review_Guide_V1.1_Completed, accessed 2010/2/28.
[22]	OWASP, Commentary OWASP Top Ten Project., http://www.owasp.org/index.php?title=Commentary_OWASP_Top_Ten_Project/es&setlang=es, accessed 2010/2/23.
[23]	OWASP, Path Manipulation., http://www.owasp.org/index.php/Path_Manipulation, accessed 2010/2/21.
[24]	OWASP, Top 10 2007.,  http://www.owasp.org/index.php/Top_10_2007, accessed 2010/2/21.
[25]	OWASP, Use of hard-coded password., http://www.owasp.org/index.php/Use_of_hard-coded_password, accessed 2010/2/24.
[26]	Philipp, V., Cross Site Scripting (XSS) Attack Prevention with Dynamic Data Tainting on the Client Side, Master’s thesis, Technical University of Vienna, 2006.
[27]	PHP, Srand., http://php.net/manual/en/function.srand.php,accessed 2010/2/23.
[28]	Snyder, C., and Southwell, M., Pro PHP Security, 1 edition, Apr. 2006.
[29]	Wang, X., and Yu, H., "How to Break MD5 and Other Hash Functions, "  Lecture Notes in Computer Science, Vol. 3494, pp. 19-35, Aug. 2005.
[30]	Wang, X., Yin, Y., and Yu, H., "Finding collisions in the full SHA-1,"  Lecture Notes in Computer Science, Vol. 3621, pp. 17-36, Aug. 2005.
[31]	Web Application Security Consortium, Web Application Security Statistics Project 2008, http://projects.webappsec.org/f/wasc-ss-2008.pdf , accessed 2010/3/1.
[32]	Wikipedia, ISO 12207., http://en.wikipedia.org/wiki/ISO_12207, accessed 2010/2/24. 
[33]	Wikipedia, PDCA cycle., http://en.wikipedia.org/wiki/PDCA , accessed 2010/2/23.
論文全文使用權限
校內
校內紙本論文立即公開
同意電子論文全文授權校園內公開
校內電子論文立即公開
校外
同意授權
校外電子論文立即公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信