Institutionen för datavetenskap
|
|
|
- Harold McDaniel
- 10 years ago
- Views:
Transcription
1 Institutionen för datavetenskap Department of Computer and Information Science Final thesis Generating web applications containing XSS and CSRF vulnerabilities by Gustav Ahlberg LIU-IDA/LITH-EX-A--14/054--SE Linköpings universitet SE Linköping, Sweden Linköpings universitet Linköping
2 Linköping University Department of Computer and Information Science Final Thesis Generating web applications containing XSS and CSRF vulnerabilities by Gustav Ahlberg LIU-IDA/LITH-EX-A--14/054--SE Supervisor: Ulf Kargén (IDA), Teodor Sommestad (FOI) Examiner: Nahid Shahmehri
3 Abstract Most of the people in the industrial world are using several web applications every day. Many of those web applications contain vulnerabilities that can allow attackers to steal sensitive data from the web application s users. One way to detect these vulnerabilities is to have a penetration tester examine the web application. A common way to train penetration testers to find vulnerabilities is to challenge them with realistic web applications that contain vulnerabilities. The penetration tester s assignment is to try to locate and exploit the vulnerabilities in the web application. Training on the same web application twice will not provide any new challenges to the penetration tester, because the penetration tester already knows how to exploit all the vulnerabilities in the web application. Therefore, a vast number of web applications and variants of web applications are needed to train on. This thesis describes a tool designed and developed to automatically generate vulnerable web applications. First a web application is prepared, so that the tool can generate a vulnerable version of the web application. The tool injects Cross Site Scripting (XSS) and Cross Site Request Forgery (CSRF) vulnerabilities in prepared web applications. Different variations of the same vulnerability can also be injected, so that different methods are needed to exploit the vulnerability depending on the variation. A purpose of the tool is that it should generate web applications which shall be used to train penetration testers, and some of the vulnerabilities the tool can inject, cannot be detected by current free web application vulnerability scanners, and would thus need to be detected by a penetration tester. To inject the vulnerabilities, the tool uses abstract syntax trees and taint analysis to detect where vulnerabilities can be injected in the prepared web applications. Tests confirm that web application vulnerability scanners cannot find all the vulnerabilities on the web applications which have been generated by the tool. i
4
5 Contents 1 Introduction Motivation Goals Constraints Outline Web Application Attacks Cross Site Scripting (XSS) attacks Reflected Stored Document Object Model (DOM) Mutation-based Cross Site Request Forgery (CSRF) attacks Web Application Vulnerability Scanners Detection difficulties Previous Work Manually Developed Vulnerable Web Applications Generating Vulnerable Web Applications Automatically Generating Vulnerable Web Applications Design and implementation Phulner Preparing a project Generating a vulnerable web application Categorization XSS CSRF XSS Injection Static Taint Analysis CSRF injection Example of a CSRF Vulnerability Injection iii
6 CONTENTS CONTENTS 6 Evaluation Inject exploitable vulnerabilities Ability to inject nontrivial vulnerabilities Project Preparation Time Future work Conclusions 47 iv
7 List of Figures 2.1 Steps in a reflected XSS attack Steps in a stored XSS attack Steps in a DOM XSS attack Steps in a Mutation-based XSS attack Steps in a CSRF attack Workflow when preparing a project Workflow when injecting vulnerabilities The four dimensions of an XSS vulnerability Abstract Syntax Tree produced from the code in listings 5.3.1, and Abstract syntax tree for the code in Listing Abstract syntax tree for the code in Listing v
8 List of listings Example of a page vulnerable to a reflected XSS attack Example of a page vulnerable to a stored XSS attack Example of a page vulnerable to DOM XSS Example of a page vulnerable to Mutation-based XSS Page vulnerable to CSRF Example of Site Generator configuration file The variable $id is sanitized multiple times An example project configuration for a Phulner project An example instance configuration for a Phulner project Code producing the Abstract Syntax Tree in Figure Code producing the Abstract Syntax Tree in Figure Code producing the Abstract Syntax Tree in Figure Code prepared for injection of an XSS vulnerability Code for the abstract syntax tree in Figure 5.6 after the sanitizing function is replaced Example of how taint propagates. The outputted variable $number is tainted Example of how taint propagates and is removed. The outputted variable $number will not be tainted Web page protected from CSRF Web page no longer protected from CSRF vi
9 Chapter 1 Introduction This thesis was conducted at the Swedish Defence Research Agency (FOI) in Linköping, as part of a master s degree in Computer Science and Engineering at Linköping University. 1.1 Motivation A vast number of web applications exist today, and most people in the industrialized world are using several of these web applications every day. However, many web application developers lack the skill to write secure code without vulnerabilities [38]. It is therefore likely that some of the web applications contain vulnerabilities. Vulnerabilities in web applications can for example allow attackers to steal sensitive data from the web application s users [41]. To decrease the number of vulnerabilities in a web application, testing can be done to try to detect, and then fix, the vulnerabilities before the vulnerabilities are exploited. For the tester to be able to detect vulnerabilities in web applications, the testers have to know what to look for in the web applications. Therefore, the testers have to be trained in different methods that can be used to find vulnerabilities in web applications. A common method is penetration testing. Penetration testing of web applications is done by trying to attack a web application and finding the vulnerabilities in it. One way to train penetration testers is to present a web application to the tester, and inform the tester to find, and exploit, the vulnerabilities in the web application [38]. It is important that the web applications which are used for training is somewhat realistic in terms of functionality and structure, so the vulnerabilities in it are hidden in realistic places. The web applications also have to vary in terms of which vulnerabilities the web applications contain, and how the vulnerabilities can be exploited. Because if the same web application is used twice, the penetration testers who have trained on that web application before already know how to exploit the vulnerabilities in it. Therefore, the 1
10 1.2. GOALS CHAPTER 1. INTRODUCTION training will not contribute anything new to those penetration testers. For this reason, there needs to be a large repository of different web applications, and variations of the web applications, that contain different kinds of vulnerabilities. Constructing and maintaining the web applications and their variations manually would be expensive and time consuming. There exist tools which try to solve this problem by trying to inject vulnerabilities into existing code. Some of those tools will be discussed in section 4.2. Those tools either require a lot of preparation work or are not able to automatically inject variations of the same type of vulnerability. Penetration testing can also be done automatically by using web application vulnerability scanners. Using web application vulnerability scanners is a fast way to find vulnerabilities and can be used in conjunction with manual penetration testing. Penetration testers often use such tools. More about web application vulnerability scanners can be read in Chapter 3. To know which kinds of vulnerabilities a human penetration tester needs to focus on during a penetration test, it is useful to know which kinds of vulnerabilities a web application vulnerability scanner cannot detect. In Chapter 3, a discussion will be made about which kinds of vulnerabilities are difficult for a web application vulnerability scanner to detect automatically. 1.2 Goals The goal of this thesis is to create a tool that can inject variations of vulnerabilities in an existing web application. The tool shall be able to inject vulnerabilities which cannot be detected by free current web application vulnerability scanners. This is to ensure that vulnerabilities which need human attention are introduced in the web applications. 1.3 Constraints Amongst all possible web application vulnerabilities, only Cross Site Scripting (XSS) and Cross Site Request Forgery (CSRF) will be addressed in this thesis. The tool will support injecting vulnerabilities in PHP source files. No other languages will be supported. 1.4 Outline Chapter 2 explains the web application vulnerabilities that are relevant to this thesis. The next chapter, Chapter 3, explains web application vulnerability scanners. Chapter 4 discusses some previous works which has been conducted in the same area as this thesis. The next chapter, Chapter 2
11 1.4. OUTLINE CHAPTER 1. INTRODUCTION 5, explains how the tool was designed and how problems were solved. In Chapter 6, the tool is evaluated and it is discussed how the tool can be further developed. Lastly, Chapter 7 contains conclusions drawn from this thesis. 3
12 Chapter 2 Web Application Attacks A web application is an application which runs in a web browser. Usually the source of the web application is hosted on a web server and a web browser makes a request to that web server. The web server responds to the request with a web page. The web page which is sent back is written in browser supported languages, such as HTML, CSS and JavaScript. However, the server could have produced the web page using several other server-side languages. The most common server-side language is PHP, which according to W 3 Techs is used by over 80% of all the websites that W 3 Techs has analyzed [40]. For users to be able to communicate with a web application, the web application can receive user input in multiple ways. The most common ways user input is supplied to a web application is in the URL query string (GET parameters), by POST parameters or in cookies [43][18]. A special case of supplying data to a web application is by sending files [31]. The user-supplied data is often used in the web application to create a dynamic web page that is displayed to the user. For example, on a search engine, the user can supply a search query. The search engine will display the search query along with web pages which are related to that search query. Web applications can contain vulnerabilities and this chapter will describe different types of vulnerabilities and how the vulnerabilities can be exploited. Section 2.1 is about XSS vulnerabilities, and section 2.2 is about CSRF vulnerabilities. 2.1 Cross Site Scripting (XSS) attacks If a web application contains XSS vulnerabilities, an attacker can inject malicious data onto a web page. The malicious injected data can contain JavaScript which is executed when someone visits the exploited web page. That means an attacker can execute arbitrary JavaScript in a victim s web browser if the attacker manages to trick the victim into visiting the exploited 4
13 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS web page. The malicious JavaScript will have the same privileges as any JavaScript supplied by the web application. In other words, the JavaScript will have access to all the data associated with the domain of the vulnerable web application, such as cookies and information in the web application. The result of a successful attack can result in an attacker stealing sensitive data, hijacking a user s session or manipulating the content on the web page [33]. Symantec found in 2012 that XSS was the most common potentially exploitable vulnerability found on websites [19], and CWE/SANS ranks XSS vulnerabilities 4th in their Top 25 Most Dangerous Software Errors [1]. The problem with XSS vulnerabilities is that the web application accepts user-supplied input which later is used as output on a web page without having properly sanitized the user-supplied input. When sanitizing the input, the web application establishes that the input can be safely used as output. This can be done by either checking that the input only contains acceptable values, or manipulating the input. The input can be manipulated in such a way that even if the input contains malicious JavaScript, the JavaScript will not be executed. For example, the input can be encoded, so that when the encoded input is outputted on the web page the browser will treat the output as text, even if the input previously contained HTML tags which would alter the structure of the web page. An example of such an encoding is encoding the special characters in the user s input to HTML entities [24]. Consider the following input: <script>alert( XSS )</script> the input will, when encoded with the PHP function htmlspecialchars and the flag ENT QUOTES, become [16]: <script>alert('xss')</script> The encoded representation of the input is safe to use as output in the web application, because the browser would not treat the output as a script tag, but rather as text that will be displayed. Other ways user input can be sanitized is by using a Blacklist or a Whitelist filter [24]. XSS comes in four different flavors: Reflected, Stored, DOM and Mutation-based [33][15]. The different flavors are described in sections below. It should be noted that some of the examples in this chapter does not work in modern browsers, because of protections such as Reflective XSS Protection, and better client side sanitation [5]. However, the web applications are still susceptible to the XSS attacks depending on which web browser the victim is using Reflected A web application which is susceptible to a reflected XSS attack will use the user-supplied input as output in the web page that is sent as response, without first properly sanitizing the user input [33]. In Figure 2.1, the steps in a reflected XSS attack are shown. The victim supplies input to the web application when requesting a web page. The web application includes the 5
14 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS Figure 2.1: Steps in a reflected XSS attack user-supplied input in the response that is sent back to the victim. One way an attacker can perform a reflected XSS attack on a web page that have an XSS vulnerability and accepts data in a GET parameter is to craft a URL containing the malicious data. Inside the URL, the attacker can attach the malicious data containing a JavaScript in the GET parameter, and then trick a victim into visiting the crafted URL. When the victim visits the URL, and requests the vulnerable web page with the data the attacker included in the URL, the web application will respond with a web page that includes the malicious data, and the malicious JavaScript in the data will execute. In Listing 2.1.1, a page vulnerable to a reflected XSS attack is shown. The value of the GET parameter username is outputted on the page without any sanitation. If an attacker were to construct the URL: and then trick a victim to follow the URL, the value of username (<script>alert( XSS )</script>) would be supplied to the web application. The web application would respond with a web page including the value of username, and the victim s browser would run the JavaScript in the script-tag. The JavaScript function alert would run and display an alert dialog to the victim saying XSS. Because the JavaScript is outputted on the page, the browser thinks that this JavaScript was sent intentionally by the web application and therefore, the web browser will execute the JavaScript. 6
15 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS An attacker could execute arbitrary JavaScript instead of displaying an alert dialog. if (isset($_get["username"])) { echo "Welcome ", $_GET["username"]; } else { echo "<form>"; echo "<input name= username >"; echo "<input type= submit >"; echo "</form>"; } Listing 2.1.1: Example of a page vulnerable to a reflected XSS attack Stored If a web application is susceptible to a stored XSS attack, an attacker can store malicious data which will be used later as output in the web application. The data can be stored anywhere in the application, for example, in a database. The web application contains a page where the stored data is used as output. The stored data is not sanitized before it is stored to the database, nor before it is used as output on a page. When a user requests the page that uses the stored data as output, the data will be retrieved from its stored location and outputted in the response [33]. In Figure 2.2, a stored XSS attack is shown. The attacker supplies data to the web application, and the web application stores the data in a database. When the victim visits the page, the data is retrieved from the database and outputted on the web page that is sent as response. To understand the possible implications of such a vulnerability think of an online forum. On a forum users can register and choose a user name. The registered user name is saved to the database. The forum will have a page where all the registered users, with their user name, are shown. An example of such a page is shown in Listing If the user name supplied when registering is not properly sanitized before it is stored in the database, an attacker can choose a user name which will result in JavaScript being executed when it is outputted on the page. For example, the attacker could choose the user name <script>alert( XSS )</script>. When the attacker s user name is later retrieved from the database and outputted on a page, without proper sanitation, the JavaScript will be executed and display an alert dialog to the user that is visiting the page. An attacker could execute arbitrary JavaScript instead of displaying an alert dialog. 7
16 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS Figure 2.2: Steps in a stored XSS attack $users = [users from database]; echo "All users: "; foreach ($users as $user) { echo $user["username"], ","; } Listing 2.1.2: Example of a page vulnerable to a stored XSS attack Document Object Model (DOM) DOM based XSS attacks are similar to reflected XSS attacks. The difference is that no data is sent to the web server, everything is happening in the client s web browser. This means the web application cannot sanitize the data server-side. Instead, it has to be done on the client-side of the web application [33]. In Figure 2.3, a DOM based XSS attack is shown, and as seen in the figure, the data never leaves the victim s browser. In Listing 2.1.3, the GET parameter username is outputted on the page using JavaScript in the client s web browser. If an attacker constructs the same URL as in the example for the reflected XSS attack in section 2.1.1, and then trick a victim to follow the URL, the JavaScript on the page would output <script>alert( XSS )</script> without sanitation. The JavaScript would execute and display an alert dialog to the victim. An 8
17 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS Figure 2.3: Steps in a DOM XSS attack 9
18 2.1. CROSS SITE SCRIPTING CHAPTER (XSS) 2. ATTACKS WEB APPLICATION ATTACKS attacker could execute arbitrary JavaScript instead of displaying an alert dialog. <html><head></head> <body> <script type="text/javascript"> var usernamepos = window.location.search.indexof("username="); if (usernamepos >= 0) { var username = window.location.search.substr(usernamepos + 9); document.write(username); } </script> </body> </html> Listing 2.1.3: Example of a page vulnerable to DOM XSS Mutation-based Mutation-based XSS (mxss) is an attack which is based on the fact that web browsers automatically tries to fix invalid HTML. The web browser does this by mutating the invalid HTML into valid HTML. Therefore, HTML which seems harmless can mutate into something that executes JavaScript. Because the HTML seems harmless at first, the HTML can bypass many types of sanitation in the web browser and on the server [15]. One thing that triggers the mutation is when using the JavaScript property innerhtml to insert new content on a page. In Figure 2.4, the steps in an mxss attack are shown. The attacker manages to store seemingly harmless data containing JavaScript in the web application. When the victim visits the web application the seemingly harmless data is outputted to the victim. However, when the victim s client uses the data as discussed, the victim s web browser mutates the data and executes the JavaScript that the attacker included in the stored data. An example of how a web browser (in this case Internet Explorer 8) mutates invalid HTML, is if the input is: <s class="">hello <b>world</b> Because the HTML is invalid, the browser will mutate the HTML into valid HTML. The result of the mutation is: <S>hello <B>world</B> </S> The browser has removed the empty class attribute, all the tag names has been converted to upper case, has been replaced with a whitespace and the <s> tag has been closed. This mutation did not result in any executed JavaScript, but in Listing 2.1.4, a page susceptible to an mxss attack 10
19 2.2. CROSS SITE REQUEST CHAPTER FORGERY 2. WEB (CSRF) APPLICATION ATTACKS ATTACKS Figure 2.4: Steps in a Mutation-based XSS attack is presented. If an attacker provided the data onload=alert( XSS ) in the alt input field, when the button is pressed the variable img would contain: <img src="test.jpg" alt=" onload=alert( XSS )"> The data seems harmless because the JavaScript is contained in the alt attribute, and will thus not be executed. However, when the browser uses the JavaScript property innerhtml to insert the content into the message div, then the HTML will mutate into: <IMG alt="" src=" onload=alert( XSS )> The web browser will execute the JavaScript and display an alert dialog. An attacker could execute arbitrary JavaScript instead of displaying an alert dialog. 2.2 Cross Site Request Forgery (CSRF) attacks A CSRF attack involves three parties, a victim, a trusted website were the victim is currently authenticated and an attacker [34]. In Figure 2.5, an example of a CSRF attack is shown. The victim is currently authenticated on the trusted website, and visits a web page controlled by the attacker. When visiting the attacker controlled web page, the web page tells the victim s web browser to send a request to the trusted web ap- 11
20 2.2. CROSS SITE REQUEST CHAPTER FORGERY 2. WEB (CSRF) APPLICATION ATTACKS ATTACKS <script> function post () { messageelement = document.getelementbyid("message"); imageelement = document.getelementbyid("image"); var alt = document.getelementbyid("inalt").value; var message = document.getelementbyid("inmessage").value; var img = <img src="test.jpg" alt=" + alt + "> ; imageelement.innerhtml = img; messageelement.innerhtml = message; messageelement.innerhtml += imageelement.innerhtml; } </script> <div id="image"></div> <div id="message"></div> message: <input id="inmessage"></input><br> alt: <input id="inalt"></input><br> <button onclick="post()">post</button> Listing 2.1.4: Example of a page vulnerable to Mutation-based XSS plication. A web page can tell the web browser to send a request to another web application, for example, by inserting the following img-tag: <img src=" The victim s web browser will try to fetch the image, i.e. it will send a request to the URL of the image. Because the image is located at the trusted web application s domain, the victim s web browser will include all the information the web browser has associated with that domain. This includes the cookies which the web application uses to keep the victim authenticated. Therefore, when the trusted web application receives the request from the victim, the session will be authenticated. To the trusted web application, the request will look like a normal request from the victim s web browser. In this example, the page which is requested on the trusted web application is changing the victim s password (Listing has a copy of the source code for the page). After the victim has made the request to the trusted web application, the victim s password will have changed to pwned. The problem with CSRF vulnerabilities is that the trusted web application lacks a way to validate that the victim intentionally sent the request. If such validation is missing, an attacker can trick a victim to make an unintentional request to the trusted web application. Because the attacker can make the victim send a request to the trusted web application, a request to make an authenticated action on the victim s behalf can be made [9]. CSRF 12
21 2.2. CROSS SITE REQUEST CHAPTER FORGERY 2. WEB (CSRF) APPLICATION ATTACKS ATTACKS Figure 2.5: Steps in a CSRF attack if (isset($_session["userid"])) { $currentuser = $_SESSION["USERID"]; $newpassword = $_GET["newPassword"]; update_user_password($currentuser, $newpassword); echo "Password updated"; } Listing 2.2.1: Page vulnerable to CSRF is ranked 12th in CWE/SANS Top 25 Most Dangerous Software Errors [1]. A common recommended method that is used to protect against CSRF attacks, is to use a CSRFtoken [8][7][34]. This method is divided into three steps: Generate A token which is hard to guess is generated in the web application on the server. The token is then saved somewhere where the web application can later retrieve it, for example in the client s cookies. Include The token is sent to the client s web browser, so that the token will be provided when performing the authenticated action. For example, as a field in a form that will be submitted to perform the authenticated action. Guard When a request to perform an authenticated action is received, the web application will validate the token the client provided, i.e. it shall 13
22 2.2. CROSS SITE REQUEST CHAPTER FORGERY 2. WEB (CSRF) APPLICATION ATTACKS ATTACKS be the same as the token the server previously generated. If the tokens do not match, the authenticated action will not be performed. 14
23 Chapter 3 Web Application Vulnerability Scanners A web application vulnerability scanner is a piece of software that is used to automatically scan web applications for vulnerabilities. The web application vulnerability scanner can only send requests and examine the responses from the web applications but it has no knowledge about the source code of the web applications [12]. In other words, the web application vulnerability scanner can only interact with the web application in the same way as an attacker can. Generally speaking, web application vulnerability scanners can be seen as containing three modules: a crawler, an attacker and an analysis module [12]. When initiating a scan, a number of URLs are given to the web application vulnerability scanner. The crawler module will visit the URLs and gather all the URLs on those web pages. Then the crawler module will visit the newly gathered URLs to find even more URLs. This will continue until the crawler module has gathered as many accessible web pages as possible. All input points to the web application (for example form fields and GET parameters) are also gathered while crawling the web application. When the crawler module is finished, it will pass on all the data it has collected (accessible web pages and input points) to the attack module. The attack module constructs attack vectors based on the data from the crawler module. The attack vectors contain input values which are likely to expose a vulnerability in the web application. Based on the attack vectors, the attack module will send requests to the web application. All the responses that are received from the web application are provided to the analysis module. For each response, the analysis module tries to determine if the response contains any traces which indicate the presence of a vulnerability. If the web application vulnerability scanner finds an attack vector which generated a response that indicated the presence of a vulnerability, the web application vulnerability scanner will mark the attacked web page as vulnerable and report which attack vector triggered the vulnerability. 15
24 3.1. CHAPTER DETECTION 3. WEB DIFFICULTIES APPLICATION VULNERABILITY SCANNERS There exist many different web application vulnerability scanners with various features. OWASP and The Web Application Security Consortium both have a list of web application vulnerability scanners [27][37]. From both lists, the free web application vulnerability scanners which could be downloaded at the time of visiting the list were selected. In Table 3.1, the selected application vulnerability scanners are listed, with information regarding whether they support reporting XSS and CSRF vulnerabilities. All of the selected web application vulnerability scanners can be used at no cost without any limitations. Name Platforms Last updated XSS CSRF andiparos OS X, Linux, Windows Yes No Grabber Python Not Found Yes No OWASP Zed Attack Proxy Windows, Linux, OS X Yes No Paros Windows Yes No Powerfuzzer Python Yes No Skipfish Linux, OS X, Windows Yes No w3af Python Yes Yes Wapiti Python Yes No Table 3.1: A collection of free web application vulnerability scanners 3.1 Detection difficulties In a test conducted by Bau et al., web application vulnerability scanners performed poorly when the malicious data was first stored in the web application, and then used as output on another page that would trigger the vulnerability [6]. The response from the first request would thus not include anything that would indicate the presence of a vulnerability, because the result of the attack would trigger on another web page in the web application. The same result can also be seen in a test conducted by Doupé et al. [12]. An example of an attack which first stores the malicious data is the stored XSS attack that was discussed in Section It is hard for web application vulnerability scanners to detect CSRF vulnerabilities without reporting many false positives (when a vulnerability that cannot be exploited is reported). That is because it is impossible for a web application vulnerability scanner to know which requests need to be protected against CSRF attacks [4]. One way a web application vulnerability scanner could try to detect CSRF vulnerabilities, is to record every request, and when the scan is complete, the web application vulnerability scanner could try to replay every request and report if any of the requests were successful. If a request could be successfully replayed, the scanner could report the web page as possibly containing a CSRF vulnerability. This would, as mentioned previously, result in many false positives, because many of the web pages in a web application do not need to be protected against 16
25 3.1. CHAPTER DETECTION 3. WEB DIFFICULTIES APPLICATION VULNERABILITY SCANNERS CSRF attacks. 17
26 Chapter 4 Previous Work A number of web applications are created to be deliberately vulnerable and used when training and testing web vulnerability scanners. Some of the vulnerable web applications are generated using different tools and others are manually developed. 4.1 Manually Developed Vulnerable Web Applications There exist web applications that are designed to be vulnerable and to be used when testing web application vulnerability scanners. For example, some companies that offer web application vulnerability scanners also provide a vulnerable web application which can be used to test their web application vulnerability scanner. Examples of such web applications are Altoro Mutual [3], Zero Bank [46] and Acuart [2]. Those vulnerable web applications are useful for testing if a web application vulnerability scanner can detect certain kinds of vulnerabilities. Penetration testing personnel can train by using the vulnerable web applications. However, the vulnerable web application can only be used once for training. As mentioned in Chapter 1.1, if a penetration tester has trained on the web application before then the penetration tester already knows how to exploit all the vulnerabilities and will not learn anything new. 4.2 Generating Vulnerable Web Applications OWASP 1 had a project called SiteGenerator, which allowed the creation of dynamic web applications based on XML files and predefined vulnerabilities [26]. One of the main purposes for the tool was to test and benchmark 1 The Open Web Application Security Project 18
27 4.2. GENERATING VULNERABLE WEB CHAPTER APPLICATIONS 4. PREVIOUS WORK <?xml version="1.0" encoding="utf-8"?> <SiteGenerator name="sitegenerator Demo" xmlns:ipo=" xmlns=" xmlns:xsi=" <site> <folder name=""> <file mappedto="aspx/default.aspx" name="helloworld.aspx" /> <folder name="aspx"> <file mappedto="aspx/pages.htm" name="pages.htm" /> <file mappedto="aspx/xss.aspx" name="xss.aspx" /> <file mappedto="aspx/sqlinjection_easy.aspx" name="sqlinjection.aspx" /> <file mappedto="aspx/sqlinjection_hard.aspx" name="sqlinjection2.aspx" /> </folder> </folder> </site> </SiteGenerator> Listing 4.2.1: Example of Site Generator configuration file web application vulnerability scanners. The tool consists of two main components: a web server and a GUI application. With an XML file, virtual names are mapped onto files on disk to create the web application. In Listing 4.2.1, an example of a Site Generator XML file is shown. The GUI application loads the XML file and then listens to requests from the web server. When the web server receives a request for the page HelloWorld.aspx from a client, the server asks the GUI application which page to serve. The GUI application responds with the file aspx/default.aspx to the web server, which serves the file back to the client. To create a new vulnerability, a new web page has to be created that contain the vulnerability. Then, when creating a dynamic web application, the vulnerable web page could be mapped, using the XML file, to be included in the new web application. The web application will then contain the vulnerability which was included in the web page. This means that for every variant of a vulnerability, a new web page has to be created and added to a web application. Because the vulnerabilities are created manually, it is certain that the web application will be vulnerable when the vulnerability is added. The vulnerabilities which are created can easily be included in any number of web applications. It does, however, require a great deal of work to create all the different variants of the vulnerabilities. The tool makes it easy to create many web applications which consist of different combinations of the same vulnerable web pages. Experts can manually inject vulnerabilities 19
28 4.3. AUTOMATICALLY GENERATING VULNERABLE WEB APPLICATIONS CHAPTER 4. PREVIOUS WORK in web applications but, as stated in the introduction, that would be tedious and it would take a long time to inject many different vulnerabilities. The main benefit of experts manually injecting vulnerabilities is that the expert can create complex vulnerabilities which are dependent on several parts of the web application. In this way, hard and meaningful vulnerabilities can be created. 4.3 Automatically Generating Vulnerable Web Applications Fonesca et al. proposed a methodology to inject realistic vulnerabilities into existing web applications in [13] and [38]. Based on the methodology, Fonesca et al. implemented a tool which can inject SQL Injection Vulnerabilities into existing web applications. An attacker can execute malicious SQL commands on the database by exploiting a SQL injection vulnerability. This can give the attacker the ability to read, write, delete, insert and execute arbitrary SQL commands on the database [30]. The tool uses Vulnerability Operators that consist of a Location Pattern and a Vulnerability Code Change. The Location Pattern defines the conditions to which a specific vulnerability type must abide. The Vulnerability Code Change specifies how the vulnerability is injected depending on where the vulnerability will be injected [13]. An example of a Vulnerability Operator is the Location Pattern which searches for the PHP function-call intval, and where the argument to the function is user input. An example of a code that will match the previously mentioned Location Pattern is: $id = intval($_get["id"]); If an SQL query is constructed with the variable $id the Vulnerability Code Change consists of removing the intval function-call. After the Vulnerability Code Change is applied, the resulting code will be: $id = $_GET["id"]; which is vulnerable to an SQL injection attack. When injecting vulnerabilities, a file is provided as input to the tool. The tool recursively searches for files that are included from the input file. All the included files are concatenated with the input file to create a single file that will be analyzed. The tool searches for all the variables in the file and creates a mesh of how the variables are related to each other based on the names of the variables. Then the tool searches for all the variables which are used to construct a SQL query, and using the previously created mesh, the tool can determine if a variable directly or indirectly influences a SQL query. The last part of the injection stage is to iterate each found variable location and test if any of the Vulnerability Operators are applicable on the location. If an applicable location is found, the Vulnerability Code Change is used to inject a vulnerability at that location. The copy of the file with the injected vulnerability is stored and then the tool enumerates the next 20
29 4.3. AUTOMATICALLY GENERATING VULNERABLE WEB APPLICATIONS CHAPTER 4. PREVIOUS WORK location. When the enumeration is finished, the tool has created a number of files with one possible vulnerability in each. $id = intval($_get["id"]); $query = sprintf("select * FROM users WHERE id = %d", $id); Listing 4.3.1: The variable $id is sanitized multiple times Fonesca et al. identified two situations where the tool failed to inject a vulnerability: The first situation is when the same variable name is used both in a SQL query (where it can be used to inject a vulnerability), and in another part of the file where no vulnerability can be injected. When the tool tried to inject vulnerabilities in the second location it did not result in a vulnerability. The other situation is when a variable is sanitized multiple times. Because the tool only tries to inject a vulnerability in one location per iteration, it might leave the variable unprotected at the first location. However, before the variable is used in the SQL query the variable is sanitized, and therefore the variable can not be exploited. An example of such an occurrence is in Listing The tool will remove the intval function, but when the value is inserted in the SQL query with sprintf using the %d format, sprintf will treat the argument as an integer and therefore sanitizes the variable again [35]. The tool also consists of an attack injection part that can test if a vulnerability was injected into the file. If the tool manages to attack the generated file, the tool knows with certainty that the vulnerability was successfully injected. 21
30 Chapter 5 Design and implementation As stated in the introduction, the aim of this thesis project was to generate web applications which contain vulnerabilities. The generated web application s purpose is to be used when training penetration testers and evaluating web application vulnerability scanners. A tool shall be designed and implemented to generate these web applications. More specifically, the tool shall be able to: Inject XSS and CSRF vulnerabilities in PHP code. Be automated as much as possible. Inject vulnerabilities that span over more than one file. Automatically inject variations of the same vulnerability. Inject vulnerabilities that are hard for web vulnerability scanners to detect. Be certain that every injected vulnerability is exploitable. Phulner was created to do that. Section 5.1 describes how Phulner is supposed to be used. Section 5.2 describes the vulnerability categories and dimensions which Phulner can and cannot handle. Sections 5.3 and 5.4 describe the internal workings of Phulner when it handles XSS and CSRF vulnerabilities. 5.1 Phulner This section will describe Phulner: the tool developed to meet the requirements listed above. Phulner consists of two phases: preparing a project and 22
31 5.1. PHULNER CHAPTER 5. DESIGN AND IMPLEMENTATION Figure 5.1: Workflow when preparing a project injecting vulnerabilities in a project. Sections and describe how Phulner works and how to use Phulner during the different phases Preparing a project Before Phulner can inject vulnerabilities in a project, the source code must first be prepared. This is because it is hard, on a whole project, to do a static analysis to identify how data flows in and out from the web application. It is particularly hard to statically find the data flow if the input and output are located in different files, and the data might be stored in a database in between input and output. The preparation work limits the amount of source code Phulner has to analyze to inject a vulnerability. The intended workflow in the preparation of a project can be seen in Figure 5.1. The web application has to first be manually analyzed and prepared. When a location where a vulnerability can be injected is found, keywords have to be placed in the code to tell Phulner to analyze that part of the source code. An example of source code that is prepared to be analyzed by Phulner can be seen in Listing Between the two keywords /*Phulner and */ on their own lines, a JSON configuration object is found. Then, everything until the last keyword, /*/Phulner*/, is the code block that Phulner will analyze. The configuration object includes an identifier, which connects the code block to a specific vulnerability. Every code block with the same identifier is analyzed when the vulnerability identified by the identifier is injected. The configuration object also contains the dimensions (details in section 5.2) in which this part of the vulnerability can vary. Depending on the type of the vulnerability, the object might contain more attributes. When the source code has been prepared, a configuration file for the whole project has to be created. An example of such a file can be seen in Listing The file contains a JSON object containing the project s name, the relative directory where the web application s source files are placed and a list of all the possible vulnerabilities that can be injected, identified by the identifier. Each vulnerability has a type, a description, a list of files and options. The options object contains different keys depending on the type of the vulnerability. In sections 5.3 and 5.4 the options object for XSS and CSRF vulnerabilities will be discussed. By first preparing the project, one of the problems Fonesca et al. had 23
32 5.1. PHULNER CHAPTER 5. DESIGN AND IMPLEMENTATION in their tool where the same variable name was used in different locations is avoided (discussed in section 4.3). By limiting the code that Phulner analyzes to parts which are relevant to the vulnerability, the developer can thus be certain that Phulner will inject a vulnerability. { "name": "Phulner testproject", "basedir": "files/", "vulnerabilities": { "xss_echoid": { "description": "Echoes the user supplied id", "type": "xss", "options": { "input": ["GET"], "sanitation": ["NONE", "BLACKLIST"], "output": ["NORMAL_TAG"], "mutated": [false] }, "files": [ "welcome.php" ], "sanitationfunctions": [] }, } } "csrf_changepassword": { "description": "Protects the change password action", "type": "csrf", "options": { "types": ["NONE", "ONLY_POST", "COMPUTABLE"] }, "files": [ "changepassword.php" ] } Listing 5.1.1: An example project configuration for a Phulner project Generating a vulnerable web application The intended workflow to generate a vulnerable web application from a prepared project is shown in Figure 5.2. First, an instance configuration file has to be created (an example of such a configuration file is shown in Listing 24
33 5.2. CATEGORIZATION CHAPTER 5. DESIGN AND IMPLEMENTATION Figure 5.2: Workflow when injecting vulnerabilities 5.1.2). The instance configuration file contains a JSON object specifying from which project Phulner shall generate the vulnerable web application, which vulnerabilities that are to be injected, and in which categories the injected vulnerabilities shall be. When running Phulner, the instance configuration file is provided as input. Phulner will load the specified project and inject the specified vulnerabilities according to the instance configuration file (details on how Phulner injects different vulnerabilities will be discussed in sections 5.3 and 5.4). The newly generated vulnerable web application will be saved at the specified out-path in the instance configuration. By altering the parameters for the vulnerabilities in the instance configuration file, the same web application, but with other vulnerabilities, can be generated again by running Phulner with the new instance configuration file. { } "project": "/path/to/phulner/project/", "out": "/destination/of/vulnerable/web/application/", "vulnerabilities": { "xss_echoid": { "inject": true, "sanitation": "NONE" }, "csrf_changepassword": { "inject": true, "type": "NONE" } Listing 5.1.2: An example instance configuration for a Phulner project 5.2 Categorization The selected vulnerabilities were divided into different categories in order to distinguish between different variations of the same vulnerability. The categories are also used when detecting which types of vulnerabilities a web application vulnerability scanner can detect. The categories were created based on the characteristics of the vulnerability. 25
34 5.2. CATEGORIZATION CHAPTER 5. DESIGN AND IMPLEMENTATION GET BLACK LIST POST WHITE LIST COOKIE Figure 5.3: The four dimensions of an XSS vulnerability XSS When an attacker tries to find an XSS vulnerability, the attacker first tries to detect the way input can be provided to the web application. The next step is to investigate which of the inputs can be used in an attack against the web application. This is done by providing different input and analyzing the response from the server [36]. Based on how an attacker works when trying to detect an XSS vulnerability, we hypothesize that an XSS vulnerability has certain characteristics. The vulnerability starts with something being Inputted to the web application. The input might be partly Sanitized. Then something is Outputted to the browser and the browser might Mutate the output. In Figure 5.3 the characteristics are shown. From these characteristics, we divided an XSS vulnerability into four dimensions. Input The first thing an attacker has to find out is how to feed input to the application. The input can be supplied in several ways and the input Phulner can handle is categorized in the following way: GET The input is in a GET parameter. POST The input is in a POST parameter. Cookies The input is in a cookie. Header The input is in a header field. Stored The input is coming from something that was previously stored in the web application. For example, from a database. 26
35 5.2. CATEGORIZATION CHAPTER 5. DESIGN AND IMPLEMENTATION Sanitations When the ways in which the web application accepts inputs are detected, then the next thing is to detect if the input is sanitized before it is used in the application. Sanitation is used to remove harmful parts from the input and validate the input. None The content is not checked or sanitized in any way. Blacklist A set of characters and sequences are blacklisted and removed from the content. Whitelist A whitelist is the opposite of the Blacklist. Only certain characters and sequences are permitted, and anything else is removed from the content. Encoding A popular method to decrease the risk of attacks when displaying user input is to encode or convert it. If insufficient encoding is applied or not enough is converted, harmful data can still be executed. Output Depending on where the content is outputted on the page, the amount of malicious content the attacker has to provide varies [45]. For example, if an attacker were able to inject content into a Script tag the content would be executed as JavaScript. In a Normal tag, however, the data would not execute as JavaScript. The attacker will have to inject something that makes the client execute the data as JavaScript. The second code snippet in the following examples shows what an attacker could send to be able to run JavaScript in each category. The following list shows the output locations that Phulner can handle. Script tag <script>here</script> The data will be executed as JavaScript. alert("xss") HTML Comment <!-- HERE --> By ending the comment an attacker can insert a script tag. --><script>alert("xss")</script><!-- Attribute name 27
36 5.2. CATEGORIZATION CHAPTER 5. DESIGN AND IMPLEMENTATION <img HERE=x> Inserting a space would allow the attacker to use any attribute. onload="alert( XSS )" src Tag name <HERE > The attacker can decide which tag will be used. If the attacker also can decide the content of the tag, the attacker could then specify a script tag and anything in the tag would be run. If not, the attacker can add any attribute to the tag. img onload="alert( XSS )" src="x" Style tag <style>here</style> In some browsers JavaScript URLs are executed. body { background:url("javascript:alert( XSS )") } Normal tag <div>here</div> An attacker can insert a script tag. The content in the script tag is treated as JavaScript, and therefore executed. <script>alert("xss")</script> URL attribute - unquoted <a href=here> If the attacker inserted a JavaScript URL and the user clicked the link, the JavaScript will be executed. javascript:alert( XSS )" URL attribute - single quotes <a href= HERE > If the attacker inserted a JavaScript URL and the user clicked the link, the JavaScript will be executed. javascript:alert("xss") URL attribute - double quotes <a href="here"> If the attacker inserted a JavaScript URL and the user clicked the link, the JavaScript will be executed. javascript:alert( XSS ) Non JavaScript attribute - unquoted 28
37 5.2. CATEGORIZATION CHAPTER 5. DESIGN AND IMPLEMENTATION <input value=here> A space would allow the attacker to insert any attribute. x onclick="alert( XSS )" Non JavaScript attribute - single quotes <input value= HERE > A single quote would allow the attacker to insert any attribute. x onclick= alert("xss") Non JavaScript attribute - double quotes <input value="here"> A double quote would allow the attacker to insert any attribute. x" onclick="alert( XSS ) JavaScript attribute - unquoted <button onclick=here> The data will be executed as JavaScript. alert("xss") JavaScript attribute - single quoted <button onclick= HERE > The data will be executed as JavaScript. alert("xss") JavaScript attribute - double quoted <button onclick="here"> The data will be executed as JavaScript. alert( XSS ) JavaScript manipulation The content is inserted into the DOM-tree with JavaScript. Other location Location not in this list. Mutated If the content is inserted into the page using, for example, the innerhtml property, the content might be mutated as discussed in Yes The data is used in a way so that certain clients will mutate the content. No The data is not used in any way so that any client mutates the content. 29
38 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION CSRF The categories for CSRF vulnerabilities are based on common mitigation techniques that may not be sufficient to stop a CSRF attack [8]. None The server does not perform any checks to ensure that the request was intentionally sent before performing the authenticated action. Only POST requests If the server only accepts POST requests to perform the authenticated actions. This will stop attacks which require the victim to click on a link (because that will generate a GET request to the trusted server). Multiple step If the authenticated action requires more than one request to be performed. An attacker will have to execute a number of requests in a specific order to successfully execute the attack. Referer header If the only check the server performs is to check the referer header before performing the authenticated action. In the referer header the browser can specify from which URI the request originated [17]. The server can block all requests that do not originate from a trusted URI. Computable token As discussed in 2.2, a common way to protect against CSRF attacks is to use a generated token. If the supplied token is not random enough, an attacker can compute the token. 5.3 XSS Injection $foo = intval( bar ); Listing 5.3.1: Code producing the Abstract Syntax Tree in Figure 5.4 The tool built by Fonesca et al. (discussed in section 4.3) contained functionality to parse the source code and find specific patterns in the source code. Phulner uses an abstract syntax tree to represent the source code. By using an abstract syntax tree, Phulner can focus on understanding the logic in the code instead of the grammar. The abstract 30
39 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION var = expression variable intval name=foo arguments string value=bar Figure 5.4: Abstract Syntax Tree produced from the code in listings 5.3.1, and $foo intval("bar" ); = Listing 5.3.2: Code producing the Abstract Syntax Tree in Figure 5.4 syntax tree represents the programming language constructs, such as statements, loops and expressions. Therefore, the abstract syntax tree captures the important structure of the source code without the syntactical details such as punctuation [25][21]. For example, the code in listings 5.3.1, and will produce the same abstract syntax tree seen in Figure 5.4. The grammar of the code varies between the examples but the logic in the code is the same. The abstract syntax tree also facilitates the analysis of the arguments to a function-call. For example, an XSS vulnerability in the output dimension category Non JavaScript attribute - single quotes. The variable that can be exploited is first passed to the PHP function-call htmlspecialchars as in the following code: $src = htmlspecialchars($userinput); echo "<img src= ", $src, " >"; Because by default, htmlspecialchars do not encode single quotes, ( ), this location can therefore be exploited. If an attacker provided the string: onload= alert("xss") then the outputted image tag from the server will be: <img src= onload= alert("xss") > which will display an alert dialog saying XSS to the user after the image has been loaded. To make htmlspecialchars encode sin- 31
40 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION ${ foo } /* a block comment here with the = symbol */ = // line comment intval # another type of comment (/* another block comment including an assignment foo = intval("bar") */ "bar"); Listing 5.3.3: Code producing the Abstract Syntax Tree in Figure 5.4 gle quotes, the constant ENT QUOTES has to be provided as the second argument [16]. If the variable was passed to htmlspecialchars with the constant ENT QUOTES as in the following code: $src = htmlspecialchars($userinput, ENT_QUOTES); echo "<img src= ", $src, " >"; and if the attacker provides the previous string ( onload= alert( XSS )), the attack will not be successful. That is because htmlspecialchars encodes the single quotes which means that the outputted image tag from the server will be: <img src= onload='alert("xss") > Because the single quotes are encoded, the attack can not break out from the src attribute and insert a new attribute that will execute JavaScript. When using an abstract syntax tree, all the information about the functioncall, such as the arguments, will be in the function-call s node. If the tool handled the parsing of the source code, more logic will have to be created to be sure that ENT QUOTES is passed as the second argument to htmlspecialchars. Another benefit when using an abstract syntax tree is that, when replacing nodes, it is not possible to break the syntax. A valid abstract syntax tree will always transform into syntactically correct code. To keep track of how user input is propagated through the web application, Phulner uses a method called Static Taint Analysis. Variables that depend on user input and are not sanitized are labeled as tainted. By using static taint analysis, Phulner can analyze when user input is sanitized in the web application. More details on how static taint analysis works can be found in Section To help Phulner understand how functions sanitize variables, a library of sanitation functions is included in Phulner. A sanitation function describes how a specific function works in the aspect of sanitizing its arguments. The sanitation function describes if taint from the arguments to the function is propagated to the return value from the function. When the vulnerability function is used, it is aware about the vulnerability which Phulner is currently trying to inject. Depending on the different options of the vulnerability, such as the output category of the vulnerability, the sanitation function can determine if taint will propagate. The sanitation function for the built-in PHP function htmlspecialchars would determine that the re- 32
41 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION turn value would be tainted if: the first argument is tainted; the constant ENT QUOTES is not used, and the output category is Non JavaScript attribute - single quotes. However, if the output category was Normal Tag then htmlspecialchars will not propagate the taint from the first argument. In order to be able to execute JavaScript in a normal tag, a new tag such as a script tag has to be added and that is not possible since htmlspecialchars encodes < and > by default. This encoding makes it impossible to create a new tag. The sanitation function also specifies how the function can be replaced to retain the taint from the arguments depending on the options of the vulnerability. How that works will be discussed below. /*Phulner { "identifier": "xss_echoid", "sanitation": ["NONE", "BLACKLIST"]; "initialscope": [ { "name": "userinput", "type": "variable", "taint": ["USER"] } ] } */ $id = intval($userinput); echo $id; /*/Phulner*/ Listing 5.3.4: Code prepared for injection of an XSS vulnerability. When injecting an XSS vulnerability, Phulner can vary the vulnerability in the Sanitation dimension. The preparations needed before an XSS vulnerability can be injected consist of: defining the input, output, and mutation category; specifying in which sanitation categories the vulnerability can vary, and specifying which variables are tainted in the beginning of the code block. In Listing 5.3.4, a source code that is prepared for injecting an XSS vulnerability is shown. The code block belongs to the vulnerability xss echoid, and can be varied in the sanitation dimension to be in the category NONE or BLACKLIST. The variable $userinput is tainted in the beginning of the code block. More information about the vulnerability is found in the project s configuration file (displayed in Listing 5.1.1). The project s configuration file specifies that the vulnerability identified by the identifier xss echoid is of the type XSS. The input is from a GET parameter and the output location will be in a normal tag. The data will not be mutated. When Phulner processes a code block belonging to an XSS vulnerability 33
42 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION var = expression variable name=id tainted=false tainted=false intval arguments variable tainted=false name=userinput tainted=true echo expression variable name=id tainted=false Figure 5.5: Abstract syntax tree for the code in Listing such as the code block in Listing 5.3.4, the code is parsed into an abstract syntax tree using a library called PHP Parser [29]. The resulting abstract syntax tree can be seen in Figure 5.5. An initial variable scope for the code block is constructed from the configuration object. The purpose of the scope is to keep track of which variables contain traces of user input (taint). The abstract syntax tree is then traversed: each node is processed three times. The first processing updates the scope when it encounters a node which changes the scope. If a variable is assigned with something that is tainted without first being sanitized, the taint will propagate to the new variable. The next processing assigns a taint attribute to each node. A node s taint depends on the type of node which is encountered. For example, if a variable node is encountered, the taint is taken from the current scope. If a functioncall node is encountered, Phulner uses the function s sanitation function to determine if taint propagates from the arguments to the return value of the function. The last processing replaces the nodes that remove taint, which could, for example, be a function-call node. Phulner knows if a function-call removes taint by using the function s sanitation function, and checking if the arguments to the function are tainted but the return value is not tainted. Phulner can then replace that function so that the taint is retained and a vulnerability has been injected, because user input which has not been sanitized is outputted on the page. If Phulner was run with the instance configuration file in Listing 5.1.2, it would inject an XSS vulnerability with the sanitation category None in the code showed in Listing First, Phulner will generate the abstract syntax 34
43 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION var = expression variable name=id tainted=true tainted=true variable name=userinput tainted=true echo expression variable name=id tainted=true Figure 5.6: Abstract syntax tree for the code in Listing $id = $userinput; echo $id; Listing 5.3.5: Code for the abstract syntax tree in Figure 5.6 after the sanitizing function is replaced. tree in Figure 5.5. While traversing the tree, Phulner will detect that the node containing the function-call intval removed the taint from the variable $userinput. During the last processing, the sanitation function for intval will be used to look up how intval shall be replaced to inject a vulnerability with the sanitation category None. In this case, Phulner will replace the intval function-call with the argument, and therefore remove the functioncall. That replacement will produce the abstract syntax tree in Figure 5.6, which is transformed to the code in Listing This code is susceptible to an XSS attack because the user input is never sanitized before it is outputted to the user. Phulner can perform other node replacements to inject other variants of the same vulnerability. Depending on the sanitation category in the instance configuration, Phulner will perform various node replacements to inject other variants of the vulnerability. If a vulnerability with the sanitation category None is injected, all attempts to sanitize the variable is removed as in the example above. When the sanitation category is Blacklist or Whitelist, the replacement is different depending on the output category. The whitelisted/blacklisted characters and sequences would differ depending on where the content is outputted. If the output category is one of the Non JavaScript attribute categories, and the quote that surrounds 35
44 5.3. XSS INJECTIONCHAPTER 5. DESIGN AND IMPLEMENTATION the attribute is allowed/not blacklisted, then an attacker can supply content which can break out from that attribute and insert a new attribute that can execute JavaScript as discussed in section The whitelisted/blacklisted characters would allow the surrounding quote to be supplied while disallowing other characters (for example = ) to make it harder to exploit the vulnerability. It is the same when the sanitation category is Encoding. As seen in the first example in section 5.3, depending on the output category of the vulnerability, the function htmlspecialchars had to be called with the constant ENT QUOTES to be safe. If the output category had been Normal tag, using htmlspecialchars without ENT QUOTES would be sufficient to prevent an attack, because the attacker would not be able to inject something that creates a new tag which could be used to execute JavaScript Static Taint Analysis Taint Analysis is a process of analyzing how tainted data is handled in an application. The property taint on some data denotes that the data has originated from a taint source. Taint sources are sources where usersupplied data are received, for example direct user input or reading a file that is supplied by a user [23]. In a security context, taint analysis is used for tracing sensitive or untrusted data. Usually it is of value to analyze if tainted data can reach a taint sink. A taint sink is a location in the application that can receive tainted data. Usually, locations that output data to the user or alter the program s execution path are considered to be taint sinks [14]. If tainted data can reach a taint sink, a vulnerability might be present in the application. For example, a user might be able to make the application output arbitrary data to another user, or, if taint is considered to be sensitive data, then that data can be leaked. Data can lose its taint property if the data is passed through a sanitation function, then the taint property is removed from the data [32]. After the taint is removed, the data is considered safe to be used in a taint sink. $number = $userinput; echo "Your number is: ", $number; Listing 5.3.6: Example of how taint propagates. $number is tainted The outputted variable When doing Static Taint Analysis, the process described above is done by only looking at the application s source code. In Listing 5.3.6, an example source code is shown. The variable $userinput is a direct input from a user, and therefore originates from a taint source and is marked as tainted. Performing static taint analysis on the code would report that a vulnerability might be present. The variable $number is assigned to the value of $userinput which is marked as tainted. On the next line, the same variable 36
45 5.4. CSRF INJECTION CHAPTER 5. DESIGN AND IMPLEMENTATION is outputted to the user (the variable is reaching a taint sink). Because the variable has not passed a sanitation function, the variable is still marked as tainted when it reaches the taint sink. When the analysis is completed, it will therefore show that a vulnerability might be present in the application. $number = intval($userinput); echo "Your number is: ", $number; Listing 5.3.7: Example of how taint propagates and is removed. The outputted variable $number will not be tainted In Listing almost the same source code as in the previous example is shown. However, in this version the variable $userinput is passed through the function intval (which returns a integer based on the input [20]) before it is assigned to $number. The function intval is a sanitation function and the taint from $userinput is not propagated to $number. When $number reaches the taint sink, the analysis will not show a possible vulnerability because the data passed through a sanitation function before it reached the taint sink. Static Taint Analysis has some drawbacks that almost all static analysis processes suffer from. It can sometimes be impossible for the analysis to know all the possible states which the application can have. Consider the code below: $key = rand(); $var = $array[$key]; Because the $key is random, the analysis cannot know what value that variable will have. The vulnerabilities which are discussed in this thesis try to output arbitrary data to users. Therefore, only taint sinks that output data to the user are relevant, and the only type of taint propagation is direct propagation, because the tool only cares that the data can flow to a taint sink, not how. Direct propagation is when new data is derived from tainted data as in the previous examples [22]. The taint from the user input was directly propagated to the variable $number. The vulnerabilities require the data to be strings. Therefore, all operations which convert strings to, for example integers, are considered to remove the taint from the data. 5.4 CSRF injection Before Phulner can inject a CSRF vulnerability, the source code has to be prepared by defining where the CSRF countermeasures are implemented. It is hard to determine statically if an action is protected by a CSRF countermeasure because there are several possible countermeasures. One common method to protect against CSRF attacks is to use random generated tokens [8][34][7]. There is no single way that a countermeasure is implemented. It 37
46 5.4. CSRF INJECTION CHAPTER 5. DESIGN AND IMPLEMENTATION is, therefore, hard to develop an algorithm during the short time span of this thesis to correctly identify every part of the countermeasure, and then identify how to remove the countermeasure to inject the vulnerability, and inject different variations of the vulnerability. To make it possible for Phulner to inject a vulnerability, the different sections of the countermeasure (specified in 2.2) have to be defined in the source code. The sections which can be specified are Guard, Generate and Include. The Guard section is where the server validates that the request was sent intentionally, and if not, terminates the execution of the action. In the Generate section, CSRF tokens are generated and stored, for example in the client s cookies. In the section, Include, the CSRF token is included in the server s response to the client, in such a way that the client will provide the token in the request to perform the authenticated action. Because the code in the section will be replaced or removed entirely, it is important that the sections only contain code which is related the to CSRF protection and not to any other functionality, to prevent breaking the web application when injecting a vulnerability Example of a CSRF Vulnerability Injection In Listing 5.4.1, the page is protected against CSRF with the Double Submit Cookies pattern by including a random token in both the submitted form and a cookie. The tokens are then validated on the server [8]. The code has been prepared to be used by Phulner. In the configuration object for each code block, it is specified that the block is part of the vulnerability with the identifier csrf changepassword. It is also specified to which section each block belongs. If Phulner was run with the instance configuration in Listing 5.1.2, Phulner would inject a CSRF vulnerability with the category None. The code Phulner would generate can be seen in Listing The generated page lacks any means to validate that the request from the user was intentional. Phulner performs different alternations to the different sections depending on the category of the injected vulnerability. If the category of the injected CSRF vulnerability is None, all of the sections are removed, because then when the server receives a request to perform the authenticated action, the validation is removed and the server will continue to perform the requested action. When the category is Only POST request the Guard section is replaced with code which confirms that the request is a POST request. The other sections are removed. There is no way for Phulner to inject a CSRF vulnerability with the category Multiple step, because that would require splitting the original action into multiple steps. Then, there must be an injection of code that can keep track of at which step the current user is. Then more code must be injected to give the user the ability to progress through the action. With the category Referer header, the guard section is replaced with a check which will validate that the referer header contains a value which is accepted before the server performs the 38
47 5.4. CSRF INJECTION CHAPTER 5. DESIGN AND IMPLEMENTATION authenticated action. When Phulner is injecting a CSRF vulnerability with the category Computable token, the Generate section is replaced with code that generates the md5 hash of the current date and time on the server (when looking at the value it may seem that it is random but it is easy to compute knowing the date and time of the server). This value is then saved in the client s cookies as in the example above. The Include section is replaced so that the generated md5 hash is included in the form that is posted. Lastly, the Guard section is replaced with code which checks that the cookie and the submitted value match. 39
48 5.4. CSRF INJECTION CHAPTER 5. DESIGN AND IMPLEMENTATION <?php if (isset($_post["newpassword"])) { /*Phulner { "identifier": "csrf_changepassword", "action": "guard" } */ if ($_POST["csrf_token"]!== $_COOKIE["csrf_token"]) { die("csrf attempt detected"); } /*/Phulner*/ $newpassword = $_POST["newpassword"]; $user = get_current_user(); update_user_password($user, $_POST["newpassword"]); } /*Phulner { "identifier": "csrf_changepassword", "action": "generate" } */ $csrf_token = base64_encode(openssl_random_pseudo_bytes(32)); setcookie("csrf_token", $csrf_token); /*/Phulner*/?> <form method="post"> New password: <input type="password" name="newpassword"> <br> <?php /*Phulner { "identifier": "csrf_changepassword", "action": "include" } */ echo "<input type= hidden name= csrf_token "; echo " value= ". $csrf_token. " >"; /*/Phulner*/?> <input type="submit" value="change password"> </form> Listing 5.4.1: Web page protected from CSRF 40
49 5.4. CSRF INJECTION CHAPTER 5. DESIGN AND IMPLEMENTATION <?php if (isset($_post["newpassword"])) { $newpassword = $_POST["newpassword"]; $user = get_current_user(); update_user_password($user, $_POST["newpassword"]); }?> <form method="post"> New password: <input type="password" name="newpassword"> <br> <?php?> <input type="submit" value="change password"> </form> Listing 5.4.2: Web page no longer protected from CSRF 41
50 Chapter 6 Evaluation This chapter presents how Phulner was evaluated according to the requirements presented in Chapter 5. First two projects were prepared that Phulner would use to generate vulnerable web applications. The web applications which Phulner generated from the prepared projects were evaluated using web application vulnerability scanners. To evaluate the time needed to prepare a project to be used by Phulner, a test was conducted where the time it took a person to perpare a project was measured. 6.1 Inject exploitable vulnerabilities Based on the dimensions of XSS vulnerabilities, there are 680 different variations of that kind of vulnerability. Only a few of the possible XSS vulnerabilities were injected due to the short time span of this thesis. Five different categories for CSRF vulnerabilities exist. However, not all of the categories are possible for Phulner to inject, and therefore only some of them were prepared to be injected. The popular CMS Wordpress [44] was prepared with the XSS vulnerabilities in Table 6.1, and the CSRF vulnerabilities in Table 6.2. The web forum application phpbb [28] was prepared with the XSS vulnerabilities in Table 6.3. Using Phulner, the web applications were then generated to include these vulnerabilities. The included vulnerabilities were successfully exploited manually. 42
51 6.2. ABILITY TO INJECT NONTRIVIALCHAPTER VULNERABILITIES 6. EVALUATION Input Output Sanitation Mutation GET Non JavaScript attribute - double quotes None No GET Non JavaScript attribute - double quotes Blacklist No Stored Normal tag None No Stored Normal tag Blacklist No Stored URL attribute - single quoted None No Stored URL attribute - single quoted Blacklist No Stored URL attribute - single quoted Whitelist No Stored URL attribute - single quoted Encoding No Table 6.1: The XSS vulnerabilities that were injected in Wordpress Type None Only POST request Computable token Table 6.2: The CSRF vulnerabilities that were injected in Wordpress Input Output Sanitation Mutation POST Normal tag None No POST Non JavaScript attribute - double quotes None No POST Non JavaScript attribute - double quotes Blacklist No Table 6.3: The vulnerabilities that were injected in phpbb 6.2 Ability to inject nontrivial vulnerabilities In this test, the requirements for the web application vulnerability scanners were that they are free to use without any limitations, and the scan is performed automatically. From Table 3.1 in Chapter 3 we chose w3af [39] and Wapiti [42]. Due to the time span of this thesis, only two scanners were used to evaluate the web applications that Phulner generated. Before a scan was performed, the web applications were restored to a baseline, and the database was emptied to remove data that might persist from a previous scan. This was done so that both scanners will scan on the same terms. The vulnerability was first exploited manually to confirm that the vulnerability was present in the web application and possible to exploit. The web application vulnerability scanners were not configured before scanning the web applications, because the web application vulnerability scanners were seen as tools which required no additional time to use. The results from running both the scanners on the different injected vulnerabilities are shown in tables 6.4 and 6.5. Both scanners found the 43
52 6.2. ABILITY TO INJECT NONTRIVIALCHAPTER VULNERABILITIES 6. EVALUATION most trivial vulnerability where the input came from a GET parameter and was directly outputted on the page without any sanitation. When a blacklist was applied on the input, only one of the scanners was still able to exploit the vulnerability. As discussed before in Section 3.1, it is difficult for scanners to detect vulnerabilities where the input is stored before it is outputted on the web page. This can also be seen in this test, since none of the two web application vulnerability scanners detected the vulnerabilities where the input was first stored and then later outputted on the page. Another reason why the vulnerabilities might be hard to detect is that some forms have to be filled in with acceptable values before the web application even begins to process the form submission, for example, if there is a form to reply to a forum post and the reply content is vulnerable to an XSS attack. If the form contains a field where a valid address has to be provided, the web application vulnerability scanner has to be able to provide a valid address to even have the form submission accepted by the server. Because the scanner is not configured in any way, the scanner has to work out by itself that it has to supply a valid address in that specific field. If the scanner cannot do that, the scanner will not be able to find the vulnerability. Another problem when scanning is that the web application can be large and contain a vast amount of different pages. The web application vulnerability scanner has to crawl every page to find all the inputs where a vulnerability might be present. The task to find all possible pages might be too expensive for the scanner to perform. Therefore, the web application vulnerability scanner might miss pages which could have contained vulnerabilities. Input Output Sanitation Mutation w3af GET Non JavaScript attribute - double quotes None No Yes GET Non JavaScript attribute - double quotes Blacklist No Yes POST Normal tag None No No Stored Normal tag None No No Stored Normal tag Blacklist No No Stored URL attribute - single quoted None No No Stored URL attribute - single quoted Blacklist No No Stored URL attribute - single quoted Whitelist No No Stored URL attribute - single quoted Encoding No No Table 6.4: The results when scanning the generated web applications for XSS vulnerabilities with w3af Only w3af had the support to scan for CSRF vulnerabilities and the result of the scans can be seen in Table 6.6. Although w3af found a possible CSRF vulnerability on two of the categories, w3af also reported many false positives. w3af reported a possible CSRF vulnerability for every page that included either a POST or a GET parameter unless one of the parameters had a name which looked like a CSRF token or if the value of the parameter looked as if it could be a CSRF token. Because the category Computable 44
53 6.3. PROJECT PREPARATION TIME CHAPTER 6. EVALUATION Input Output Sanitation Mutation Wapiti GET Non JavaScript attribute - double quotes None No Yes GET Non JavaScript attribute - double quotes Blacklist No No POST Normal tag None No No Stored Normal tag None No No Stored Normal tag Blacklist No No Stored URL attribute - single quoted None No No Stored URL attribute - single quoted Blacklist No No Stored URL attribute - single quoted Whitelist No No Stored URL attribute - single quoted Encoding No No Table 6.5: The results when scanning the generated web applications for XSS vulnerabilities with Wapiti Token adds a hidden input called phulner csrf token with a md5 as value, w3af picked it up as a CSRF token and did not report it as a possible CSRF vulnerability. This result confirms what was discussed in section 3.1. It is difficult for web application vulnerability scanners to detect CSRF vulnerabilities without many false positives. Because the way w3af reported possible CSRF vulnerabilities the information is not reliable. A human still has to confirm that the vulnerabilities exist. The report only summarizes where CSRF vulnerabilities can be present. Type None Only POST request Computable token w3af Yes Yes No Table 6.6: The results when scanning the generated web applications for CSRF vulnerabilities with w3af 6.3 Project Preparation Time To evaluate the time needed to prepare a project for someone who has not worked with Phulner before a test was conducted with computer security expert Jonas Almroth who is working at FOI. Jonas Almroth was asked to try to prepare a project with a new vulnerability. If the time it took for me to prepare a project with a new vulnerability, was measured, the result would not be representative of the average user, because I already know exactly how the tool works. First, a short introduction to Phulner was given and an example of a prepared vulnerability was shown. Then I showed the subject the web application and where I wanted him to prepare a new vulnerability. The subject was not familiar with the project s source code before this test was 45
54 6.4. FUTURE WORK CHAPTER 6. EVALUATION conducted. Within 10 minutes, the subject had located the relevant source code and inserted the Phulner keywords. The project could now be used by Phulner to inject the new vulnerability. The subject spent most of the time trying to figure out how the project worked and finding the relevant source code. Because the needed sanitation functions were already implemented in Phulner, the subject did not need to spend any time in defining those sanitation functions. That is supposed to be the normal use case when preparing a project that is used by Phulner. This test shows that without any prior knowledge of Phulner or the source code, it requires little effort to prepare a project to include another vulnerability which can be injected by Phulner. 6.4 Future work All tools can always be improved and extended to support even more features. Some concrete improvements that could be made to Phulner are: Implement support to inject other types than XSS and CSRF vulnerabilities. The implementation to add support for SQL Injections [11] and Command Injection [10] vulnerabilities would be similar to the currently implemented functionality to inject XSS vulnerabilities. Implement sanitation functions for more built-in PHP function-calls. Currently, only a handful of sanitation functions are included in Phulner. When injecting XSS vulnerabilities, taint analysis is being used. Currently the taint analysis can only handle tainted arrays and variables. Support for objects can be implemented to make Phulner able to handle more source code. In this thesis, only free scanners were used to evaluate the generated web applications. It would be interesting to investigate if enterprise scanners would do a better job at detecting the vulnerabilities that were injected by Phulner. It would also be interesting to have experienced penetration testers try to exploit the generated web applications. 46
55 Chapter 7 Conclusions In order to find vulnerabilities in web applications, human attention is still needed. As seen in the evaluation of two web vulnerability scanners in Section 6.2, not much was found when the scanners were running without any human interaction. The vulnerabilities that were especially difficult for the scanners to detect were the vulnerabilities where data was stored before it was outputted to the page. Because those vulnerabilities affect all the users that visit the vulnerable web application and not just those who are tricked to visiting a specific URL from an attacker, those vulnerabilities are the most crucial to find. The same case applies to CSRF vulnerabilities, because even if the web application vulnerability scanners find the vulnerabilities, the web application vulnerability scanners report even more false positives. Therefore, human attention is still necessary to confirm the vulnerability. All of this leads to the conclusion that it is still important to train human penetration testers to find vulnerabilities in web applications and not just only relying on tools. To train the penetration testers, Phulner can be used to reliably generate web applications that include vulnerabilities. When a project is prepared to work with Phulner, changing a few parameters can generate different versions of the same web application. Therefore, when the penetration tester is presented with a web application which has been generated by Phulner, the penetration tester cannot be sure exactly which version of the web application it is. Even if the penetration tester has been faced with the same web application before, there will be different vulnerabilities and other variants of the vulnerabilities. From the tests done in this thesis we can draw the conclusion that Phulner can inject vulnerabilities which are not possible for web application vulnerability scanners to detect. Some of the injected vulnerabilities need human attention to be found. To prepare a project to be used by Phulner only a small amount of time is needed, even if the person who is doing the preparations has no prior knowledge about the project that is being prepared. Most of the preparation 47
56 CHAPTER 7. CONCLUSIONS time is spent on finding the relevant source code, and understanding the inner workings of the project and not the specific Phulner parts. The biggest advantages of using Phulner compared to using the other tools which automatically generate vulnerable web applications, is that Phulner can inject several variations of the same vulnerability without having to write every specific variation of the vulnerability. The vulnerabilities can also be more advanced and span more than one file in the web application. When Phulner has been executed, it is sure that every vulnerability Phulner was configured to inject is exploitable. 48
57 Bibliography [1] 2011 Top 25 Most Dangerous Software Errors. CWE/SANS. url: (visited on ). [2] Acuart. url: (visited on ). [3] Altoro Mutual. url: http : / / demo. testfire. net/ (visited on ). [4] arianevans. WhiteHat Security s Approach to Detecting Cross-Site Request Forgery (CSRF). Apr url: com / whitehat - security % C3 % A2 % C2 % 80 % C2 % 99s - approach - to- detecting- cross- site- request- forgery- csrf/ (visited on ). [5] Adam Barth. The Chromium Blog: Security in Depth: New Security Features. Google. Jan url: 01/security-in-depth-new-security-features.html (visited on ). [6] Jason Bau et al. State of the Art: Automated Black-Box Web Application Vulnerability Testing. In: SP 10 Proceedings of the 2010 IEEE Symposium on Security and Privacy [7] Boyan Chen et al. A Study of the Effectiveness of CSRF Guard. In: 2011 IEEE International Conference on Privacy, Security, Risk, and Trust, and IEEE International Conference on Social Computing [8] Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet. url: https : / / www. owasp. org / index. php / Cross - Site _ Request _ Forgery_(CSRF)_Prevention_Cheat_Sheet (visited on ). [9] CWE-352: Cross-Site Request Forgery (CSRF). url: cwe. mitre.org/data/definitions/352.html (visited on ). [10] CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS Command Injection). url: data/definitions/78.html (visited on ). [11] CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). url: http : / / cwe. mitre. org / data / definitions/89.html (visited on ). 49
58 BIBLIOGRAPHY BIBLIOGRAPHY [12] Adam Doupé, Marco Cova, and Giovanni Vigna. Why Johnny Can t Pentest: An Analysis of Black-Box Web Vulnerability Scanners. In: DIMVA 10 Proceedings of the 7th international conference on Detection of intrusions and malware, and vulnerability assessment. Ed. by C. Kreibich and M. Jahnke. Vol LNCS. Springer, 2010, pp [13] José Fonseca et al. Vulnerability & Attack Injection for Web Applications. In: Dependable Systems & Networks, DSN 09. IEEE/IFIP International Conference on. IEEE, [14] Salvatore Guarnieri et al. Saving the World Wide Web from Vulnerable JavaScript. In: ISSTA 11 Proceedings of the 2011 International Symposium on Software Testing and Analysis [15] Mario Heiderich et al. mxss Attacks: Attacking well-secured Web- Applications by using innerhtml Mutations. In: CCS 13 Proceedings of the 2013 ACM SIGSAC conference on Computer & communications security doi:.org/ / [16] htmlspecialchars. url: htmlspecialchars.php (visited on ). [17] Hypertext Transfer Protocol HTTP/1.1. url: org/html/rfc2616 (visited on ). [18] Improper Input Handling. url: w / page / / Improper % 20Input % 20Handling (visited on ). [19] Internet Security Threat Report 2013 :: Volume 18. Tech. rep. Symantec Corperation, url: en/us/enterprise/other_resources/b- istr_main_report_v18_ 2012_ en-us.pdf. [20] intval. url: php (visited on ). [21] Joel Jones. Abstract Syntax Tree Implementation Idioms. [22] Ulf Kargén. Development of a prototype taint tracing tool for security and other purposes. MA thesis. Linköping University Department of Computer and Information Science, [23] Ulf Kargen and Nahid Shahmehri. InputTracer: A Data-Flow Analysis Tool for Manual Program Comprehension of x86 Binaries. In: Source Code Analysis and Manipulation (SCAM), 2012 IEEE 12th International Working Conference on. IEEE, isbn: doi: / scam url: [24] Jin-Cherng Lin and Jan-Min Chen. An Automated Mechanism for Secure Input Handling. In: JOURNAL OF COMPUTERS, VOL. 4, NO
59 BIBLIOGRAPHY BIBLIOGRAPHY [25] Architecture-driven Modernization et al. Architecture-driven Modernization and Abstract Syntax and Tree Metamodel and (ASTM). Tech. rep. OMG, [26] OWASP SiteGenerator. url: OWASP_SiteGenerator (visited on ). [27] OWASP: Vulnerability Scanning Tools. url: www. owasp. org/index.php/category:vulnerability_scanning_tools (visited on ). [28] phpbb. url: (visited on ). [29] Nikita Popov. PHP Parser. url: Parser (visited on ). [30] Amirmohammad Sadeghian, Mazdak Zamani, and Suhaimi Ibrahim. SQL Injection Is Still Alive: A Study on SQL Injection Signature Evasion Techniques. In: 2013 International Conference on Informatics and Creative Multimedia (2013). doi: /icicm url: [31] Sending and retrieving form data. url: https : / / developer. mozilla. org / en - US / docs / Web / Guide / HTML / Forms / Sending _ and_retrieving_form_data (visited on ). [32] Nahid Shahmehri et al. An advanced approach for modeling and detecting software vulnerabilities. In: Information and Software Technology 54.9 (2012), pp [33] L.K. Shar and H.B.K. Tan. Auditing the XSS defence features implemented in web application programs. In: IET Software 6.4 (2012), p doi: /iet- sen url: org/ /iet-sen [34] Mohd. Shadab Siddiqui and Deepanker Verma. Cross Site Request Forgery: A common web application weakness. In: Communication Software and Networks (ICCSN), 2011 IEEE 3rd International Conference on. IEEE, [35] sprintf. url: php (visited on ). [36] Testing for Reflected Cross site scripting. url: org/index.php/testing_for_reflected_cross_site_scripting_ (OWASP-DV-001) (visited on ). [37] The Web Application Security Consortium: Web Application Security Scanner List. url: http : / / projects. webappsec. org / w / page / / Web % 20Application % 20Security % 20Scanner % 20List (visited on ). [38] José Fonseca Marco Vieira et al. Training Security Assurance Teams using Vulnerability Injection. In: Dependable Computing, PRDC th IEEE Pacific Rim International Symposium on
60 BIBLIOGRAPHY BIBLIOGRAPHY [39] w3af. url: (visited on ). [40] W3Techs. Usage of server-side programming languages for websites. url: language/all (visited on ). [41] Yi Wang, Zhoujun Li, and Tao Guo. Program Slicing Stored XSS Bugs in Web Application. In: 2011 Fifth International Conference on Theoretical Aspects of Software Engineering (). doi: / tase url: [42] Wapiti : a Free and Open-Source web-application vulnerability scanner in Python for Windows, Linux, BSD, OSX. url: sourceforge.net/ (visited on ). [43] Gary Wassermann et al. Dynamic Test Input Generation for Web Applications. In: ISSTA 08 Proceedings of the 2008 international symposium on Software testing and analysis [44] WordPress. url: (visited on ). [45] XSS (Cross Site Scripting) Prevention Cheat Sheet. url: https : / / www. owasp. org / index. php / XSS _ (Cross _ Site _ Scripting ) _Prevention_Cheat_Sheet (visited on ). [46] Zero Bank. url: (visited on ). 52
61 På svenska Detta dokument hålls tillgängligt på Internet eller dess framtida ersättare under en längre tid från publiceringsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida In English The publishers will keep this document online on the Internet - or its possible replacement - for a considerable time from the date of publication barring exceptional circumstances. The online availability of the document implies a permanent permission for anyone to read, to download, to print out single copies for your own use and to use it unchanged for any non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional on the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its WWW home page: Gustav Ahlberg
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 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
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
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
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
Criteria for web application security check. Version 2015.1
Criteria for web application security check Version 2015.1 i Content Introduction... iii ISC- P- 001 ISC- P- 001.1 ISC- P- 001.2 ISC- P- 001.3 ISC- P- 001.4 ISC- P- 001.5 ISC- P- 001.6 ISC- P- 001.7 ISC-
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
(WAPT) Web Application Penetration Testing
(WAPT) Web Application Penetration Testing Module 0: Introduction 1. Introduction to the course. 2. How to get most out of the course 3. Resources you will need for the course 4. What is WAPT? Module 1:
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
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
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
Complete Cross-site Scripting Walkthrough
Complete Cross-site Scripting Walkthrough Author : Ahmed Elhady Mohamed Email : [email protected] website: www.infosec4all.tk blog : www.1nfosec4all.blogspot.com/ [+] Introduction wikipedia
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
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
Project 2: Web Security Pitfalls
EECS 388 September 19, 2014 Intro to Computer Security Project 2: Web Security Pitfalls Project 2: Web Security Pitfalls This project is due on Thursday, October 9 at 6 p.m. and counts for 8% of your course
Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins
Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins During initial stages of penetration testing it is essential to build a strong information foundation before you
Application Security Testing. Generic Test Strategy
Application Security Testing Generic Test Strategy Page 2 of 8 Contents 1 Introduction 3 1.1 Purpose: 3 1.2 Application Security Testing: 3 2 Audience 3 3 Test Strategy guidelines 3 3.1 Authentication
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
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
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
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]
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
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,
The Top Web Application Attacks: Are you vulnerable?
QM07 The Top Web Application Attacks: Are you vulnerable? John Burroughs, CISSP Sr Security Architect, Watchfire Solutions [email protected] Agenda Current State of Web Application Security Understanding
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
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
Last update: February 23, 2004
Last update: February 23, 2004 Web Security Glossary The Web Security Glossary is an alphabetical index of terms and terminology relating to web application security. The purpose of the Glossary is to
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
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
Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure
Vulnerabilities, Weakness and Countermeasures Massimo Cotelli CISSP Secure : Goal of This Talk Security awareness purpose Know the Web Application vulnerabilities Understand the impacts and consequences
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
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
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
Blackbox Reversing of XSS Filters
Blackbox Reversing of XSS Filters Alexander Sotirov [email protected] Introduction Web applications are the future Reversing web apps blackbox reversing very different environment and tools Cross-site scripting
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
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
ArcGIS Server Security Threats & Best Practices 2014. David Cordes Michael Young
ArcGIS Server Security Threats & Best Practices 2014 David Cordes Michael Young Agenda Introduction Threats Best practice - ArcGIS Server settings - Infrastructure settings - Processes Summary Introduction
Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011 Agenda Evolving Threats Operating System Application User Generated Content JPL s Application Security Program Securing
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
Lecture 11 Web Application Security (part 1)
Lecture 11 Web Application Security (part 1) Computer and Network Security 4th of January 2016 Computer Science and Engineering Department CSE Dep, ACS, UPB Lecture 11, Web Application Security (part 1)
Web Security Testing Cookbook*
Web Security Testing Cookbook* Systematic Techniques to Find Problems Fast Paco Hope and Ben Walther O'REILLY' Beijing Cambridge Farnham Koln Sebastopol Tokyo Table of Contents Foreword Preface xiii xv
Essential IT Security Testing
Essential IT Security Testing Application Security Testing for System Testers By Andrew Muller Director of Ionize Who is this guy? IT Security consultant to the stars Member of OWASP Member of IT-012-04
Software Assurance Tools: Web Application Security Scanner Functional Specification Version 1.0
Special Publication 500-269 Software Assurance Tools: Web Application Security Scanner Functional Specification Version 1.0 Paul E. Black Elizabeth Fong Vadim Okun Romain Gaucher Software Diagnostics and
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
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
Sitefinity Security and Best Practices
Sitefinity Security and Best Practices Table of Contents Overview The Ten Most Critical Web Application Security Risks Injection Cross-Site-Scripting (XSS) Broken Authentication and Session Management
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
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
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
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.
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.
Security features of ZK Framework
1 Security features of ZK Framework This document provides a brief overview of security concerns related to JavaScript powered enterprise web application in general and how ZK built-in features secures
Still Aren't Doing. Frank Kim
Ten Things Web Developers Still Aren't Doing Frank Kim Think Security Consulting Background Frank Kim Consultant, Think Security Consulting Security in the SDLC SANS Author & Instructor DEV541 Secure Coding
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
Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert [email protected]
Application Security Testing Erez Metula (CISSP), Founder Application Security Expert [email protected] Agenda The most common security vulnerabilities you should test for Understanding the problems
METHODS TO TEST WEB APPLICATION SCANNERS
METHODS TO TEST WEB APPLICATION SCANNERS Fernando Román Muñoz, Luis Javier García Villalba Group of Analysis, Security and Systems (GASS) Department of Software Engineering and Artificial Intelligence
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
Bypassing Web Application Firewalls (WAFs) Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant
Bypassing Web Application Firewalls (WAFs) Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant Nethemba All About Security Highly experienced certified IT security experts (CISSP, C EH, SCSecA) Core
Web Application Hacking (Penetration Testing) 5-day Hands-On Course
Web Application Hacking (Penetration Testing) 5-day Hands-On Course Web Application Hacking (Penetration Testing) 5-day Hands-On Course Course Description Our web sites are under attack on a daily basis
Threat Modeling/ Security Testing. Tarun Banga, Adobe 1. Agenda
Threat Modeling/ Security Testing Presented by: Tarun Banga Sr. Manager Quality Engineering, Adobe Quality Leader (India) Adobe Systems India Pvt. Ltd. Agenda Security Principles Why Security Testing 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
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
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
Secure Web Development Teaching Modules 1. Threat Assessment
Secure Web Development Teaching Modules 1 Threat Assessment Contents 1 Concepts... 1 1.1 Software Assurance Maturity Model... 1 1.2 Security practices for construction... 3 1.3 Web application security
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),
Web application security: Testing for vulnerabilities
Web application security: Testing for vulnerabilities Using open source tools to test your site Jeff Orloff Technology Coordinator/Consultant Sequoia Media Services Inc. Skill Level: Intermediate Date:
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
VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso
VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES AUTHOR: Chema Alonso Informática 64. Microsoft MVP Enterprise Security Hello and welcome to Intypedia.
Web Application Security
Web Application Security Ng Wee Kai Senior Security Consultant PulseSecure Pte Ltd About PulseSecure IT Security Consulting Company Part of Consortium in IDA (T) 606 Term Tender Cover most of the IT 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
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
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
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
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
Secure Coding. External App Integrations. Tim Bach Product Security Engineer salesforce.com. Astha Singhal Product Security Engineer salesforce.
Secure Coding External App Integrations Astha Singhal Product Security Engineer salesforce.com Tim Bach Product Security Engineer salesforce.com Safe Harbor Safe harbor statement under the Private Securities
Guidelines for Web applications protection with dedicated Web Application Firewall
Guidelines for Web applications protection with dedicated Web Application Firewall Prepared by: dr inŝ. Mariusz Stawowski, CISSP Bartosz Kryński, Imperva Certified Security Engineer INTRODUCTION Security
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...
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
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
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
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
Defending against XSS,CSRF, and Clickjacking David Bishop
Defending against XSS,CSRF, and Clickjacking David Bishop University of Tennessee Chattanooga ABSTRACT Whenever a person visits a website, they are running the risk of falling prey to multiple types of
ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus
ASP.NET MVC Secure Coding 4-Day hands on Course Course Syllabus Course description ASP.NET MVC Secure Coding 4-Day hands on Course Secure programming is the best defense against hackers. This multilayered
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
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
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.
A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith
A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications Slides by Connor Schnaith Cross-Site Request Forgery One-click attack, session riding Recorded since 2001 Fourth out of top 25 most
What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)
Security What about MongoDB? Even though MongoDB doesn t use SQL, it can be vulnerable to injection attacks db.collection.find( {active: true, $where: function() { return obj.credits - obj.debits < req.body.input;
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
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
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
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
Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers
Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers The Website can be developed under Windows or Linux Platform. Windows Development should be use: ASP, ASP.NET 1.1/ 2.0, and
External Network & Web Application Assessment. For The XXX Group LLC October 2012
External Network & Web Application Assessment For The XXX Group LLC October 2012 This report is solely for the use of client personal. No part of it may be circulated, quoted, or reproduced for distribution
A Tale of the Weaknesses of Current Client-Side XSS Filtering
Call To Arms: A Tale of the Weaknesses of Current Client-Side XSS Filtering Martin Johns, Ben Stock, Sebastian Lekies About us Martin Johns, Ben Stock, Sebastian Lekies Security Researchers at SAP, Uni
Online Vulnerability Scanner Quick Start Guide
Online Vulnerability Scanner Quick Start Guide Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted.
