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

Enhancement: adding SessionHandling controller #74

Open
virusvfv opened this issue Jun 20, 2022 · 4 comments
Open

Enhancement: adding SessionHandling controller #74

virusvfv opened this issue Jun 20, 2022 · 4 comments

Comments

@virusvfv
Copy link
Contributor

I think that JWT4B needs supporting for burp SessionHandling. (ex: it would be sessionhandling controller or some else)..
On other words, we set signing algorithm an signing key and use JWT4B as SessionHandling extension to re-sign every JWT that correspond our session rules (for example: every JWT in packets to login.microsoftonline.com).
With this feature we can automatically fuzz fields inside JWT with Burp.

@ozzi-
Copy link
Owner

ozzi- commented Jun 29, 2022

Can you send me any link to get started / read about this matter?

@virusvfv
Copy link
Contributor Author

I'll check some ideas about it and will be back after couple days...

@virusvfv
Copy link
Contributor Author

virusvfv commented Jul 2, 2022

Hi once more...)
After some experiments with burp and jwt's I got next idea...
Suppose we have some JWT (in decoded view)

Headers = {
  "typ": "JWT",
  "alg": "HS256",
  "someeader1": "blabla1",
  "someeader2": "blabla2"
}
Payload = {
  "payload1": "payloadstring",
  "payload2": "true",
}
Signature = "12345"

and we want to fuzz someheader1 and payload1.
We can't do this with burp intruder or burp scanner. We can do this only with repeater and JWT4B in manual mode using HS256 or RSA key to correct sign every time.
So my idea is:
Let put our JWT in CLEARTEXT in Intruder or Repeated, give it some "brackets" (for ex: JWTFUZZ words) and make some extension that will encode and sign JWT inside our "brackets".
So our request in intruder will be:

POST  /jwtlogin
Cookie: blabla
Authorization: Bearer JWTFUZZ
Headers = {
  "typ": "JWT",
  "alg": "HS256",
  "someeader1": "blabla1",
  "someeader2": "blabla1"
}
Payload = {
  "payload1": "payloadstring",
  "payload2": "true",
}
Signature = "12345"JWTFUZZ
Accept: application/json
Content-Length: 2716

Therefor JWT4B must search "brackets", parse jsons inside "brackets", encode it to correct JWT and sign it with HS256 or RSA key.
To do this (I think) JWT4B must have some SessionHandler controller that will be parse requests and resign it automatically.
With this option we can simply set FUZZpoint in intruder or scanner and start fuzzing.

As example and as temporary solution I created Jython script which do this with BurpScripter extension:

https://github.com/virusvfv/burpscripts/blob/master/jwtfuzz.py

I tested it with MS Office365 JWTs. It works. Unfortunately to make it works we have to do many additional doings with burp: install jython, correct setup jython in burp, install additional libs (such as pyjwt, hashlib and others), etc...

So if you have some free time you would create similar functionality for JWT4B. It would be nice to have all in one burp extension..

@ozzi-
Copy link
Owner

ozzi- commented Jul 13, 2022

Hi @virusvfv
Thank you for the elaborations, I was very busy at work and only managed to read this now.
Starting next week I will be on an extended holiday.
When I return, I will give this a try - maybe somebody else has some time until then.

Best regards & see you

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

No branches or pull requests

2 participants