Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aniket Joshi Justin Thomas. Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary.

Similar presentations


Presentation on theme: "Aniket Joshi Justin Thomas. Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary."— Presentation transcript:

1 Aniket Joshi Justin Thomas

2 Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary

3 What is SQL Injection? It is a kind of web application attack where user supplied input coming from: URL: www.abc.com?id=1www.abc.com?id=1 Login forms: username=John Doe Other elements such as cookie, HTTP headers is manipulated so that vulnerable application executes SQL commands injected by attacker.

4 Methods of Injection Injection into source code of website Injection into the URL

5 SQL Injection cont.… The injection process works by prematurely terminating a text string and appending a new command. Because the inserted command may have additional strings appended to it before it is executed, the attacker terminates the injected string with a comment mark "--". Subsequent text is ignored at execution time.

6 Example: Statement=“SELECT * FROM users WHERE uname=‘ ”+username+” ’;” username=‘ or ‘1’=‘1’- -’ SELECT * FROM users WHERE uname=‘ ‘ OR ‘1’=‘1’ - -’;

7 How to Defend?

8 How to avoid SQL Injection As long as injected SQL code is syntactically correct, tampering cannot be detected programmatically. Therefore, you must validate all user input and carefully review code that executes constructed SQL commands in the server that you are using.

9 Some tips: Filter and validate all input data Separating code from data by making use of prepared and stored procedures Making use of escape characters

10 1.Filter out character like single quote, double quote, slash, back slash, semi colon, extended character like NULL, carry return, new line a. input from users b. parameters from URL c. values from cookies 2. Convert all numeric values into integer before parsing into SQL statement.

11 Summary Considered top 10 web application vulnerabilities of 2007 and 2010 by the Open Web Application Security Project SQLIA’s has ▫Many sources ▫Many Goals ▫Many Types Prevention should not be developer dependent

12 Thank You


Download ppt "Aniket Joshi Justin Thomas. Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary."

Similar presentations


Ads by Google