Sayed Ahmad Naweed
of 30,000 websites
tested by WhiteHat
Sentinel had at least
one serious
vulnerability.
86%
Source: https://www.whitehatsec.com/statistics-report/featured/2015/05/21/statsreport.html
of these vulnerabilities
were resolved.
61%
Source: https://www.whitehatsec.com/statistics-report/featured/2015/05/21/statsreport.html
193 Days
From a single injection we
accessed EVERYTHING
Why do you put such faith
in a company that allows
itself to become open to
these simple attacks?
“
”
“
”
LulzSec
Source: http://www.theguardian.com/technology/2012/aug/29/lulzsec-hacker-arrest-sony-attack
SQL is used to communicate
with a relational database.
SQL
When an attacker attempts to
change the logic, semantics or
syntax of a legitimate SQL
statement by inserting new
SQL keywords or operators into
the statement.
Source: Halfond, William GJ, and Alessandro Orso. "AMNESIA: analysis and monitoring for NEutralizing SQL-injection attacks." Proceedings of the
20th IEEE/ACM international Conference on Automated software engineering. ACM, 2005.
SQL Injection
SQL
Example
#1
SELECT * FROM USERS
WHERE
Username = “sayed”
SELECT * FROM USERS
WHERE
Username = “sayed”“
SELECT * FROM USERS
WHERE
Username = “sayed”; Drop All
DATABASES
;DROP ALL DATABASES;
Example
#2
OR ‘1’ = ‘1’
SELECT * FROM USERS
WHERE
username = “sayed”
AND
Password =“1234” or ‘1’ = ‘1’
Live Demo
http://sqlzoo.net/hack/
Prevention Techniques
Scape
Characters
mysql_real_escape_string(Query)
Prepared
Stetement
SELECT * FROM USERS
WHERE
username = ?
Conclusion
• Your vulnerable if you do not use prepared
statement.
• Don’t forget
As hacks go, there are worst ones!
any question …

SQL Injection