1

Below is an example of a JSON payload I'd like to send. How do I wrap the 'value' value so it handles the special characters like ; and " and * and / and carriage returns better?

{
    "type":"INLINE",
    "name":"${varEvidence-1}",
    "value":"GET /mxca/userprofile/us/submenudata.do
     request_type=authreg_submit&page=)(sn%3d HTTP/1.1
     Host: example.com 
     User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) "Gecko"/20100101
     Firefox/31.0
     Accept: /
     Accept-Language: en-US,en;q=0.5
     Accept-Encoding: gzip, deflate
     X-Requested-With: XMLHttpRequest
     Referer: https://example.com//mxca/userprofile/us/submenudata.do
     request_type=authreg_submit&page=*)(sn%3d*
     Cookie:
     keymaster=PMV54Bye4RKtzab8vXdJyW6S8sCDe37OJuw0vx072smBAr7GW8D3rstCzWPUsEU29aM2MLFoglHzhATZISEQyYbsyNvg%3D%3D;
     gatekeeper=4C7205995D7B2AFFA76E7B1335A890FCC4924C9C1E0F554077CDE2A651DD12D0A1CE69FB46D757A75FB64130179FD9001650153DA13887D33581F621453F81F560D81CFCAFE51922B6ADABF8C5A45F932491BA1325866F29B24CB2D73328A0FDBB72F1868E208C1786310849A6E5D2332E045C90CADC559A78DEA614ACE4A18E5262DDD7D9AE9854EB6EA7C9BA8BB68DC3F5DDAEA3C930442FA25FCBAF6D25F5DC6AE0C890E01A83E2CB1E70510B537BF63E653045C3B52B0E5FE728740894D87AA5599885F72DA1FDDF0D8AA9883FB3BE035EBA65CAEC15; 
     blueboxvalues=f93b466e-1f61c944-ba2aec26-cf40345c;
     sessioncookie=easc=D0D8264E667BF43A91A02012B400E9B5A05175762DE38B9FA2D88675680B8419FD83366DE7A706A2E3391F9B0A4FDA9CE7E7168575DF4204233E855BAAC4CD01D386D62B27213A4D7595C69AB6EA15B7770572832321047ABC1627E6F1A1ECE62FAB6532AF78A9E3E888090D3EAFA80C92730CBE395556E578CA2F137E3A121CD20
     Connection: keep-alive",
     "docLockerId":null
}
Coder
  • 2,153
  • 1
  • 16
  • 21
joCha
  • 302
  • 1
  • 6
  • 23

1 Answers1

2

As pet the JSON specs any characters can constitute a string except for " and \. If you have these in your JSON string you need to escape them using \ character.

So you just have to replace the character " with \" and the character \ with \\. Any other special characters are considered as characters in string.

Here is a list of JSON special characters.

\b  Backspace
\f  Form feed
\n  New line
\r  Carriage return
\t  Tab
\"  Double quote
\\  Backslash character

This stack overflow post has a ton of information regarding this question.

You could also use the specs reference for more information.

Community
  • 1
  • 1
Coder
  • 2,153
  • 1
  • 16
  • 21