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?

1
  • can you post your code
    – MikeSchem
    Commented Mar 13, 2020 at 19:51

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .