RIPS - A static source code analyser for vulnerabilities in PHP scripts
|
|
|
- Annabelle McBride
- 10 years ago
- Views:
Transcription
1
2 RIPS - A static source code analyser for vulnerabilities in PHP scripts Johannes Dahse Seminar Work at Chair for Network and Data Security Prof. Dr. Jörg Schwenk advised through Dominik Birk Horst Görtz Institute Ruhr-University Bochum 2
3 3
4 Contents 1 Introduction 1 2 Motivation 2 3 Web application security Cross-Site Scripting SQL Injection Other vulnerabilities Static source code analysis Configuration Model construction Analysis Taint analysis Intraprocedural and interprocedural analysis Results processing RIPS implementation Configuration Model construction Lexical and semantic analysis Parsing Control flow analysis Analysis Taint analysis Intraprocedural and interprocedural analysis Web interface Scan results Limitations and future work Related work 22 7 Summary 24 i
5 1 Introduction The amount of websites has increased rapidly during the last years. While websites consisted mostly of static HTML files in the last decade, more and more web applications with dynamic content appeared as a result of easy to learn scripting languages such as PHP and the growing availability and speed of the internet. Almost all web servers support some sort of scripting environment today to deploy dynamic web applications. Besides a huge amount of new possibilities, the new web 2.0 also brings a lot of new security risks when data supplied by a user is not handled carefully enough by the application. Different types of vulnerabilities can lead to data leakage, modification or even server compromise. Oftenly one single unfiltered character can have a huge security impact. Because of limited programming skills, lacking security awareness and time constraints vulnerabilities can occur very often and put the whole web server at risk due to the easy accessibility on the internet. In order to contain the risks of vulnerable webapplications source code has to be reviewed by the developer or by penetration testers. Given the fact that large applications can have thousands of codelines and time is limited by costs, a manual source code review might be incomplete. Tools can help penetration testers to minimize time and costs by automating time intense processes while reviewing a source code. In this seminar work the concept of web application vulnerabilities is introduced and how they can be detected by static source code analysis automatically. Also a new tool named RIPS is introduced which automates the process of identifying potential security flaws in PHP source code. RIPS is open source and freely available at net/projects/rips-scanner/. The result of the analysis can easily be reviewed by the penetration tester in its context without reviewing the whole source code again. This seminar work will describe how RIPS is implemented and which kind of problems are faced when building a static source code analysis tool for PHP. 1
6 2 Motivation The scripting language PHP is the most popular scripting language on the world wide web today. It is very easy to learn and even a programmer with very limited programming skills can build complex web applications in short time. But very often security is only a minor matter or not implemented at all, putting the whole web server at risk. In the last year, 30% of all vulnerabilities found in computer software were PHP-related [1]. The wide distribution of PHP and the many PHP-related vulnerabilities occuring lead to a high interest of finding security vulnerabilities in PHP source code quickly. This interest is shared by source code reviewers with good and bad intents. My personal intent was to find security vulnerabilities quickly during Capture The Flag (CTF) contests. During a CTF contest each participating team sets up a web server with vulnerable web applications and connects to a virtual private network. The source code is then analysed by the teams and security vulnerabilities have to be found, patched and exploited. By exploiting security vulnerabilities it is possible to capture flags from opposing teams webservers that are awarded with points. The team with the most captured flags wins. About 22% of all distributed web applications by CTF organizers have been written in PHP so far thus making PHP the most popular scripting language in CTFs as well. Building a tool that automates the process of finding security vulnerabilities can help to better secure your own source code, find potentially vulnerabilities in your own or open source PHP applications and to win CTF contests. In all cases it is helpful to find vulnerabilities accurately and in a short amount of time. Unfortunately there exist only one open source tool called Pixy written in Java to analyse PHP source code files for SQL Injection and Cross-Site Scripting vulnerabilities. While these are the most common vulnerabilties there exist a lot more vulnerabilities a source code analysis tool should detect. Pixy has not received any updates since 2007 and is effectively abandoned. My motivation was to build a new tool that detects all known types of vulnerabilities in PHP scripts. Because it is nearly impossible to identify all vulnerabilities correctly 100% the goal was to give the user a powerful interface to review the vulnerable parts as easy as possible. Pixy and RIPS is compared in detail in chapter 6. 2
7 3 Web application security A web application is a computer application that is deployed on a web server and accessable through a web-based user interface by the client. The HTTP server (e.g. Apache or Microsoft IIS) accepts HTTP requests send by the client (normally by a web browser such as Mozilla Firefox or Microsoft Internet Explorer) and hands back a HTTP response with the result of the request. Figure 3.1: Typical web server setup [15] When a HTTP request is send by the client it is parsed by the HTTP server (step 1 in figure 3.1). The HTTP server extracts the file name that is being requested and the parameters send (for example GET or POST parameters). When it detects a request for a dynamic file (in example a PHP script) it fetches the source code from the file system (step 2 in figure 3.1) and passes it along with the parameters to the scripting language interpreter (step 3 in figure 3.1). The interpreter executes the source code and handles external resources like databases (step 4 and 5 in figure 3.1) or files. It then creates the result (normally a HTML file) and sends it back to the client where the result is displayed in the web browser. A web application security vulnerability can occur when data supplied by the user (e.g. GET 3
8 or POST parameters) is not sanitized correctly and used in critical operations of the dynamic script. Then an attacker might be able to inject code that changes the behavior and result of the operation during the script execution in an unexpected way. These kind of vulnerabilities are called taint-style vulnerabilities because untrusted sources such as user supplied data is handled as tainted data that reaches vulnerable parts of the program called sensitive sinks. Any kind of data that can be modified by the user such as GET or POST parameters as well as cookie values, the user agent or even database entries or files have to be assumed as tainted. For each different vulnerability type exists different sensitive sinks and sanitization routines. Sensitive sinks are potentially vulnerable functions (PVF) that execute critical operations and should only be called with trusted or sanitized data. Otherwise an attacker may influence the data that is passed to the PVF and read, modify and delete data or attack the underlying web server or a client, depending on the PVF. Figure 3.2 shows the concept of taint-style vulnerabilities in PHP. Figure 3.2: Concept of taint-style vulnerabilities in PHP To give an example for a vulnerability that affects the client and a vulnerability that affects the server the two very common vulnerabiltities Cross-Site Scripting and SQL Injection are introduced. 3.1 Cross-Site Scripting Cross-Site Scripting (XSS) attacks the client of the web application and occurs when user input is embedded into the HTML result unsanitized. An attacker can abuse this behavior by embedding malicious HTML or Javascript code to locally deface the web applications result or lunch other attacks. By embedding malicious Javascript it is possible to access the cookies of the clients browser and send them to the attacker to steal session information. 4
9 Listing 3.1: Unsanitized output of user input <?php p r i n t ( '<h1>welcome '. $_GET [ 'name' ]. '</h1>' ) ;?> Listing 3.1 shows a typical XSS vulnerability. A user can specify a name by GET parameter and the name is embedded into the HTML result page. Instead of choosing an alphanumerical name he can also choose a name that consists of HTML and Javascript code: The code will be embedded into the output and send back to the clients browser which will parse the HTML and execute the Javascript code. An attacker can abuse this by sending this modified link with his payload in the GET parameter to a victim which will execute the Javascript code unintentially. The crafted HTML result is shown in listing 3.2. Listing 3.2: Resulting HTML of application in listing 3.1 with injected Javascript <h1>welcome foo </ h1>< s c r i p t > a l e r t ( 1 ) < / s c r i p t > </ h1> To patch this vulnerability the output has to be validated. Characters like < and > as well as quotes can be replaced by their HTML entities. This way the characters will still be displayed by the browser but not rendered as HTML tags. In PHP the buildin function htmlentities() and htmlspecialchars() can be used for output validation. 3.2 SQL Injection Web applications are often connected to external resources like databases to handle large data sets. To query the database the structered query language (SQL) is used. If a web application creates a SQL query on runtime with unsanitized user input an attacker might inject own SQL syntax to modify the SQL query. This vulnerability is called SQL Injection. Listing 3.3: SQL query build with unsanitized user input <?php $ i d = $_POST [ 'id' ] ; $ q u e r y = "SELECT id,title,content FROM news WHERE id = $id" ; mysql_query ( $query ) ;?> Listing 3.3 shows a SQL Injection vulnerability. A user can specify an id by POST parameter that is embedded unsanitized into a SQL query and send to the database. The database will respond with a news article from the table news corresponding to the specified ID. An attacker can inject own SQL syntax to modify the result of the query and gain sensitive information: id=1+union+select+1,username,password+from+users 5
10 Listing 3.4 shows the SQL query that will be build at runtime when posting this id. The injected SQL syntax will read sensitive information from the table users. Listing 3.4: SQL query with injected SQL code $ q u e r y = "SELECT id,inhalt FROM news WHERE id = 1 UNION SELECT 1,username,password FROM users" ; Depending on the database managment system, configuration and privileges even attacks on the web server could follow by abusing SQL functionalities. To patch this vulnerability user input has to be sanitized before embedding it into the query. Expected integer values should be typecasted to int to assure no SQL syntax can be embedded. Expected strings are normally embedded into quotes. Listing 3.5: Sanitized string embedded in quotes <?php $name = m y s q l _ r e a l _ e s c a p e _ s t r i n g ( $_POST [ 'name' ] ) ; $ q u e r y = "SELECT id,message FROM users WHERE name = '$name' " ; mysql_query ( $query ) ;?> In this case it is sufficient to avoid a break out of these quotes by escaping the quote character so that it is handled as regular character and not as SQL syntax. In PHP the buildin function mysql_real_escape_string() can be used for escaping strings before placing them into a MySQL query as shown in listing Other vulnerabilities There are many other taint-style vulnerabilties like File Disclosure and File Manipulation vulnerabilities that allow an attacker to read and write to arbitrary files. File Inclusion vulnerabilities enables an attacker to include arbitrary PHP files and execute PHP code. Uncommon vulnerabilities like Remote Code Execution or Remote Command Execution vulnerabilities even allow an attacker to execute arbitrary system commands on the web server. However all taint-style vulnerabilities rely on the same principle as XSS and SQL Injection: a PVF is called with untrusted and unsanitized data allowing malicious users to change the behavior and actions of this PVF to their advantage. Depending on the vulnerability their may be PHP buildin functions that can prevent this type of vulnerability. 6
11 4 Static source code analysis During a static source code analysis a computer program s source code is analysed without executing it. Executing a program will make it run through a single path, depending on the input during that execution, and consequently tools that analyze a program while it is running (dynamic analysis) can only examine those parts of the program that are reached during that particular run. Static analysis allows one to examine all the different execution paths through a program at once and make assessments that apply to every possible permutation of inputs. Static analysis is widely used for a variety of goals such as syntax highlighting, type checking, optimization as well as bug and security finding. In general, any tool that examines the source code of a program without executing it, can be categorized as a static analysis tool. [15] There are four major steps to analyse a source code statically: configuration, model construction, analysis and results processing. During the analysis step configured security knowledge can be used to detect vulnerabilities. 4.1 Configuration First the tool needs a precise rule set to know what to look for. For a vulnerability analysis it has to be specified which types of vulnerability should be detected and how sensitive sinks can be identified. Also the sources (user input) has to be declared that can taint data. Lastly appropiate securing actions that can be taken by the developer should be configured and detected to prevent secured parts of the program in the analysis result. 4.2 Model construction A static analysis tool has to transform source code into a program model. This is an abstract internal representation of the source code. The quality of a tool s analysis is largely dependent on the quality of the tool s program model so that it is very important that an analysis tool has a good understanding of the language s semantics. Building a program model takes the following steps: Lexical analysis The tool has to split the source code into tokens to identify language constructs correctly. Unimportant tokens like whitespaces and comments are normally stripped to identify connected tokens correctly. 7
12 Semantic analysis The analysis tool checks the representation of each token. In example it is important to decide between the function call print and the same word used in a string. Also variable types can be determined. Control flow analysis All possible paths that can be taken through the program are determined. This includes casual jumps and function calls. The paths are then combined to several control flow graphs (CFG) which represent all possible data flow paths. Data flow analysis The tool uses data flow analysis on each CFG to determine how data moves throughout the program. In a security vulnerability analyser taint analysis is used to determine where vulnerabilities occur. Data flow analysis bases on the results of the semantic and control flow analysis and therefore it is important, that previous results are as correct as possible. 4.3 Analysis When the model is build the tool can perform taint analysis on every found PVF. It also has to perform intraprocedural analysis for analysing a PVF call in an individual function and interprocedural analysis to perform analysis through an interaction between several functions Taint analysis During taint analysis it is determined, where tainted data reaches sensitive sinks and therefore a security flaw may exist. The tool has to differentiate between tainted sensitive sinks and untainted sensitive sinks during the data flow analysis step. Listing 4.1 and Listing 4.2 show two PHP scripts that use the PVF system() that executes system commands [3]. 1 <? php 2 $a = $_GET [ 'a' ] ; 3 $b = $a ; 4 system ( $b, $ r e t ) ; 5?> 1 <? php 2 $a = $_GET [ 'a' ] ; 3 $b = 'date' ; 4 system ( $b, $ r e t ) ; 5?> Listing 4.1: Remote Command Execution vulnerability Listing 4.2: Harmless static command execution 8
13 While listing 4.1 shows a Remote Command Execution vulnerability where a user can specify any command to be executed given by the GET parameter a, listing 4.2 is not a vulnerability because the command being executed is static and cannot be influenced by an attacker. By analysing the data flow of the PVFs parameter the tool can determine if untrusted data reaches the sink or if the PVF is called with harmless static data Intraprocedural and interprocedural analysis During taint analysis the tool also has to perform intraprocedural analysis. This analysis involves tracking data within a user defined function that has been called. If a sensitive sink has been found in a function declaration the tool has to decide under which circumstances this function has to be called to trigger a vulnerability in the sensitive sink. This is mostly the case when the sensitive sink depends on parameters of the user defined functions that has to be called with tainted data. The tool also must be able to decide if tainted data leaves the function untouched or if it is sanitized by running through the function. Also a function can return tainted data although it has not been called with tainted data (in example when new user input is accepted during the function execution). Interprocedural analysis is about understanding the context outside of the function during a call. Depending on the program state the call might behave differently or external variables in global scope might be changed. Since static source code analysis assumes all possible CFG data can run through, both analysis can be very difficult to achieve without increasing the analysis time too much. 4.4 Results processing The last important part of static source code analysis is to present the results to the user in such a way that he is able to quickly spot critical flaws. Displaying only relevant parts of the vulnerable code as well as syntax highlighting helps reviewing and understanding the problem. It is also helpful to provide automated information how this flaw can be fixed. If a problem-free section of code is inappropriately marked as vulnerable, we talk about a false positive or false alarm. If a tool fails to identify a vulnerability when in fact there is one, we talk about a false negative. Conversely, a correctly identified vulnerability is known as a true positive, while an appropriate absence of warnings on a secure section of code is called a true negative. False positives are generally seen as intrusive and undesirable and may lead to the rejection of a tool. False negatives are arguably even worse, because they can give the user a false sense of security.[15] The value of the tool is the better, the more true positives can be identified and the less false positives are displayed. Static source code analysis tools often generate a lot of false positives and warnings. This may occur due to incorrect semantic or flow analysis or circumstances that are needed for a correct identification of a vulnerability but which could not be evaluated by the tool correctly. Therefore it is important to present the results in such a way that the user can 9
14 easily decide between a correct vulnerability detection or a false positive himself. 10
15 5 RIPS implementation This chapter describes how the theorethical concepts of static source code analysis are implemented in RIPS. The analyser is written in PHP and the result is a HTML file with a window managment written in Javascript offering several options to review details of the result. RIPS does not need any requirements other than a local web server with a PHP interpreter and a web browser installed. 5.1 Configuration First several file extensions are configured to analyse only PHP files when scanning directories. To identify PVFs in source code files a huge list of PVFs is created and categorized into vulnerability types to allow the user to scan only for a specific vulnerability. Besides the function name the significant parameters are configured as well. This prevents false positives, where tainted data in the first parameter leads to a vulnerability, but tainted data in the second parameter is not critical. Also, this improves the performance because not related parameters are not traced back. The universal parameter 0 can be selected, when all parameters are potentially vulnerable and thereforce significant. This is important for functions, that can have a variable amount of parameters such as print(). RIPS currently scans for 186 PVFs seperated into the following vulnerability types: Cross-Site Scripting (5) SQL Injection (54) File Disclosure (37) File Manipulation (20) File Inclusion (7) Remote Code Execution (17) Remote Command Execution (8) Connection Handling (28) XPath Injection (3) Other (7) Also to each PVF a list of PHP buildin securing functions is configured. This is important to prevent false positives when securing actions are already taken by the developer. A configured PVF entry is implement as simple list of arrays. Listing 5.1 shows an example of a PVF entry for the function system() with the significant parameter (the first) and securing functions (escapeshellarg() and escapeshellcmd()). 11
16 Listing 5.1: PVF config entry for system() "system" => array ( array ( 1 ), array ( "escapeshellarg", "escapeshellcmd" ) ) ; Additionally a global list of securing functions is defined containing functions that will prevent the exploitation of every PVF. Those are usually functions that will return only integers like strlen() or sanitized strings like md5() that will prevent code injection. For each vulnerability type there is also a short description, example code, example patch and example exploitation configured to help the user understand the vulnerability that was found. All tainting sources (user input) has to be configured to identify a vulnerability during a back trace of PVF parameters. User input is commonly passed through GET, POST und Cookie parameters but also through uploaded file names and server enviroment variables such as the user agent or query string. In PHP the global variables $_GET, $_POST, $_COOKIE and $_FILES as well as $_SERVER and $ENV variables are handling these data [2]. Also tainted user input can come from files or databases when written or inserted previously by a user to that external resource. For this case functions that read from files or databases are configured as well. For information gathering a list of interesting functions (41) is declared that will create a note in the scan result each time a function call of this list is detected. Example are session_start() that indicates a session managment or mysql_connect() that indicates the usage of the database managment system (DBMS) MySQL. 5.2 Model construction RIPS uses the PHP buildin tokenizer extension that splits PHP source code into tokens. The whole model of the source code however is created during the analysis phase and not before. While this has great performance advantages it is assumed that everything used during the analysis phase has been detected within the previous source code. However in PHP it is allowed to call functions in the source code before they are actually declared later on Lexical and semantic analysis In order to analyse a PHP script correctly, the code is split into tokens. For this, the PHP function token_get_all() [5] is used. Each token is an array with a token identifier which can be turned into a token name by calling the buildin function token_name() [6], the token value and the line number. Single characters which represent the codes semantic appear as string in the token list. Listing 5.2 shows a PHP example code and listing 5.3 its representative token list generated by token_get_all(). 12
17 Listing 5.2: PHP example code 1 <? php 2 $a = $_GET [ 'a' ] ; 3 system ( $a, $ r e t ) ; 4?> Listing 5.3: Token list for listing 5.2 generated by token_get_all() name : T_OPEN_TAG v a l u e : <?php l i n e : 1 name : T_VARIABLE v a l u e : $a l i n e : 2 name : T_WHITESPACE v a l u e : l i n e : 2 = name : T_WHITESPACE v a l u e : l i n e : 2 name : T_VARIABLE v a l u e : $_GET, l i n e : 2 [ name : T_CONSTANT_ENCAPSED_STRING v a l u e : 'a', l i n e : 2 ] ; name : T_WHITESPACE v a l u e : l i n e : 2 name : T_STRING v a l u e : system l i n e : 3 ( name : T_VARIABLE v a l u e : $a l i n e : 3, name : T_WHITESPACE v a l u e : l i n e : 3 name : T_VARIABLE v a l u e : $ r e t l i n e : 3 ) ; name : T_WHITESPACE v a l u e : l i n e : 3 name : T_CLOSE_TAG v a l u e :?> l i n e : 4 Once the token list of a PHP script is obtained, there a several improvements made to analyse the tokens correctly. This includes replacing some special characters with function names (like `$a` to backticks($a) which represent a command execution [7]) or adding curly braces to program flow constructs where no braces have been used (in example if or switch conditions with only one conditional line following [8]). Also all whitespaces, inline HTML and comments are deleted from the token list to reduce the overhead and to identify connected tokens correctly. Then the source code can be analysed token by token [9] Parsing The goal of RIPS is to analyse the token list of each file only once to improve the speed. It is looping through the token list and identifies important tokens by name. For each scanned file it creates a dependency stack, a file stack, a list of declared variables and several registers that indicate whether it currently scans in a function, class or any other language structure. Several actions are performed when one of the following tokens is identified: 13
18 T_INCLUDE If a file inclusion is found, the tokens of the included file will be added to the currented token list as well as an additional token that identifies the end of the included tokens. Also there is a note about the success of the inclusion added to the output if information gathering is turned on. If the file name consists of variables and strings, the file name can be reconstructed dynamically. A internal file pointer keeps track of the current position in the included files. Also each file inclusion is checked for a file inclusion vulnerability. T_FUNCTION If a new function is declared, the name and the parameters are analysed and saved for further analysis. T_CLASS If a new class is declared, the name is saved for further analysis and a new list of potentially vulnerable class functions is created. This list is used to save vulnerable user-defined functions depending on their class because several classes can name their functions the same and this could lead to false positives. T_RETURN If a user-defined function returns a variable, this variable will get traced backwards and is checked for securing actions. If the returned variable is sanitized by a securing or neutralizing function like md5() or a securing action like a typecast, this function is added to the global securing function list so that user-defined sanitizing functions can be identified. If the return value is tainted by user input, the function is added to a list of functions that can taint other variables when assigned to them. T_VARIABLE If a variable declaration is identified the current scope is checked and the variable declaration is added either to a list of local (if the token is found in a function declaration) or to a global variable list together with the according line of the source code. Listing 5.4 shows some examples for variable declarations in PHP. Listing 5.4: Examples for variable declarations in PHP $a => $a = $_GET [ 'a' ] ; $b => $b = '' ; $b => $b. = $a ; $c [ 'name' ] => $c [ 'name' ] = $b ; $d => w h i l e ( $d = fopen ( $c [ 'name' ], 'r' ) ) The examples show that it is not sufficient to only parse = and ; in the token list to identify every variable declaration correctly. RIPS uses this list to trace variables found in PVF calls backwards to their origin during taint analysis. Also all dependencies are added to each variable declaration to make a trace through different program flows possible. RIPS avoids using control flow graphs due to performance reasons, however this might lead to false negatives in very specific scenarios. Additionally tokens that identify PHP specialities like extract(), list() or define() are evaluated to improve the correctness of the results. Also a list of interesting functions is 14
19 defined which identify a DBMS or session usage and detected calls are added to the output with a comment as information gathering if the verbosity level is set to do so Control flow analysis The following tokens are used to perform control flow analysis: Curly braces {} All program flow is detected by curly braces, and therefore the tokens have to be prepared in situations where no braces have been used by the programmer. Control structures like if and switch are added to a current dependencies stack. If a PVF is detected in the same block of braces, the current dependencies will be added to this find. A closing brace marks the end of the control structure, and the last dependency is removed from the dependencies stack. T_EXIT, T_THROW Tokens that can lead to a exit of the program flow are also detected, and the last found control structure the exits depends on (e.g. a if or switch statement) is added to the current dependency stack. If a program exit is found in a function declaration this function is added to the list of interesting functions with a note about a possible exit. With this the user can get an overview which conditions have to be made in order to get to the desired PVF call in the program flow without aborting the program run in advance. 5.3 Analysis The analysis phase starts every time a PVF call is detected during the analysation of the token list. This has the advantage that the token list only needs to be parsed once. However the previously build model during the parsing step has to be complete in such a way, that the analysis of the current PVF will be correct Taint analysis A function call is detected by the token T_STRING. If a function call is detected, the tool checks whether the function name is in the defined PVF list and therefore a function call to scan further. A new parent is created and all parameters configured as valuable will get traced backwards by looking up the variable names in the global or local variable list. Findings are added to the PVF tree as a child. All variables in the previously found declarations will also get looked up in the variable list and added to the corresponding parent. If securing actions are detected while analysing the line of a variable declaration, the child is marked red. If user input is found, the child is marked white and the PVF tree is added to the result. Optionally parameters can be marked as tainted if they are tainted by functions that read SQL query results or file contents. Therefore it is possible to identify vulnerabilities with a persistent payload storage. 15
20 1 <? php 2 $a = $_GET [ 'a' ] ; 3 $b = $a ; 4 system ( $b, $ r e t ) ; 5?> Listing 5.5: Example code with PVF system() Listing 5.5 shows an example code which makes use of the PVF system() that executes system commands [3]. Once the PVF is detected the next step is to identify its configured significant parameters. The function system() executes only the first parameter ($b) while the second handles only the result ($ret). Therefore only the first parameter $b is traced backwards. Accordingly line 3 is found in the global variable list which assignes variable $a to variable $b. Again $a will be compared to previously declared variables and so on. If a parameter originated from user input the PVF call is treated as a potential vulnerability. The tree of traced parameters is then shown to the user who can decide between a real vulnerability or a false positive. The output for listing 5.5 is shown in listing 5.6. Listing 5.6: Scan result for listing : system ( $b, $ r e t ) ; 3 : $b = $a ; 2 : $a = $_GET [ 'a' ] ; Intraprocedural and interprocedural analysis If a traced variable of a PVF in a user-defined function declaration depends on a parameter of this function, the declaration is added as child and marked yellow. Then this user-defined function is added to the PVF list with the according parameter list. The list of securing functions is adapted from the securing functions defined for the PVF found in this user-defined function. At the end, all currently needed dependencies in the program flow are addded. Listing 5.7: PVF exec() is called within a user-defined function 1 <? php 2 f u n c t i o n myexec ( $a, $b, $c ) 3 { 4 exec ( $b ) ; 5 } 6 7 $aa = "test" ; 8 $bb = $_GET [ 'cmd' ] ; 9 myexec ( $aa, $bb, $cc ) ; 10?> When the PVF call on line 4 in listing 5.7 is detected, the parameter $b is traced backwards. It is detected that $b depends on a function parameter of the function declaration of myexec(). 16
21 Now the function myexec() is added to the PVF list with the second parameter defined as valuable and the securing functions defined for exec(). The user-defined function myexec() is now treated as any other PVF function. If a call with user input is found, the call and the vulnerability is added to the output. This call may occur in another user-defined function so that interprocedural analysis is possible within chained function calls. The scan results for listing 5.7 are shown in listing 5.8 and listing 5.9. Listing 5.8: Scan result 1 for listing 5.7: the original PVF is shown 4 : exec ( $b ) ; 2 : f u n c t i o n myexec ( $a, $b, $c ) Listing 5.9: Scan result 2 for listing 5.7: the function call that triggers the vulnerability is shown 9 : myexec ( $aa, $bb, $cc ) ; 8 : $bb = $_GET [ 'cmd' ] ; Additionally, variables that are traced and declared in a different code structure than the PVF call was found in, will be commented with the dependency for the variable declaration. Dependencies that affect both, stay as global dependency for this parent. For correct intraprocdural analysis also globaled variables have to be considered. They are detected by identifying variables T_VARIABLE and a previous token T_GLOBAL. The keyword global declares a variable to be used in global and not in local variable scope [16]. All variables declared as global in a function are traced within the local variable list of the function and the global variable list. Also all changes on a variable declared as global within a function stay after the function returns. Therefore the modifications are saved to a extra variable list which is extracted into the global variable list once the function has been called. 5.4 Web interface RIPS can be completely controlled by a web interface. To start a scan a user simply has to provide a file or directory name, choose the vulnerability type and click scan. RIPS will only scan files with file extensions that have been configured. Addionally a verbosity level can be chosen to improve the results: The default verbosity level 1 scans only for PVF calls which are tainted with user input without any detected securing actions in the trace. The second verbosity level also includes files and database content as potentially malicious user input. This level is important to find vulnerabilites with a persistent payload storage but it might increase the false positive rate. The third verbosity level will also output secured PVF calls. This option is important to detect unsufficient securings which can be hard to detect by static source code analysis. The fourth verbosity level also shows additional informations RIPS collected during the scan. This includes found exits, notes about the success of analysing included files and 17
22 calls of functions that has been defined in the interesting functions array. On large PHP applications, this information gathering can lead to a very large and unclear scan result. The last verbosity level 5 shows all PVF calls and its traces no matter if tainted by user input or not. This can be useful in scenarios where a list of static input to PVF calls is of interest. However, this verbosity level will lead to a lot of false positives. All found PVF calls and their traces are shown syntax highlighted and devided in blocks to the user. The user can decide to show vulnerabilities in backward direction (as it was scanned from PVF to user input) or in forward direction (as a developer would read it). The syntax highlighting of the PHP code can be changed on the fly by choosing from 7 different stylesheets. The color schemes were manually adapted from Pastie (pastie.org) and integrated into RIPS own syntax highlighter. For each token name a CSS attribute defines a color so that own styles can be created easily. Tainted data is specially highlighted as well as found securing actions taken by the developer. An example scan result of RIPS version 0.32 can be seen in figure 5.1. Figure 5.1: Web interface of RIPS 0.32 with scan result and code viewer Also a drag and dropable window can be opened to see the original source code by clicking on the file icon. All lines used in the PVF call and its trace are highlighted red in the original code, and the code viewer automatically jumps to the PVF call to allow a quick and easy review of the trace. It also offers the ability to highlight specific variables by click to make an easy understanding of the code flow possible. 18
23 Another window can be opened for every detected vulnerability to quickly create a PHP curl exploit with a few clicks by hitting the target icon. Depending on the detected user input there are prepared code fragments which can be combined to create a exploit in a few seconds by entering the parameter values and a target URL. For multi-stage exploits, cookies are supported as well as SSL, HTTP AUTH and a connection timeout. The latest version of RIPS also offers a description, example vulnerability, example exploitation and patch information to the user for every vulnerability found. This help can be opened by clicking on the help button assigned to each block. For further investigations of complicated vulnerabilities, a list of user-defined functions, a list of program entry points (user input) and a list of all scanned files can be opened by the user which allows him to directly jump into the code by clicking on the list items. Also all userdefined functions called in the scan result can be analysed by placing the mouse cursor over the function name. Then the code of the function declaration is shown in a mouseover layer. Jumping between findings in a user-defined function and the according call of this function is also possible. 5.5 Scan results In order to test RIPS, the source code of a internship platform at the Ruhr-University Bochum was scanned. This platform is a virtual online banking webapplication written in PHP and was designed to teach several web application vulnerabilities during the internship. These vulnerabilities include 2 reflective XSS, 1 persistent XSS, 2 SQL Injection, 1 File Disclosure, 1 Code Evaluation, 1 Remote Command Execution vulnerability and 1 Business Logic Flaw. At first RIPS was run with verbosity level 1 in order to find PVFs directly tainted with user input without detected securing. RIPS scanned lines in 84 files for 181 functions in 2.3 seconds. Figure 5.2: Scan results with verbosity level 1, 2 and 3 Figure 5.2 shows the detected vulnerabilities and false positives (3). Suprisingly, a yet unknown HTTP Response Splitting and another unintended Cross-Site Scripting vulnerability was also detected. One false positive was a SQL injection wich had been prevented by a regular expression and therefore could not be evaluated as correct sanitization by RIPS. Another two false positive 19
24 occured with a fwrite() call to a logging file. Because of the fact that the file was a text file, and the data was sanitized correctly when read by the application again, this does not lead to a security flaw. However, it is important to know for the source code reviewer in what files an attacker is able to write because this can lead to other vulnerabilities (e.g. when the attacker can write into a PHP file). To detect the persistent XSS vulnerability, RIPS was set to verbosity level 2 and thus allowing to treat file and database content as tainting input for PVFs. The persistent XSS vulnerability was detected successfully. However this verbosity level also lead to 19 false positives. That is, because RIPS has no information if an attacker can insert data into the database at all or what kind of table layout is used. Almost all false positives affected a harmless column id whith type integer and auto_increment set that was mistakenly detected as potential tainting source. A significant false negative is the missing persistent XSS vulnerability. This one could only be detected by reviewing all secured PVF calls when setting the verbosity level to 3. The missing argument ENT_QUOTES in the securing function htmlentities() lead to a false detection of sufficient securing in a scenario where an eventhandler could be injected to an existing HTML element. However this verbosity level generated 151 false positives because all secured PVF calls ended in the result. While this rate of false positives is not acceptable it also shows how many secured PVF calls was detected correctly in verbosity level 1. As expected, the Business Logic Flaw could not be detected by taint analysis for PVF because it uses the applications logic and is not a taint-style vulnerability. 5.6 Limitations and future work The main limitation of static source code analysis is the missing evaluation of dynamic strings that are build at runtime. In PHP the name of an included file can be generated dynamically at runtime. Currently, RIPS is only capable of reconstructing dynamic file names composed of strings and variables holding strings or statics. However, if the file name is constructed by calling functions, the name cannot be reconstructed. Particularly large PHP projects rely on an interaction of several PHP scripts, and a security flaw might depend on several files to work and to get detected correctly. Future work will address this problem. One option could be to combine dynamic and static source code analysis to evaluate dynamic file names. Currently, the best workaround is to rewrite complex dynamic file names to static hardcoded file inclusions. Also it should be obvious that RIPS is only capable of finding security vulnerabilities that are considered as bugs and not as intended obfuscated backdoors. Those can be easily hidden from static source code analysis by calling dynamic function names as shown in listing Listing 5.10: dynamic backdoor not found by RIPS $a=base64_decode ( 'c3lzdgvt' ) ; $a ( $_GET [ 'c' ] ) ; The same limitation appears for a user-defined securing function that relies on regular expressions or string replacements which can not be evaluated during a static source code analysis. Therefore it is not possible to determine if securing taken by the developer is safe or not in each 20
25 scenario. This can lead to false positives or negatives. As a compromise, the user has the option to review secured PVF calls. In the future it is planned to fully support object oriented programming. Vulnerable functions in classes are detected but no interaction with variables assigned to an object is supported by RIPS in its current state as well as classes that implement or extend other classes. Additionally RIPS does not fully support all PHP code semantics such as variable variables or aliases and does not consider variable types in all cases. This can lead to false positives and false negatives. Future work will address these problems, although they occur rarely. 21
26 6 Related work Various techniques such as flow-sensitive, interprocedural, and contextsensitive data flow analysis are described and used by the authors of Pixy [10], the first open source static source code analyser for PHP written in Java [11]. It uses control flow graphs to scan every possible combination of data flow. While Pixy is great in finding vulnerabilities with a false positive rate of 50%, it only supports XSS and SQL injection vulnerabilities. Both vulnerabilities are the most common vulnerabilities in PHP applications. The goal of RIPS was to build a new approach of a static source code analyser written in PHP using the built-in tokenizer functions. Unlike Pixy, RIPS runs without any requirements like a database managment system, the Java enviroment or any other programming language than PHP itself. Also RIPS aims to find a lot more common vulnerabilities including XSS and SQL injection, but also all kinds of header injections, file vulnerabilities and code/command execution vulnerabilities. A difference in the user interface is that RIPS is designed to easily review and compare the findings with the original source code for a faster and easier confirmation and exploitation and therefore to give a better understanding of how the vulnerabilities work instead of pointing out that the application is vulnerable in a specific line. Often a vulnerability can be found very fast in the depth of the source code, and the hard part is to trace back under which conditions this codeblock is called. Since static source code analysis can fail for very complicated vulnerabilities, RIPS goal is to do its best at finding flaws automatically but also to provide as much information and options to make further analysis as easy and fast as possible. Compared to Pixy, RIPS is also capable of finding vulnerabilities with persistent payloads stored in files or databases by using different verbosity levels. A disadvantage compared to Pixy is, that the lexical analyzation of RIPS assumes some "good coding practices" in the analysed source code to analyse it correctly. In example RIPS assumes that code structures are written line per line and that user-defined functions are declared before they are called. Future work will include to make the lexical analyzation more flexible. Also a lot of research about Aliases in PHP has been done by the authors of Pixy [12] which is not supported by RIPS because of its rareness. Both tools suffer from the limitations of static source code analysis as described in the previous section. An extended version of Pixy called Saner [13] has been created to address the problem with unknown user-defined securing actions and its efficiency. It uses predefined test cases to check whether the filter is efficient enough or not. Additionally, there exist tools like Owasp Swaat [14] which are designed to find security flaws in more than one language but which only detect vulnerable functions by looking for strings. This is sufficient for a first overview of potential unsafe program blocks but without consideration of 22
27 the application context, real vulnerabilities cannot be confirmed. However, this method with an additional parameter trace can also been forced with RIPS by setting the verbosity level to 5. Commercial static source code analysis products have been evaluated in an excellent paper by Nico L. de Poel [15]. 23
28 7 Summary In the past, a lot of open source webapplication scanners had been released that aim to find vulnerabilities in a black box scenario by fuzzing. A source code review in a white box scenario can lead to much better results, but only a few open source PHP code analysers are available. RIPS is a new approach using the built-in PHP tokenizer functions. It is specialized for fast source code audits and can save a lot of time. Tests have shown that RIPS is capable of finding known and unknown security flaws in large PHP-based webapplications within seconds. The webinterface assists the reviewer with a lot of useful features like the integrated codeviewer, a list of all user-defined functions and a connection between both. Found vulnerabilities can be easily tested by creating PHP curl exploits. However, due to the limitations of static source code analysis and some assumption on the programm code made by RIPS, false negatives or false positives can occur and a manual review of the outlined result has to be made or the verbosity level has to be loosend to detect previoulsy missed vulnerabilities that could not be identified correctly. Also most of the wide spread PHP applications today rely on object oriented programming which is not fully supported by RIPS yet. Therefore RIPS should be seen as a tool that helps analysing PHP source code for security flaws but not as a ultimate security flaw finder. 24
29 Bibliography [1] Fabien Coelho, PHP-related vulnerabilities on the National Vulnerability Database [2] The PHP Group, Predefined Variables [3] The PHP Group, system - Execute an external program and display the output [4] The PHP Group, escapeshellarg - Escape a string to be used as a shell argument [5] The PHP Group, token_get_all - Split given source into PHP tokens [6] The PHP Group, token_name - Get the symbolic name of a given PHP token [7] The PHP Group, Execution Operators [8] The PHP Group, Control Structures [9] The PHP Group, List of Parser Tokens [10] Nenad Jovanovic, Christopher Kruegel, Engin Kirda, Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Short Paper) [11] Nenad Jovanovic, Christopher Kruegel, Engin Kirda, Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Technical Report) [12] Nenad Jovanovic, Christopher Kruegel, Engin Kirda, Precise Alias Analysis for Static Detection of Web Application Vulnerabilities [13] Davide Balzarotti, Marco Cova, Vika Felmetsger, Nenad Jovanovic, Engin Kirda, Christopher Kruegel, Giovanni Vigna, Saner: Composing Static and Dynamic Analysis to Validate Sanitization inweb Applications [14] OWASP, OWASP SWAAT Project 25
30 [15] Nico L. de Poel, Automated Security Review of PHP Web Applications with Static Code Analysis Informatica/Master/2010/Poel.N.L.de./INF-MA-2010-N.L._de_ Poel.pdf [16] The PHP Group, Variable scope 26
RIPS - A static source code analyser for vulnerabilities in PHP scripts
RIPS - A static source code analyser for vulnerabilities in PHP scripts Johannes Dahse 1 Introduction The amount of websites have increased rapidly during the last years. While websites consisted mostly
RIPS. A static source code analyser for vulnerabilities in PHP scripts. NDS Seminar. A static source code analyser for vulnerabilities in PHP scripts
NDS Seminar 1 1.1 Motivation 1.2 PHP Vulnerabilities 1.3 Taint Analysis 1.4 Static VS Dynamic Code Analysis : RIPS 2.1 Configuration 2.2 The Tokenizer 2.3 Token Analysis 2.4 Webinterface 2.5 Results 2.6
Webapps Vulnerability Report
Tuesday, May 1, 2012 Webapps Vulnerability Report Introduction This report provides detailed information of every vulnerability that was found and successfully exploited by CORE Impact Professional during
Web Vulnerability Assessment Report
Web Vulnerability Assessment Report Target Scanned: www.daflavan.com Report Generated: Mon May 5 14:43:24 2014 Identified Vulnerabilities: 39 Threat Level: High Screenshot of www.daflavan.com HomePage
3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management
What is an? s Ten Most Critical Web Application Security Vulnerabilities Anthony LAI, CISSP, CISA Chapter Leader (Hong Kong) [email protected] Open Web Application Security Project http://www.owasp.org
EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke
EVALUATING COMMERCIAL WEB APPLICATION SECURITY By Aaron Parke Outline Project background What and why? Targeted sites Testing process Burp s findings Technical talk My findings and thoughts Questions Project
Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security
Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security Presented 2009-05-29 by David Strauss Thinking Securely Security is a process, not
Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH [email protected] January 17, 2014 2014 Mega Conference
Cracking the Perimeter via Web Application Hacking Zach Grace, CISSP, CEH [email protected] January 17, 2014 2014 Mega Conference About 403 Labs 403 Labs is a full-service information security and compliance
Application security testing: Protecting your application and data
E-Book Application security testing: Protecting your application and data Application security testing is critical in ensuring your data and application is safe from security attack. This ebook offers
Perl In Secure Web Development
Perl In Secure Web Development Jonathan Worthington ([email protected]) August 31, 2005 Perl is used extensively today to build server side web applications. Using the vast array of modules on CPAN, one
External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION
External Vulnerability Assessment -Technical Summary- Prepared for: ABC ORGANIZATI On March 9, 2008 Prepared by: AOS Security Solutions 1 of 13 Table of Contents Executive Summary... 3 Discovered Security
OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair dave.wichers@owasp.
and Top 10 (2007 Update) Dave Wichers The Foundation Conferences Chair [email protected] COO, Aspect Security [email protected] Copyright 2007 - The Foundation This work is available
What is Web Security? Motivation
[email protected] http://www.brucker.ch/ Information Security ETH Zürich Zürich, Switzerland Information Security Fundamentals March 23, 2004 The End Users View The Server Providers View What is Web
Acunetix Website Audit. 5 November, 2014. Developer Report. Generated by Acunetix WVS Reporter (v8.0 Build 20120808)
Acunetix Website Audit 5 November, 2014 Developer Report Generated by Acunetix WVS Reporter (v8.0 Build 20120808) Scan of http://filesbi.go.id:80/ Scan details Scan information Starttime 05/11/2014 14:44:06
Toward A Taxonomy of Techniques to Detect Cross-site Scripting and SQL Injection Vulnerabilities
NCSU CSC TR 2008-4 1 Toward A Taxonomy of Techniques to Detect Cross-site Scripting and SQL Injection Vulnerabilities Yonghee SHIN, Laurie WILLIAMS, Members, IEEE Abstract Since 2002, over half of reported
WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats
WHITE PAPER FortiWeb and the OWASP Top 10 PAGE 2 Introduction The Open Web Application Security project (OWASP) Top Ten provides a powerful awareness document for web application security. The OWASP Top
FINAL DoIT 11.03.2015 - v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES
Purpose: The Department of Information Technology (DoIT) is committed to developing secure applications. DoIT s System Development Methodology (SDM) and Application Development requirements ensure that
Web Application Security
E-SPIN PROFESSIONAL BOOK Vulnerability Management Web Application Security ALL THE PRACTICAL KNOW HOW AND HOW TO RELATED TO THE SUBJECT MATTERS. COMBATING THE WEB VULNERABILITY THREAT Editor s Summary
Web Application Security
Web Application Security John Zaharopoulos ITS - Security 10/9/2012 1 Web App Security Trends Web 2.0 Dynamic Webpages Growth of Ajax / Client side Javascript Hardening of OSes Secure by default Auto-patching
Web-Application Security
Web-Application Security Kristian Beilke Arbeitsgruppe Sichere Identität Fachbereich Mathematik und Informatik Freie Universität Berlin 29. Juni 2011 Overview Web Applications SQL Injection XSS Bad Practice
Integrated Network Vulnerability Scanning & Penetration Testing SAINTcorporation.com
SAINT Integrated Network Vulnerability Scanning and Penetration Testing www.saintcorporation.com Introduction While network vulnerability scanning is an important tool in proactive network security, penetration
CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities
CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities Thomas Moyer Spring 2010 1 Web Applications What has changed with web applications? Traditional applications
Secure Web Application Coding Team Introductory Meeting December 1, 2005 1:00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda
Secure Web Application Coding Team Introductory Meeting December 1, 2005 1:00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda 1. Introductions for new members (5 minutes) 2. Name of group 3. Current
Advanced Web Security, Lab
Advanced Web Security, Lab Web Server Security: Attacking and Defending November 13, 2013 Read this earlier than one day before the lab! Note that you will not have any internet access during the lab,
Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011
Cross Site Scripting (XSS) and PHP Security Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011 What Is Cross Site Scripting? Injecting Scripts Into Otherwise Benign and Trusted Browser Rendered
Detection of SQL Injection and XSS Vulnerability in Web Application
International Journal of Engineering and Applied Sciences (IJEAS) ISSN: 2394-3661, Volume-2, Issue-3, March 2015 Detection of SQL Injection and XSS Vulnerability in Web Application Priti Singh, Kirthika
Magento Security and Vulnerabilities. Roman Stepanov
Magento Security and Vulnerabilities Roman Stepanov http://ice.eltrino.com/ Table of contents Introduction Open Web Application Security Project OWASP TOP 10 List Common issues in Magento A1 Injection
How To Fix A Web Application Security Vulnerability
Proposal of Improving Web Application Security in Context of Latest Hacking Trends RADEK VALA, ROMAN JASEK Department of Informatics and Artificial Intelligence Tomas Bata University in Zlin, Faculty of
Check list for web developers
Check list for web developers Requirement Yes No Remarks 1. Input Validation 1.1) Have you done input validation for all the user inputs using white listing and/or sanitization? 1.2) Does the input validation
Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability
Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability WWW Based upon HTTP and HTML Runs in TCP s application layer Runs on top of the Internet Used to exchange
Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh
Web applications Web security: web basics Myrto Arapinis School of Informatics University of Edinburgh HTTP March 19, 2015 Client Server Database (HTML, JavaScript) (PHP) (SQL) 1 / 24 2 / 24 URLs HTTP
OWASP TOP 10 ILIA ALSHANETSKY @ILIAA HTTPS://JOIND.IN/15741
OWASP TOP 10 ILIA ALSHANETSKY @ILIAA HTTPS://JOIND.IN/15741 ME, MYSELF & I PHP Core Developer Author of Guide to PHP Security Security Aficionado THE CONUNDRUM USABILITY SECURITY YOU CAN HAVE ONE ;-) OPEN
Client vs. Server Implementations of Mitigating XSS Security Threats on Web Applications
Journal of Basic and Applied Engineering Research pp. 50-54 Krishi Sanskriti Publications http://www.krishisanskriti.org/jbaer.html Client vs. Server Implementations of Mitigating XSS Security Threats
Detecting and Exploiting XSS with Xenotix XSS Exploit Framework
Detecting and Exploiting XSS with Xenotix XSS Exploit Framework [email protected] keralacyberforce.in Introduction Cross Site Scripting or XSS vulnerabilities have been reported and exploited since 1990s.
Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek ([email protected])
Bug Report Date: March 19, 2011 Reporter: Chris Jarabek ([email protected]) Software: Kimai Version: 0.9.1.1205 Website: http://www.kimai.org Description: Kimai is a web based time-tracking application.
Adobe Systems Incorporated
Adobe Connect 9.2 Page 1 of 8 Adobe Systems Incorporated Adobe Connect 9.2 Hosted Solution June 20 th 2014 Adobe Connect 9.2 Page 2 of 8 Table of Contents Engagement Overview... 3 About Connect 9.2...
State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell
Stanford Computer Security Lab State of The Art: Automated Black Box Web Application Vulnerability Testing, Elie Bursztein, Divij Gupta, John Mitchell Background Web Application Vulnerability Protection
QualysGuard WAS. Getting Started Guide Version 3.3. March 21, 2014
QualysGuard WAS Getting Started Guide Version 3.3 March 21, 2014 Copyright 2011-2014 by Qualys, Inc. All Rights Reserved. Qualys, the Qualys logo and QualysGuard are registered trademarks of Qualys, Inc.
WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY
WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY www.alliancetechpartners.com WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY More than 70% of all websites have vulnerabilities
HTTPParameter Pollution. ChrysostomosDaniel
HTTPParameter Pollution ChrysostomosDaniel Introduction Nowadays, many components from web applications are commonly run on the user s computer (such as Javascript), and not just on the application s provider
Web application security
Web application security Sebastian Lopienski CERN Computer Security Team openlab and summer lectures 2010 (non-web question) Is this OK? int set_non_root_uid(int uid) { // making sure that uid is not 0
Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Technical Report)
Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Technical Report) Nenad Jovanovic, Christopher Kruegel, Engin Kirda Secure Systems Lab Vienna University of Technology Abstract
Java Program Vulnerabilities
Java Program Vulnerabilities Sheetal Thakare, Dr.B.B.Meshram Abstract The Java programming language provides a lot of security features, build directly into the language and also supplied by security relevant
ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST
ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST Performed Between Testing start date and end date By SSL247 Limited SSL247 Limited 63, Lisson Street Marylebone London
Passing PCI Compliance How to Address the Application Security Mandates
Passing PCI Compliance How to Address the Application Security Mandates The Payment Card Industry Data Security Standards includes several requirements that mandate security at the application layer. These
HP WebInspect Tutorial
HP WebInspect Tutorial Introduction: With the exponential increase in internet usage, companies around the world are now obsessed about having a web application of their own which would provide all the
Facebook Twitter YouTube Google Plus Website Email
PHP MySQL COURSE WITH OOP COURSE COVERS: PHP MySQL OBJECT ORIENTED PROGRAMMING WITH PHP SYLLABUS PHP 1. Writing PHP scripts- Writing PHP scripts, learn about PHP code structure, how to write and execute
ASL IT Security Advanced Web Exploitation Kung Fu V2.0
ASL IT Security Advanced Web Exploitation Kung Fu V2.0 A S L I T S e c u r i t y P v t L t d. Page 1 Overview: There is a lot more in modern day web exploitation than the good old alert( xss ) and union
Detect and Sanitise Encoded Cross-Site Scripting and SQL Injection Attack Strings Using a Hash Map
Detect and Sanitise Encoded Cross-Site Scripting and SQL Injection Attack Strings Using a Hash Map Erwin Adi and Irene Salomo School of Computer Science BINUS International BINUS University, Indonesia
Security Test s i t ng Eileen Donlon CMSC 737 Spring 2008
Security Testing Eileen Donlon CMSC 737 Spring 2008 Testing for Security Functional tests Testing that role based security functions correctly Vulnerability scanning and penetration tests Testing whether
Ruby on Rails Secure Coding Recommendations
Introduction Altius IT s list of Ruby on Rails Secure Coding Recommendations is based upon security best practices. This list may not be complete and Altius IT recommends this list be augmented with additional
Advanced Web Technology 10) XSS, CSRF and SQL Injection 2
Berner Fachhochschule, Technik und Informatik Advanced Web Technology 10) XSS, CSRF and SQL Injection Dr. E. Benoist Fall Semester 2010/2011 Table of Contents Cross Site Request Forgery - CSRF Presentation
DiskPulse DISK CHANGE MONITOR
DiskPulse DISK CHANGE MONITOR User Manual Version 7.9 Oct 2015 www.diskpulse.com [email protected] 1 1 DiskPulse Overview...3 2 DiskPulse Product Versions...5 3 Using Desktop Product Version...6 3.1 Product
CS 558 Internet Systems and Technologies
CS 558 Internet Systems and Technologies Dimitris Deyannis [email protected] 881 Heat seeking Honeypots: Design and Experience Abstract Compromised Web servers are used to perform many malicious activities.
Web Application Guidelines
Web Application Guidelines Web applications have become one of the most important topics in the security field. This is for several reasons: It can be simple for anyone to create working code without security
ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION
ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION V 2.0 A S L I T S e c u r i t y P v t L t d. Page 1 Overview: Learn the various attacks like sql injections, cross site scripting, command execution
Intrusion detection for web applications
Intrusion detection for web applications Intrusion detection for web applications Łukasz Pilorz Application Security Team, Allegro.pl Reasons for using IDS solutions known weaknesses and vulnerabilities
Penetration Test Report
Penetration Test Report Acme Test Company ACMEIT System 26 th November 2010 Executive Summary Info-Assure Ltd was engaged by Acme Test Company to perform an IT Health Check (ITHC) on the ACMEIT System
Implementation of Web Application Firewall
Implementation of Web Application Firewall OuTian 1 Introduction Abstract Web 層 應 用 程 式 之 攻 擊 日 趨 嚴 重, 而 國 內 多 數 企 業 仍 不 知 該 如 何 以 資 安 設 備 阻 擋, 仍 在 採 購 傳 統 的 Firewall/IPS,
Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008
Detecting Web Application Vulnerabilities Using Open Source Means OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008 Kostas Papapanagiotou Committee Member OWASP Greek Chapter [email protected]
Web Application Vulnerability Testing with Nessus
The OWASP Foundation http://www.owasp.org Web Application Vulnerability Testing with Nessus Rïk A. Jones, CISSP [email protected] Rïk A. Jones Web developer since 1995 (16+ years) Involved with information
The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.
This sample report is published with prior consent of our client in view of the fact that the current release of this web application is three major releases ahead in its life cycle. Issues pointed out
Cross Site Scripting in Joomla Acajoom Component
Whitepaper Cross Site Scripting in Joomla Acajoom Component Vandan Joshi December 2011 TABLE OF CONTENTS Abstract... 3 Introduction... 3 A Likely Scenario... 5 The Exploit... 9 The Impact... 12 Recommended
Hardening Joomla 1. HARDENING PHP. 1.1 Installing Suhosin. 1.2 Disable Remote Includes. 1.3 Disable Unneeded Functions & Classes
1. HARDENING PHP Hardening Joomla 1.1 Installing Suhosin Suhosin is a PHP Hardening patch which aims to protect the PHP engine and runtime environment from common exploits, such as buffer overflows in
Common Security Vulnerabilities in Online Payment Systems
Common Security Vulnerabilities in Online Payment Systems Author- Hitesh Malviya(Information Security analyst) Qualifications: C!EH, EC!SA, MCITP, CCNA, MCP Current Position: CEO at HCF Infosec Limited
Hack Proof Your Webapps
Hack Proof Your Webapps About ERM About the speaker Web Application Security Expert Enterprise Risk Management, Inc. Background Web Development and System Administration Florida International University
Cyber Security Challenge Australia 2014
Cyber Security Challenge Australia 2014 www.cyberchallenge.com.au CySCA2014 Web Penetration Testing Writeup Background: Pentest the web server that is hosted in the environment at www.fortcerts.cysca Web
Chapter 1 Web Application (In)security 1
Introduction xxiii Chapter 1 Web Application (In)security 1 The Evolution of Web Applications 2 Common Web Application Functions 4 Benefits of Web Applications 5 Web Application Security 6 "This Site Is
The Weakest Link: Mitigating Web Application Vulnerabilities. webscurity White Paper. webscurity Inc. Minneapolis, Minnesota USA
The Weakest Link: Mitigating Web Application Vulnerabilities webscurity White Paper webscurity Inc. Minneapolis, Minnesota USA January 25, 2007 Contents Executive Summary...3 Introduction...4 Target Audience...4
OWASP Top Ten Tools and Tactics
OWASP Top Ten Tools and Tactics Russ McRee Copyright 2012 HolisticInfoSec.org SANSFIRE 2012 10 JULY Welcome Manager, Security Analytics for Microsoft Online Services Security & Compliance Writer (toolsmith),
Rational AppScan & Ounce Products
IBM Software Group Rational AppScan & Ounce Products Presenters Tony Sisson and Frank Sassano 2007 IBM Corporation IBM Software Group The Alarming Truth CheckFree warns 5 million customers after hack http://infosecurity.us/?p=5168
Cross Site Scripting Prevention
Project Report CS 649 : Network Security Cross Site Scripting Prevention Under Guidance of Prof. Bernard Menezes Submitted By Neelamadhav (09305045) Raju Chinthala (09305056) Kiran Akipogu (09305074) Vijaya
Testing Web Applications for SQL Injection Sam Shober [email protected]
Testing Web Applications for SQL Injection Sam Shober [email protected] Abstract: This paper discusses the SQL injection vulnerability, its impact on web applications, methods for pre-deployment and
CSCI110 Exercise 4: Database - MySQL
CSCI110 Exercise 4: Database - MySQL The exercise This exercise is to be completed in the laboratory and your completed work is to be shown to the laboratory tutor. The work should be done in week-8 but
Secure Web Development Teaching Modules 1. Security Testing. 1.1 Security Practices for Software Verification
Secure Web Development Teaching Modules 1 Security Testing Contents 1 Concepts... 1 1.1 Security Practices for Software Verification... 1 1.2 Software Security Testing... 2 2 Labs Objectives... 2 3 Lab
SQL Injection January 23, 2013
Web-based Attack: SQL Injection SQL Injection January 23, 2013 Authored By: Stephanie Reetz, SOC Analyst Contents Introduction Introduction...1 Web applications are everywhere on the Internet. Almost Overview...2
WebCruiser Web Vulnerability Scanner User Guide
WebCruiser Web Vulnerability Scanner User Guide Content 1. Software Introduction...2 2. Key Features...3 2.1. POST Data Resend...3 2.2. Vulnerability Scanner...6 2.3. SQL Injection...8 2.3.1. POST SQL
1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications
1. Introduction 2. Web Application 3. Components 4. Common Vulnerabilities 5. Improving security in Web applications 2 What does World Wide Web security mean? Webmasters=> confidence that their site won
Where every interaction matters.
Where every interaction matters. Peer 1 Vigilant Web Application Firewall Powered by Alert Logic The Open Web Application Security Project (OWASP) Top Ten Web Security Risks and Countermeasures White Paper
Application Code Development Standards
Application Code Development Standards Overview This document is intended to provide guidance to campus system owners and software developers regarding secure software engineering practices. These standards
Recommended Practice Case Study: Cross-Site Scripting. February 2007
Recommended Practice Case Study: Cross-Site Scripting February 2007 iii ACKNOWLEDGEMENT This document was developed for the U.S. Department of Homeland Security to provide guidance for control system cyber
Cross-Site Scripting
Cross-Site Scripting (XSS) Computer and Network Security Seminar Fabrice Bodmer ([email protected]) UNIFR - Winter Semester 2006-2007 XSS: Table of contents What is Cross-Site Scripting (XSS)? Some
DIPLOMA IN WEBDEVELOPMENT
DIPLOMA IN WEBDEVELOPMENT Prerequisite skills Basic programming knowledge on C Language or Core Java is must. # Module 1 Basics and introduction to HTML Basic HTML training. Different HTML elements, tags
CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS
66 CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS 5.1 INTRODUCTION In this research work, two new techniques have been proposed for addressing the problem of SQL injection attacks, one
Introduction:... 1 Security in SDLC:... 2 Penetration Testing Methodology: Case Study... 3
Table of Contents Introduction:... 1 Security in SDLC:... 2 Penetration Testing Methodology: Case Study... 3 Information Gathering... 3 Vulnerability Testing... 7 OWASP TOP 10 Vulnerabilities:... 8 Injection
Protection, Usability and Improvements in Reflected XSS Filters
Protection, Usability and Improvements in Reflected XSS Filters Riccardo Pelizzi System Security Lab Department of Computer Science Stony Brook University May 2, 2012 1 / 19 Riccardo Pelizzi Improvements
elearning for Secure Application Development
elearning for Secure Application Development Curriculum Application Security Awareness Series 1-2 Secure Software Development Series 2-8 Secure Architectures and Threat Modeling Series 9 Application Security
Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper
Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks Whitepaper The security industry has extensively focused on protecting against malicious injection attacks like
Basic & Advanced Administration for Citrix NetScaler 9.2
Basic & Advanced Administration for Citrix NetScaler 9.2 Day One Introducing and deploying Citrix NetScaler Key - Brief Introduction to the NetScaler system Planning a NetScaler deployment Deployment scenarios
Using Free Tools To Test Web Application Security
Using Free Tools To Test Web Application Security Speaker Biography Matt Neely, CISSP, CTGA, GCIH, and GCWN Manager of the Profiling Team at SecureState Areas of expertise: wireless, penetration testing,
Securing PHP Based Web Application Using Vulnerability Injection
International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 3, Number 5 (2013), pp. 391-398 International Research Publications House http://www. irphouse.com /ijict.htm Securing
How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering
How to break in Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering Time Agenda Agenda Item 9:30 10:00 Introduction 10:00 10:45 Web Application Penetration
Columbia University Web Security Standards and Practices. Objective and Scope
Columbia University Web Security Standards and Practices Objective and Scope Effective Date: January 2011 This Web Security Standards and Practices document establishes a baseline of security related requirements
REDCap General Security Overview
REDCap General Security Overview Introduction REDCap is a web application for building and managing online surveys and databases, and thus proper security practices must instituted on the network and server(s)
Web application testing
CL-WTS Web application testing Classroom 2 days Testing plays a very important role in ensuring security and robustness of web applications. Various approaches from high level auditing through penetration
