SQL Injection Attacks S Vinay Kumar, 07012D0506. Outline SQL Injection ? Classification of Attacks Attack Techniques Prevention Techniques Conclusion.

Slides:



Advertisements
Similar presentations
Module XIV SQL Injection
Advertisements

PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
How Did I Steal Your Database Mostafa
ITEC403 Graduation Project Applications’ Security – Cem Yağlı.
Introduction The concept of “SQL Injection”
Database Connectivity Rose-Hulman Institute of Technology Curt Clifton.
SQL Injection and Buffer overflow
Security in SQL Jon Holmes CIS 407 Fall Outline Surface Area Connection Strings Authenticating Permissions Data Storage Injections.
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Sql Server Advanced Features MIS 424 Professor Sandvig.
{ Code Injection Cable Johnson.  Overview  Common Injection Types  Developer Prevention Code Injection.
Check That Input Preventing SQL Injection Attacks By Andrew Morton For CS 410.
MIS Week 11 Site:
OWASP Zed Attack Proxy Project Lead
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
SQL INJECTION COUNTERMEASURES &
Hamdi Yesilyurt, MA Student in MSDF & PhD-Public Affaris SQL Riji Jacob MS Student in Computer Science.
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
Attacking Applications: SQL Injection & Buffer Overflows.
SEC835 Practical aspects of security implementation Part 1.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Security Vulnerabilities and Their Impact upon Poirot Jun Lin Supervised by Dr. Jane Huang.
C HAPTER 8 SQL Injection Slides adapted from "Foundations of Security: What Every Programmer Needs To Know" by Neil Daswani, Christoph Kern, and Anita.
An Analysis Framework for Security in Web Applications Gary Wassermann and Zhendong Su University of California, Davis.
Copyright © 2013 Curt Hill Database Security An Overview with some SQL.
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
Attacking Data Stores Brad Stancel CSCE 813 Presentation 11/12/2012.
Analysis of SQL injection prevention using a filtering proxy server By: David Rowe Supervisor: Barry Irwin.
Accessing Your MySQL Database from the Web with PHP (Ch 11) 1.
Sumanth M Ganesh B CPSC 620.  SQL Injection attacks allow a malicious individual to execute arbitrary SQL code on your server  The attack could involve.
Aniket Joshi Justin Thomas. Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary.
Building Secure Web Applications With ASP.Net MVC.
ADO.NET AND STORED PROCEDURES - Swetha Kulkarni. RDBMS ADO.NET Provider  SqlClient  OracleClient  OleDb  ODBC  SqlServerCE System.Data.SqlClient.
WEB SECURITY WEEK 2 Computer Security Group University of Texas at Dallas.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Michael Dalton, Christos Kozyrakis, and Nickolai Zeldovich MIT, Stanford University USENIX 09’ Nemesis: Preventing Authentication & Access Control Vulnerabilities.
JDBC CS 260 Database Systems. Overview  Introduction  JDBC driver types  Eclipse project setup  Programming with JDBC  Prepared statements  SQL.
SQL Injection Anthony Brown March 4, 2008 IntroductionQuestionsBackgroundTechniquesPreventionDemoConclusions.
Oracle 11g: SQL Chapter 7 User Creation and Management.
Dr. Chen, Oracle Database System (Oracle) 1 Chapter 7 User Creation and Management Jason C. H. Chen, Ph.D. Professor of MIS School of Business Gonzaga.
SQL Injection Josh Mann. What is SQL Injection  SQL injection is a technique for exploiting web applications that use client-supplied data in SQL queries.
Database Security Database System Implementation CSE 507 Some slides adapted from Navathe et. Al.
ADVANCED SQL.  The SQL ORDER BY Keyword  The ORDER BY keyword is used to sort the result-set by one or more columns.  The ORDER BY keyword sorts the.
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
SQL INJECTION Lecturer: A.Prof.Dr. DANG TRAN KHANH Student :Le Nguyen Truong Giang.
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
Introduction SQL Injection is a very old security attack. It first came into existence in the early 1990's ex: ”Hackers” movie hero does SQL Injection.
SQL INJECTION Diwakar Kumar Dinkar M.Tech, CS&E Roll Diwakar Kumar Dinkar M.Tech, CS&E Roll
Cosc 5/4765 Database security. Database Databases have moved from internal use only to externally accessible. –Organizations store vast quantities of.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Database and Cloud Security
SQL Injection.
Database System Implementation CSE 507
SQL Server Security & Intrusion Prevention
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
SQL Injection.
Theodore Lawson CSCE548 Student Presentation, Topic #2
CS320 Web and Internet Programming Database Access with JDBC
SQL INJECTION ATTACKS.
Intro to Ethical Hacking
Chapter 13 Security Methods Part 3.
Lecture 2 - SQL Injection
Intro to Ethical Hacking
Presentation transcript:

SQL Injection Attacks S Vinay Kumar, 07012D0506

Outline SQL Injection ? Classification of Attacks Attack Techniques Prevention Techniques Conclusion

What is a SQL Injection? The ability to inject SQL commands into the database engine through an existing application

Classification of Attacks Identifying Database Finger-Print Identifying Injectable Parameters Discovering Database Schema Bypassing Authentication Extracting/Modifying Database Data Downloading/Uploading File Executing Remote Commands Escalating Privilege

Attack Techniques

1.Tautology : Exploit where clause Usual login Query: SELECT * FROM acct WHERE login = 'raju' AND password = '123' JSP login query syntax var sql = "SELECT * FROM users WHERE login = '" + usr + "' AND password = '" + pwd + "'";

Injecting through input string usr = ' or 1=1 – – pwd = anything Final query would look like this: SELECT * FROM acct WHERE username = ' ' or 1=1 – – ' AND password = 'anything'

2.Piggy-backed Query: Injecting through input string usr = xyz pwd = 0;drop table users Final query would look like this: SELECT * FROM acct WHERE username = ' xyz ' AND password = 0;drop table users

3.Union Query: To retrieve specific information Injecting through input string usr = ' UNION SELECT cardNo from CreditCards where acctNo = pwd = anything Final query would look like this: SELECT * FROM acct WHERE username = ‘ ‘UNION SELECT cardNo from CreditCards where acctNo = ’AND password = anything

4.Malformed Query: Also called Second-order Injection Injecting through input string usr = xyz pwd = convert (int,(select top 1 name from sysobjects where xtype = ‘u’)) Final query would look like this: SELECT * FROM acct WHERE username = ‘xyz‘ AND password = convert (int,(select top 1 name from sysobjects where xtype = ‘u’))

SQL Server may return the following error: “Microsoft OLE DB Provider for SQL Server (0x80040E07) Error converting nvarchar value ’CreditCards’ to a column of data type int

5.Inference Based Attacks: Also Blind Injection Injecting in input string usr = legalUser ‘ AND ASCII(SUBSTRING ((select top 1 name from sysobjects ), 1,1 )) >X WAITFOR pwd = anything Final query would look like this: SELECT * FROM acct WHERE username = ‘legalUser ‘ AND ASCII(SUBSTRING ((select top 1 name from sysobjects ), 1,1 )) >X WAITFOR AND password = anything

6.Alternate Encodings: Injecting through input string usr = pwd = 0; exec(char(0x f776e)) Final query would look like this: SELECT * FROM acct WHERE username = ' ' AND password = 0; exec(char(0x f776e)) Shutdown cmd

Prevention Techniques

1. Use Parameterized Queries Separates data from query Allow creation of static queries with bind variables

String custname = request.getParameter("customerName"); // perform input validation on custname to detect attacks String query = "SELECT account_balance FROM user_data WHERE user_name = ? "; PreparedStatement pstmt = connection.prepareStatement( query ); pstmt.setString( 1, custname); ResultSet results = pstmt.executeQuery( );

2. Customized Error Messages Knowing database schema makes attacker’s job easier. Avoid display detailed error messages and stack traces to external users.

3.White List Based Validation Involves defining exactly what IS authorized Allow input within well-defined set of safe values –By defining a very strong validation pattern Implement stringent "known bad" filters –Eg: Reject "select", "insert", "update", "shutdown", "delete", "drop", "--", “’“

4.Limiting Privileges Admin type access rights to the application accounts must be avoided Create a view that limits access to that portion of the data

5.Other preventions Validate and filter the input data using strong Regular expression patterns System Stored Procedure Reduction Encrypting Sensitive Data

Conclusion Present day development is more focused on Web Applications so there is an urgent need for educating the developers & Students on SQL Injection thereby allowing programmers and system administrators to understand the attacks more thoroughly, more attacks will be detected and more countermeasures will be introduced into the systems

Thank You Queries ?