1

I'm trying to change the value of a cookie using the Burp option, "Match and Replace". Here is my configuration:

Item:    Request header
Match:   cookieName:.*;
Replace: cookieName:myValue;
Type:    Literal.

Unfortunately, it does not work with this configuration. Do you have any suggestions?

| improve this question | | | | |
  • can you post your code – MikeSchem Mar 13 at 19:51
1

I tried your match-and-replace rule out myself and identified two issues:

  1. Based on RFC6265, the Cookie Header starts with Cookie:, followed by cookieName=cookieValue. This means your rule Match: cookieName:.*; Replace: cookieName:myValue; should instead read Match: cookieName=.*; Replace: cookieName=myValue;
  2. The type should be Regex instead of Literal

This modified rule worked for me:

Item:    Request header
Match:   cookieName=.*;
Replace: cookieName=myValue;
Type:    Regex
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.