I want to create a function in PHP that checks how dangerous an SQL statement is. When I say “dangerous,” I mean some characters, characters, or strings that are used to get data from a database that the user should not see.
For instance:
SELECT * FROM users WHERE userId = '1'
can be entered in several ways. Although I clear the parameters, I also want to keep track of how secure the request to run is.
Thanks in advance
, . ( ) , SQL- , , .
. PHP: http://mattbango.com/notebook/web-development/prepared-statements-in-php-and-mysqli/
, , , MySQL, .
, Parametrized Queries - . php/mysql mysql_query(), - - SQL-.
Suhosin Hardened PHP LAMP " SQL-" , , . - (WAF), , SQL- HTTP-. WAF PCI-DSS, , .
GreenSQL, , -. , SQL - , , . , secuirty , . WAF , GreenSQL, , , . , , , .
sql sql-.
"" . . - "O'Reilly" ?
SQL, , SQL. "" - : .
SQL, - , , , . , SELECT * , , .
SELECT *
, :
You may find this helpful: OWASP Top 10 for .NET Developers Part 1: Injection
It is written for .NET developers, but the principles are passed along with PHP.