Prevention of SQL Injection Attacks Using AWS WAF Mohammed Kareem St
Total Page:16
File Type:pdf, Size:1020Kb
St. Cloud State University theRepository at St. Cloud State Culminating Projects in Information Assurance Department of Information Systems 5-2018 Prevention of SQL Injection Attacks using AWS WAF Mohammed Kareem St. Cloud State University, [email protected] Follow this and additional works at: https://repository.stcloudstate.edu/msia_etds Recommended Citation Kareem, Mohammed, "Prevention of SQL Injection Attacks using AWS WAF" (2018). Culminating Projects in Information Assurance. 47. https://repository.stcloudstate.edu/msia_etds/47 This Starred Paper is brought to you for free and open access by the Department of Information Systems at theRepository at St. Cloud State. It has been accepted for inclusion in Culminating Projects in Information Assurance by an authorized administrator of theRepository at St. Cloud State. For more information, please contact [email protected]. Prevention of SQL Injection Attacks using AWS WAF by Mohammed Abdul Kareem A Starred Paper Submitted to the Graduate Faculty of St. Cloud State University in Partial Fulfillment of the Requirements for the Degree of Master of Science in Information Assurance May 2018 Starred Paper Committee: Susantha Herath, Chairperson Dien D. Phan Balasubramanian Kasi 2 Abstract SQL injection is one of several different types of code injection techniques used to attack data driven applications. This is done by the attacker injecting an input in the query not intended by the programmer of the application gaining the access of the database which results in potential reading, modification or deletion of users’ data. The vulnerabilities are due to the lack of input validation which is the most critical part of software security that is often not properly covered in the design phase of the software development lifecycle. This paper presents different techniques and some of the countermeasures for detection and prevention of SQL injection attacks. The proposed procedure in the paper is to use a database firewall between the client (user) side and the database server through AWS to avoid the malicious codes injected by the attackers. 3 Table of Contents List of Tables ................................................................................................................... 6 List of Figures .................................................................................................................. 7 Chapter I: Introduction ..................................................................................................... 8 Introduction ........................................................................................................... 8 Problem Statement ............................................................................................... 9 Nature and Significance of the Problem ............................................................... 9 Web Application Environment............................................................................. 10 Objective of the Research .................................................................................. 12 SQL Injection Attack Overview ........................................................................... 12 Applications Vulnerable to SQL Injection ............................................................ 14 Summary ............................................................................................................ 16 Chapter II. Background and Literature Review .............................................................. 17 Introduction ......................................................................................................... 17 Literature Related to the Problem ....................................................................... 18 Literature Related to the Methodology ................................................................ 20 Types of SQL Injection Attacks........................................................................... 21 Tautologies ......................................................................................................... 21 Illegal or Logically Incorrect Queries ................................................................... 22 Union Query ....................................................................................................... 24 Piggy-Backed Queries ........................................................................................ 25 Stored Procedures .............................................................................................. 26 4 Inference ............................................................................................................ 28 Blind Injection ..................................................................................................... 29 Timing Attacks .................................................................................................... 29 Alternate Encodings ........................................................................................... 31 Main Causes of SQL Injection ............................................................................ 33 Detection and Prevention Techniques ................................................................ 35 Injection Detection at the Web Tier ..................................................................... 39 Summary ............................................................................................................ 40 Chapter III. Methodology ............................................................................................... 41 Introduction ......................................................................................................... 41 Design of the Study ............................................................................................ 42 Data Analysis ...................................................................................................... 44 Summary ............................................................................................................ 45 Chapter IV: Analysis of Results ..................................................................................... 46 Introduction ......................................................................................................... 46 Data Presentation ............................................................................................... 47 Compute ............................................................................................................. 47 Storage ............................................................................................................... 49 Security .............................................................................................................. 51 Networking.......................................................................................................... 52 Data Analysis ...................................................................................................... 52 Overview for IPv4 ............................................................................................... 57 5 Overview for IPv6 ............................................................................................... 58 Create a VPC ..................................................................................................... 64 Template 1.......................................................................................................... 69 Create an Amazon S3 Bucket ............................................................................ 76 Template 2.......................................................................................................... 76 Summary ............................................................................................................ 80 Chapter V: Conclusions and Future Work ..................................................................... 81 Results ............................................................................................................... 81 Conclusion .......................................................................................................... 82 Future Work ........................................................................................................ 82 References .................................................................................................................... 83 6 List of Tables 4.1 Routing for IPv4 ................................................................................................................... 60 4.2 Routing for IPv6 ...................................................................................................... 61 4.3 Security for IPv4 ...................................................................................................... 62 4.4 Security for IPv6 ...................................................................................................... 64 7 List of Figures 1.1 Web Application Firewall .................................................................................................... 10 1.2 Web Tier Environment............................................................................................. 11 1.3 SQL Injection Attack Overview ................................................................................ 14 3.1 AWS WAF Architecture ........................................................................................... 43 4.1 Configure Instance Details .....................................................................................