SQL Injection – A Quick Overview —
One of the most common attacks today is called a “SQL Injection” attack. SQL injection attacks are most common against hastily or sloppily written GUI interfaces. It’s also the reason that a good database uses things like stored procedures, though that’s hardly an protection.
Let’s execute a basic injection attack: When you’re filling out some form with, let’s say a search for products, enter the data in the search field like this:
RAM’ OR ’1=1
See… what happens is that when the program reads the input string for, let’s say just RAM, and drops that in the query it ends up looking like this:
SELECT * FROM products WHERE name is like ‘%RAM%’
or something. So then with our bad product search it looks more like SELECT * FROM products WHERE name is like ‘%RAM%’ OR 1=1
And since 1 always equals 1, then you see all products. And if you do – then you’ve got a system to work with.