SQL Injection Attacks
SQL Injection Attacks
- Navneet Gupta
SELECT productdata FROM table WHERE productname = user input product name;
A SQL injection attack involves placing SQL statements in the user input
blah OR x = x
This input is put directly into the SQL statement within the Web application:
SELECT prodinfo FROM prodtable WHERE prodname = blah; DROP TABLE prodinfo; --
Often can gain access to other users system capabilities by obtaining their password
DEFENSES
Many attacks can be thwarted by simply using the SQL string escaping mechanism
\ and \
MORE DEFENSES
Scan query string for undesirable word combinations that indicate SQL statements
INSERT, DROP, etc. If you see these, can check against SQL syntax to see if they represent a statement or valid user input