简体   繁体   English

通过表单输入进行SQL注入攻击

[英]SQL Injection Attack through form input

Hi I want to show sql injection vulnerability through form input using PHP and MYSQL. 嗨,我想通过使用PHP和MYSQL的表单输入显示sql注入漏洞。 Any suggestion how to go about. 任何建议如何进行。

Thanks 谢谢

You can use Kali Linux to hack into the php website. 您可以使用Kali Linux入侵php网站。 Here is a tutorial on how to do that. 这是有关如何执行此操作的教程

mysql_query("INSERT INTO `table` (`column`) VALUES ('$inject_variable')");

If you have query like this you can insert something like value'); DROP TABLE table;-- 如果您有这样的查询,则可以插入类似value'); DROP TABLE table;-- value'); DROP TABLE table;-- to the $inject_variable to test the injection. value'); DROP TABLE table;--$inject_variable来测试注入。

Hence, your SQL query will became this: 因此,您的SQL查询将变为:

INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')

This will allow other users to drop the table. 这将允许其他用户删除表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM