I want to test an application wich uses a form based
application. I followed the tutorial
(
https://www.alldaydevops.com/zap-in-ten) and set up everything up
accordingly. However the login does not work. I analyzed the requests and
the app has the CSRF set. It is using '_csrf' which is already in
Anti-CSRF Tokens list. However I don't see it in the actual
authentication POST request.
Since the csrf token is generated dynamically it needs to be extracted on the fly. In a request before the actual authentication it is passed in a hidden input field e.g.:
<input type="hidden" name="_csrf" value="d8c23bke-6432-1234-91ba-bb5ea1op55zc"/>
When the actual POST login request is fired it needs to be passed to the POST data:
(Taken from session properties \ authentication \ Form-based authentication\Login Request POST Data (if any))
username={%username%}&password={%password%}&_csrf={CSRF-2-Go-In-Here}
Now I did a bit of research and it seems that support for this was added a while ago:
So how can I reference the csrf token which has been detected before inside the authentication mechanism? I tried _csrf={%_csrf%} but the variable is not replaced.
Or do I need to setup a ZEST script for that? (Which I wanted to avoid but if its the only way then be it)
Thanks!