How to Match & Replace a JSON Response Body for any specific value in Burpsuite

JSON Response Body:-

{ "field1":value1, "field2":value2, "field3":value3, "field4":value4, "field5":value5 } 

I need to replace specific value of field3 in above JSON response to some other value e.g. valueX

Tried Burpsuite > Proxy > Options > Match and Replace

Enabled: True

Item: Response Body

Match: ^"field3":value3$

Replace: "field3":valueX"

Type: Regex

Expected JSON

{ "field1":value1, "field2":value2, "field3":valueX, "field4":value4, "field5":value5 } 

Thanks

1

1 Answer

Your regular expression doesn't exactly match the line field3 line. For example, you have a leading space on that line, so ^" will not match.

I recommend you simplify the expression a little:

Match: "field3":value3 Replace: "field3":valueX 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like