Skip navigation

DSpace JSPUI

DSpace preserves and enables easy and open access to all types of digital content including text, images, moving images, mpegs and data sets

Learn More
DSpace logo
English
中文
  • Browse
    • Communities
      & Collections
    • Publication Year
    • Author
    • Title
    • Subject
    • Advisor
  • Search TDR
  • Rights Q&A
    • My Page
    • Receive email
      updates
    • Edit Profile
  1. NTU Theses and Dissertations Repository
  2. 管理學院
  3. 資訊管理學系
Please use this identifier to cite or link to this item: http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/42377
Title: 一個PHP網頁應用程式的靜態分析工具
A Static Analyzer for PHP Web Applications
Authors: Chen-I Chung
鍾正一
Advisor: 蔡益坤
Keyword: 靜態分析,資&#63934,&#63946,分析,網頁應用程式,PHP 變動變&#63849,安全性弱點,
Static Analysis,Dataflow Analysis,Web Applications,PHP Variable Variables,Security Vulnerabilities,Verification,
Publication Year : 2008
Degree: 碩士
Abstract: 近幾年來,網頁應用程式的數量及其重要性有著迅速的成長,有越來越多的服務和商業活動都是透過網頁應用程式來完成。因此,網頁應用程式自然成為網路攻擊者的目標。雖然有許多作法像是防火牆和連線加密,都試著要解決這類型的問題,但是這些方法沒辦法解決網頁應用程式本身的弱點。根據OWASP的統計,目前有相當多種類型的網頁應用程式的弱點,而且數量還在持續增加中。程式分析可以用來解決這類型的弱點,不論是靜態分析或動態分析都能夠用來偵測和防範這些弱點。
在本篇論文中,我們將重點放在靜態分析,也就是在不執行程式的情況之下進行程式分析。我們相信在程式開發階段就將弱點排除是一個較為有效的作法。為了達成這個目的,我們整理了近幾年的網頁應用程式靜態分析演算法的並試著比較他們的優缺點。這些演算法都是以分析PHP網頁應用程式為目標,然而仍有一些議題還沒有被考慮到,如PHP變動變數的alias分析、字串索引陣列的分析。在進行靜態分析的時候若沒有考慮這些問題的話,有可能會產生誤報以及漏報。我們設計了一個演算法來解決這些問題。我們的工具會先將PHP原始程式轉換成中介表示 (intermediate representation)。我們選擇CIL作為中介語言,因為CIL能去除程式中語意不清的部分,幫助我們進行靜態分析。我們根據PHP的語言特性提出了一個將PHP原始碼精準轉換為CIL的作法。除此之外,我們設計了一些資料結構和輔助函數來確保語意的精準。這個轉換不只能將PHP以CIL的方式呈現,還能夠清楚的表現每一個PHP變數的型態。我們在CIL上實作了一個能夠處理PHP變動變數以及字串索引陣列的污染資料流分析。即使變動變數的索引是一個固定字串值,許多現階段的工具在處理仍會產生誤報或是漏報。我們分析了十個網頁應用程式,並且發現一些從變動變數以及字串索引陣列所產生的網頁應用程式弱點。
The number and importance of Web applications have grown rapidly in recent years, as more and more services and business activities are accomplished through these applications.
Consequently, Web applications have become the targets of security attacks. Although several mechanisms, such as firewalls and connection encryption, have been developed to solve the problem, they cannot eliminate Web application vulnerabilities because the vulnerabilities are inherent in Web application programs. According to statistics published by OWASP, there are many kinds of Web application vulnerabilities, and the number is growing continuously.
Program analysis techniques can be used to solve these problems. Both static and dynamic approaches have been proposed to detect or prevent vulnerabilities.
In this thesis, we focus on static analysis of programs, where the analysis is performed without actually executing the programs. We believe that eliminating vulnerabilities during the program development stage is a relatively cost-effective method.
To this end, we review several recently proposed static analysis algorithms for Web applications and summarize their pros and cons. The approaches focus on the analysis of
PHP Web applications; however, there are still some issues that have not been considered, e.g., alias analysis of PHP variable variables and arrays with string indices. Performing static analysis without considering these
issues may generate some false negatives or false positives.
We design an algorithm to solve these problems and implement it in our static analyzer, which first translates PHP programs into an intermediate representation.
We chose CIL as the intermediate language which helped us perform program analysis by clarifying ambiguous constructs and removing redundant constructors.
We review the language features of PHP and propose a precise semantic conversion to CIL. In addition, we devise some data structures and auxiliary functions to ensure that the semantics are as precise as possible. The conversion not only represents PHP in CIL, but also clarifies the type of PHP variable.
We also implement a taint dataflow analysis on CIL that can handle the alias relationships of PHP variable variables and arrays with string indices correctly. Many tools
yield a false positive or false negative result even if a variable variable stores a constant string value. Through our analysis of ten Web applications, we found that some vulnerabilities are caused by variable variables and arrays with string indices.
URI: http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/42377
Fulltext Rights: 有償授權
Appears in Collections:資訊管理學系

Files in This Item:
File SizeFormat 
ntu-97-1.pdf
  Restricted Access
748.39 kBAdobe PDF
Show full item record


Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.

社群連結
聯絡資訊
10617臺北市大安區羅斯福路四段1號
No.1 Sec.4, Roosevelt Rd., Taipei, Taiwan, R.O.C. 106
Tel: (02)33662353
Email: ntuetds@ntu.edu.tw
意見箱
相關連結
館藏目錄
國內圖書館整合查詢 MetaCat
臺大學術典藏 NTU Scholars
臺大圖書館數位典藏館
本站聲明
© NTU Library All Rights Reserved