Advanced SQL Injection.pdf

(1008 KB) Pobierz
Advanced SQL Injection
December 2012
Guillaume Loizeau
Regional Sales Manager, DB Security
McAfee
Agenda
• What is SQL Injection
• In-band Injection
• Out-of-band Injection
• Blind Injection
• Advanced techniques
– Infection
– Privilege elevation
– Escape the DB to OS
• Protection against SQL Injection
Introduction
• SQL injection hacks in recent years:
– Heartland Payment Systems (2008) 132M credit cards
– Rock You (2009) 32M accounts
– Sony (2011)
– PBS (2011)
– Yahoo (2012) 500K login stolen
– Wurm Online
– 53 universities hacked (2012)
SQL Injection - Definition
Une injection SQL est un type d'exploitation
d'une faille de sécurité d'une application
interagissant avec une base de données, en
injectant une requête SQL non prévue par
le système et pouvant compromettre sa
sécurité.
Simple SQL Injection
• $name = « stuart » and $password = « stuart »
• SELECT ID FROM user WHERE name = ‘$name' AND password = ‘$passwd';
– Password Validation and access to account ID
– Query executed
• SELECT ID FROM Users WHERE name = ‘stuart‘ AND password = ‘stuart‘;
• $name = « stuart’ – » and $password = « it_does _not_matter »
• SELECT ID FROM Users WHERE name = ‘stuart '
--
' AND password =
‘it_does _not_matter';
– No Password evaluation in the query and access to account ID
– Query executed
• SELECT ID FROM Users WHERE name = ‘stuart';
Zgłoś jeśli naruszono regulamin