The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Help with updating a parameter in Ruby

Denis | Last updated: Dec 15, 2020 06:42PM UTC

We've been using a script to update request headers (e.g., JWT) that we found here: https://raesene.github.io/blog/2016/06/19/Burp-Plugin-JWT-Tokens/ We've had use cases where we need to sign in, capture a CSRF token in a response and use it in subsequent POST requests. I've been having a difficult time with finding burp ruby documentation and examples, but I was hoping someone can help. I only need a snippet of code that will update the csrf post parameter from: macro_response_info = @helpers.analyzeResponse(macroItems[1].getResponse()) I tried using these but don't know what goes into the 3rd argument for buildParameter(). csrf_build_param = @helpers.buildParameter("csrf", "TEST", ) csrf_update_param = @helpers.updateParameter(baseRequestResponse, csrf_build_param) Relevant code: request_info = @helpers.analyzeRequest(baseRequestResponse) macro_response_info = @helpers.analyzeResponse(macroItems[1].getResponse()) #grab cookie value from last request in response macro cookies_array = macro_response_info.getCookies() xsrf_cookie = cookies_array[1] xsrf_cookie_value = xsrf_cookie.getValue() [Need code to update csrf POST parameter for the request with xsrf_cookie_value] Can anyone please assist. The documentation for ruby is difficult to understand.

Hannah, PortSwigger Agent | Last updated: Dec 16, 2020 09:25AM UTC