繁体   English   中英

Owasp ZAP在活动扫描期间未使用“基于表单的身份验证” ON python项目执行身份验证

[英]Owasp ZAP not performing authentication during active scan using “Form-Based-Authentication” ON python project

我在基于owasp zap表单的身份验证上遇到障碍。 我按照指南设置zap属性。 当我运行主动扫描时,“尝试登录时会出现FORBIDDEN错误。CSRF令牌不可用。

Owasp ZAP在使用“基于表单的身份验证” ON python项目的主动扫描期间未执行身份验证。

[ 这是我的zap屏幕 我的目标网址是:

http://example.com:84/admin/login/?next=/admin/

发布数据 ;

csrfmiddlewaretoken=IjYwHHavnCYgcWYMy2oL3L9Z0ldUH95s&username={%username%}&password={%password%}&next=%2Fadmin%2F

这是我得到的html响应:

<div id="summary">
  <h1>Forbidden <span>(403)</span></h1>
  <p>CSRF verification failed. Request aborted.</p>


</div>

<div id="info">
  <h2>Help</h2>

    <p>Reason given for failure:</p>
    <pre>
    CSRF token missing or incorrect.
    </pre>


  <p>In general, this can occur when there is a genuine Cross Site Request Forgery, or when
  <a
  href="https://docs.djangoproject.com/en/1.8/ref/csrf/">Django's
  CSRF mechanism</a> has not been used correctly.  For POST forms, you need to
  ensure:</p>

  <ul>
    <li>Your browser is accepting cookies.</li>

    <li>The view function passes a <code>request</code> to the template's <a
    href="https://docs.djangoproject.com/en/dev/topics/templates/#django.template.backends.base.Template.render"><code>render</code></a>
    method.</li>

    <li>In the template, there is a <code>{% csrf_token
    %}</code> template tag inside each POST form that
    targets an internal URL.</li>

    <li>If you are not using <code>CsrfViewMiddleware</code>, then you must use
    <code>csrf_protect</code> on any views that use the <code>csrf_token</code>
    template tag, as well as those that accept the POST data.</li>

  </ul>

  <p>You're seeing the help section of this page because you have <code>DEBUG =
  True</code> in your Django settings file. Change that to <code>False</code>,
  and only the initial error message will be displayed.  </p>

  <p>You can customize this page using the CSRF_FAILURE_VIEW setting.</p>
</div>

身份验证时,Unfortunatley ZAP当前不支持CSRF令牌的自动再生。

一种解决方法是记录Zest身份验证脚本-确保从请求生成该令牌的页面令牌开始。

常见问题解答中涵盖了记录Zest脚本的问题(否则是无关的): https : //github.com/zaproxy/zaproxy/wiki/FAQreportFN

https://groups.google.com/group/zaproxy-users上进行身份验证时, 随时为我们提供有关支持ACSR toeksn的麻烦:

暂无
暂无

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

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