SQL Injection
SQL Overview
Structured Query Language
Database language designed for
managing data in RDBMS.
1970s by Dr. Codd.
ANSI: 1st SQL standard in 1986,
ANSI: updates in 1989, …
SQL Uses DML (Data Manipulation Language)
SQL Injection Attacks
SQL Injection Attacks Con..
SQL serversSELECT
allow multiple statements.
* FROM `users` WHERE `name` = ‘Al'; SELECT * FROM `users`; DROP TABLE `users`;
SELECT * FROM `users` WHERE `name` = ‘Al'; SELECT * FROM `users`; DROP TABLE `users`;
SELECT SELECT
SQLIAs: Exploiting an application security vulnerability.
SQLIAs: described as one of the most serious security threats to
web applications
SQLIAs: Caused by insufficient input validation.
Gartner Group:97% of 300 websites were vulnerable to SQLIAs.
SQLIA Example
SQLIA Example Con..
SQLIA Example con’t
SQLIA Types
• Inband - Error based and Union based. [Some
details are shown to identify sql vulnerability]
• Inferential /Blind– Boolean and TIME based –
sleep.
SQLIA Types
• Error based – using orderby and union
• Boolean based – true or false
• TIME based - sleep
SQLIA Steps using example
• Confirm SQL injection
• Enumerate columns
• Reflection