您好,我正在开发一个网站并进行一些渗透测试。它是在 CakePHP 中构建的,它让我意识到:
CakePHP already protects you against SQL Injection if you use CakePHP's ORM methods (such as find() and save()) and proper array notation (ie. array('field' => $value)) instead of raw SQL.
但是我不确定要在我的输入表单字段中输入哪些数据以测试 SQL 注入(inject)预防。
我有以下具有简单 VARCHAR 属性的表名 -
categories: name
clients: address, county, country, name
items: name
statuses: name
将此 SQL 语句输入表单并提交是否是测试 SQL 注入(inject)尝试的正确方法?
DROP TABLE "categories";
在表单上提交后,输入数据库的值为:
DROP TABLE "categories";
我是否可以假设这意味着该网站已免受 SQL 注入(inject)攻击,因为它没有在我的数据库中删除类别表?
最佳答案
当您的代码未使用参数化查询时发生 SQL 注入(inject)攻击。SQL 注入(inject)工具在 How can I test my web site for SQL injection attacks? .
关于mysql - SQL注入(inject)测试的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10673731/