JSON Convertion
Use "Content Type Converter" burp extension
.
It can convert between JSON, XML and Raw HTTP parameters.
Bash Method - Convert JSON to Raw HTTP Parameters
sed -e 's/[{"}]//g' -e 's/:/=/g' -e 's/,/\&/g'
Example
NOTE: The raw HTTP will not be URL encoded
echo '{"email":"[email protected]","password":"test","submit":""}' | sed -e 's/[{"}]//g' -e 's/:/=/g' -e 's/,/\&/g'
JavaScript Method - Convert JSON to Raw HTTP Parameters
- In the browser, open up the Developers Console by pressing
F12
and navigate to theConsole
tab - Enter the following JavaScript into the console
function conv(data){
let op = ""
for (const [key, value] of Object.entries(data)) {
op+= "&"+key+"="+encodeURIComponent(value)
}
return op.substring(1)
}
- Input the JSON code within a variable. Change it accordingly for the JSON request that should be converted
test = {"email":"[email protected]","password":"test","submit":""}
- Call the variable you chose, in this case
test
, with the uploaded JavaScript parameter
conv(test)