Zap API中缺少参数用户名错误

时间:2019-01-31 17:35:33

标签: python-3.x owasp zap

我一直在使用Zest登录脚本运行Zap身份验证扫描,但是在更新Zap docker映像后,身份验证已断开-似乎是由于API的更改。

这是我得到的输出:

5309955 [ZAP-ProxyThread-3963] INFO org.parosproxy.paros.control.Control  - New session file created
zap       | 5313051 [ZAP-ProxyThread-3971] INFO org.zaproxy.zap.authentication.ScriptBasedAuthenticationMethodType  - Loaded script for API:login.zst
zap       | 5313633 [ZAP-ProxyThread-3975] WARN org.zaproxy.zap.extension.api.API  - Bad request to API endpoint [/JSON/users/action/setAuthenticationCredentials/] from [10.254.0.6]:
zap       | Missing Parameter (missing_parameter) : Username

这就是我提供身份验证参数的方式:

authmethod_params = ('scriptName=' + auth_script_name + '&'
                     'Submission Form URL={0}/{1}&'
                     'Username field=username&'
                     'Password field=password&'
                     'Target URL=http://www.example.com/login')
 # setup authentication
 auth = zap.authentication
 auth.set_authentication_method(
 contextid=context_id,
 authmethodname=auth_method_name,
 authmethodconfigparams=authmethod_params)

由于某些原因,API无法识别username参数,随后登录失败。您能否提供当前示例,该示例如何将基于脚本的身份验证的登录参数传递给Zap API?

非常感谢

1 个答案:

答案 0 :(得分:0)

找到原因:由于我没有在请求中更新基本的64位编码凭据,因此auth锁定了新用户。