Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json requests do not parse correctly #12

Open
arthusu opened this issue Jul 30, 2021 · 3 comments
Open

json requests do not parse correctly #12

arthusu opened this issue Jul 30, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@arthusu
Copy link

arthusu commented Jul 30, 2021

When configured:

2021-07-29 20_12_37-Burp Suite Professional v2021 7 2-8935 (Early Adopter) - prueba - licensed to Co

It decrypts but does not parse correctly causing requests not to be processed.
Double quotation marks cause problems:

2021-07-29 19_59_38-Burp Suite Professional v2021 7 2-8935 (Early Adopter) - prueba - licensed to Co

If I modify with single quotes it works fine:

2021-07-29 20_09_45-Burp Suite Professional v2021 7 2-8935 (Early Adopter) - prueba - licensed to Co

Is there any way to make this pair up correctly?
I really appreciate the creation of the extension it's great.

@d3vilbug
Copy link
Contributor

This is what causing issues to you ...... as Burp doesn't provide any interface for JSON parameter update like normal POST/GET parameter update so have written a manual parser that is parsing JSON as highlight below

image

where I am getting indexes on the basis of "
like

body = {"data":"abc", "key":"123"}

and the above code is parsing like below

int _fi = messageBody.indexOf(_params[i]);
if(_fi < 0) { continue; }

_fi = _fi + _params[i].length() + 3;
int _si = messageBody.indexOf("\"", _fi);
 

int _fi = body.indexof("data");
_fi = _fi + _fi.length + 3 // which is the index of data variable's value abc

and after this getting the closure of the data variable's value by checking the next occurrence of " in the string

So when you will change ' to " it will only parse till the first occurrence of " (DQ) and hence no solution as you have to customize it according to this special case.

@d3vilbug d3vilbug added the enhancement New feature or request label Jul 30, 2021
@d3vilbug
Copy link
Contributor

d3vilbug commented Jul 30, 2021

a quick solution for this

parse it by searching the next occurrence of ", instead of " so in this way you can work with double quote too

But it might disturb your flow ... where your parameter is at the end / last and the code will not be able to find the next ", so need to add both cases here for such cases

@d3vilbug
Copy link
Contributor

d3vilbug commented Jul 30, 2021

@arthusu

replace the highlighted line with this snippet and compile again .....

 int _si = messageBody.indexOf("]\",", _fi);
if(_si < 0){
     _si = messageBody.indexOf("\"", _fi);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants