1 / 9

SQL Injection

SQL Injection. Peter Torres, Tim Poley CS526 Spring 2009. Presentation Outline. What is SQL Injection? Basic Example Case Studies Defensive Techniques Demo. What is SQL Injection?.

maximus
Download Presentation

SQL Injection

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. SQL Injection Peter Torres, Tim Poley CS526 Spring 2009

  2. Presentation Outline • What is SQL Injection? • Basic Example • Case Studies • Defensive Techniques • Demo

  3. What is SQL Injection? • SQL Injection is a code injection technique that exploits a security vulnerability at an applications database access layer.

  4. Basic Example • Statement = "SELECT * FROM users WHERE name = '" + userName + "';" • Substitute “a' or 't'='t” instead of a real username • SELECT * FROM users WHERE name = 'a' OR 't'='t';

  5. Case Study: USC • In July of 2005, Erin McCarty hacked the University of Southern California’s application website • Used the user login page to send commands directly to the school database • Access to names, birth dates, addresses, and social security numbers of any student who filled out an online application • McCarty faces a possible 10yr prison sentence

  6. Case Study: U.N. • On August 12th, 2007 the United Nations website was defaced by hackers

  7. Defenses • Type Checking • Make sure an 8 digit number is an 8 digit number • Escaping Special Characters • ; ‘ - • Data Hashing • Error Suppression • Hide information from hackers • Prepared Statements • Fix the SQL Statement before assigning user data

  8. Demo

  9. References • Database Programming with JDBC and Java 2nd Edition; George Reese, O’Reilly • Hackademix– United Nations vs. SQL Injection http://hackademix.net/2007/08/12/united-nations-vs-sql-injections/ • Security Focus http://www.securityfocus.com/brief/191 • Wikipedia – SQL Injection http://en.wikipedia.org/wiki/Sql_injection

More Related