SQLMAP在响应中不匹配字符串
我正在使用SQLMAP进行测试SQL注射在登录表单上,当服务器验证凭据验证时,它将返回HTTP 200状态代码和响应主体:{“代码”:1} )或
{“代码”:0}
(在无效的凭据)上。
由于状态代码始终为200,我需要SQLMAP来查找身体中的该字符串,因此我找到了以下参数:
- 字符串=字符串匹配到查询到true时)
我是这样使用的: sqlmap -u https://example.com/login-method =“ post” - -data“ user = 1& password = 2” - text -lyly -snly -string ='{“ code”:0:0 }'-v 6
但是,当SQLMAP接收{“代码”:1}
从服务器忽略它而不是将其作为成功的注入。
我做错了什么,或者关于如何在响应中匹配该字符串的想法?
这是完整的服务器响应:
HTTP/1.1 200 OK
Server: Apache/2.4.25 (Debian)
Content-Length: 15
Connection: close
Content-Type: text/html; charset=UTF-8
{"code":0}
预先感谢。
I'm using SQLMap for test SQL Injections on a login form, when the server validates credentials it returns an HTTP 200 Status Code and in the response body: {"code":1}
(on valid credentials) or {"code":0}
(on invalid credentials).
Since the status code is always 200 I need SQLMap to look for that string in the body, I found the following parameter:
--string=STRING String to match when query is evaluated to True)
I'm using it like this:sqlmap -u https://example.com/login --method="POST" --data "user=1&password=2" --text-only --string='{"code":0}' -v 6
But when SQLMap receives {"code":1}
from the server just ignores it instead of detecting it as a successful injection.
Is there something I'm doing wrong or any ideas of how can I match that string in the response?
Here is the full server response:
HTTP/1.1 200 OK
Server: Apache/2.4.25 (Debian)
Content-Length: 15
Connection: close
Content-Type: text/html; charset=UTF-8
{"code":0}
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这很晚,但也许会对某人有所帮助。
根据SQLMAP帮助(SQLMAP -HH),您可以通过成功或失败响应中的内容过滤响应,还可以代码或成功的代码或标题。
在您的情况下,它将是
sqlmap ...--弦'{“ code”:1}'
或者
sqlmap ...---not-string'{“ code”:0}'
简约版本也应起作用
sqlmap ...-弦乐'1'
I know it's quite late but maybe it will help someone.
According to sqlmap help (sqlmap -hh) you can filter responses via content in successful or failed response and also code or title of successful one.
In your case it would be
sqlmap ... --string '{"code":1}'
or
sqlmap ... --not-string '{"code":0}'
minimalist version should work too
sqlmap ... --string '1'