2016-09-02 28 views
0

私はowasp zapフォームベースの認証でロードブロッキングに直面しています。私は、ガープごとにセットアップzapプロパティです。私は、「それはFORBIDDENエラーを与えるログイン試行するとき。CSRFトークンは使用できません。Owasp ZAPが "フォームベース認証"を使用してアクティブスキャン中に認証を実行しないpythonプロジェクト

OWASP ZAPが使用してアクティブスキャン時の認証を行っていない 『アクティブスキャンを実行すると、Pythonのプロジェクトでフォームベース認証を』。

[ here is my zap screen 私のターゲットURLは次のとおりです。

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

ポストデータ、ここ

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

は、HTMLの再です私が得たsponse:

<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> 

答えて

1

Unfortunatley ZAPのdoesntのは、現在、認証時にCSRFの自動再生がトークンをサポートします。

これを回避するには、Zest認証スクリプトを記録することです。まず、そのトークンを生成するページトークンを要求することから始めてください。

録音ゼストスクリプトが(そうでない場合は無関係である)このFAQでカバーされています@Psiinon https://github.com/zaproxy/zaproxy/wiki/FAQreportFN

https://groups.google.com/group/zaproxy-usersに認証時にACSR toeksnを支援についての私達に面倒気軽に:)

+0

感謝 –

関連する問題