如何创建 SQL 注入测试站点
我想创建一个简单的登录和注册表单,它允许我演示 SQL 注入,但目前我还无法这样做。每次我尝试使用示例表单时,SQLmap 都无法攻击它。有人可以给我一个非常简单和基本的登录和注册表单,我可以用它来演示 SQL 注入吗?
I want to create a simple login and registration form, that allows me to demonstrate SQL injection, but I haven't been able to do so currently. Every time I attempt a sample form, SQLmap can't attack it. Can somebody give me a very simple and basic login and registration form that I can use to demonstrate SQL injection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需运行最简单的不受保护的查询:
$query = "SELECT * FROM users WHERE username = ".stripslashes($_POST['username'])." AND password = ".stripslashes($_POST['password']) 尽情享受吧
!如果您尚未禁用 magic_quotes(应该如此),则可以使用
stripslashes()
部分,以避免某些自动转义;否则你将拥有最纯粹的可注入输入,只需拿起你可能在互联网上找到的任何 sql 注入并查看即可。一些例子:等等
Just run the simplest unprotected query:
$query = "SELECT * FROM users WHERE username = ".stripslashes($_POST['username'])." AND password = ".stripslashes($_POST['password'])
and enjoy! The
stripslashes()
part is there in case you haven't magic_quotes already disabled (as it should be), to avoid some automatic escaping; otherwise you'll have purest injectable input, just pick up any sql injection you might find on the internet and see. Some example:And so on
如果你喜欢大规模的 sql 测试,有时有一个库可以帮助我:
http://sqlmap.sourceforge.net
它运行了大量的 sqlinjections 测试并返回很棒的报告。
If you like a massive sql test, there are a library that help me sometimes:
http://sqlmap.sourceforge.net
It run a lot of sqlinjections tests and return great report.
Google 查找一些预先存在的页面,即:
http://www.greensql.net/node/3
或者,您可以创建一个基本搜索框来搜索数据库中的表。用随机名称填充表并演示搜索如何工作以及 SQL 注入如何删除表等。
Google for some prexisting pages i.e.:
http://www.greensql.net/node/3
Alternatively, you could just create a basic search box that searches a table in DB. Fill the table with random names and demonstrate how the search works and how SQL injection can drop the table, etc.