出于学术目的,我需要在表单参数上爆炸一个使用POST方法发送的盲sql注入。表单非常简单,它只有一个输入文本框,可以在其中介绍用户的名称和提交按钮,生成的输出只是通知被导入用户的存在与否。html代码是:
<html>
<head>
<title>User info</title>
</head>...
<p> Introduce an user to check if it's in the database </p>
<form method="post">
User <input type="text" value="" name="user">
<input type="submit" value="Check!">
</form>
<hr>
</center>
</html>我知道‘来宾’是一个有效的用户名(返回true),我通过引入来宾‘和'1'= '1’(返回真)和‘1’= '0‘(返回false),手动检查了它是否容易受到盲目sql注入的影响。一旦确定它是易受攻击的,我就尝试使用sqlmap来使用下面的命令来爆炸该漏洞:
# sqlmap -u "http://foo.com/checkuserform" --method "POST" --data "user=guest" --dbms "mysql" -p "user"但它似乎无法引爆这个漏洞:
...
**[00:23:01] [WARNING] the web server responded with an HTTP error code (405) which could interfere with the results of the tests**
[00:23:01] [INFO] testing if the target URL is stable
[00:23:02] [INFO] target URL is stable
[00:23:02] [WARNING] heuristic (basic) test shows that POST parameter 'user' might not be injectable
...
**[00:23:18] [WARNING] POST parameter 'user' is not injectable**
[00:23:18] [CRITICAL] all tested parameters appear to be not injectable. Try to increase '--level'/'--risk' values to perform more tests. Also, you can try to rerun by providing either a valid value for option '--string' (or '--regexp') If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could retry with an option '--tamper' (e.g. '--tamper=space2comment')
[00:23:18] [WARNING] HTTP error codes detected during run:
405 (Method Not Allowed) - 175 times让我吃惊的是HTTP 405错误,因为我在sqlmap命令中强制使用POST (如果我用浏览器手动检查它,我就无法再现这个错误)。我还尝试过增加级别和风险参数的值,但没有成功。你知道为什么会这样吗?
发布于 2015-12-22 11:21:21
使用SQLmap的首选方法是使用通过Burp代理的浏览器提交请求,将请求从Burp复制到文本文件中,然后使用指向文本文件的-r参数调用sqlmap。
这将确保提交到正确的位置,并具有所需的标头和cookie。
在这种情况下,我怀疑您是POSTing到了错误的位置--从您的描述来看,它可能是对后端服务进行Javascript调用,然后提供警告框或更新页面上的内容。使用代理来观察这一点将允许您检查,即使页面上的脚本是模糊的或过于复杂的,以便进行合理的检查。
https://security.stackexchange.com/questions/108739
复制相似问题