1 / 12

Aniket Joshi Justin Thomas

Aniket Joshi Justin Thomas. Agenda. Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary. What is SQL Injection?. It is a kind of web application attack where user supplied input coming from: URL : www.abc.com?id=1 Login forms: username=John Doe

gilead
Télécharger la présentation

Aniket Joshi Justin Thomas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AniketJoshi 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=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. 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

More Related