We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am trying to solve this lab from PortSwigger academy using jwt_tool.
jwt_tool
In order to solve the lab, one needs to inject a jwk into jwt header, like the following:
{ "kid": "76e1647e-29a6-4555-bfb1-ce848c18cbd5", "typ": "JWT", "alg": "RS256", "jwk": { "kty": "RSA", "e": "AQAB", "kid": "76e1647e-29a6-4555-bfb1-ce848c18cbd5", "n": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }
Also modify the payload to change sub into administrator:
sub
administrator
{ "iss": "portswigger", "exp": 1732711092, "sub": "administrator" }
Then sign the jwt with injected key in jwk.
So far I've tried different combinations of options to obtain the requested JWT, without success.
For example I've tried:
jwt_tool.py -t {URL} -rc 'session={JWT}' -I -pc sub -pv administrator -v
And got the jwt with modified payload:
Token: {"kid":"d2021ecd-3c75-4ca0-8715-e6b9829f930e","alg":"RS256"}.{"iss":"portswigger","exp":1732710178,"sub":"administrator"}.xxxxxxxxxxxxxxx
But then how can I use it with option -X i to inject inline jwt ?
-X i
The text was updated successfully, but these errors were encountered:
I came here for this as I wanted to inspect the source to find if this is a bug. I'm glad (so to speak) that somebody else has the same issue.
Now using jwt_tool with -X i injects the JWK but does not change the kid:
kid
This means that the server-side will be verifying the JWT payload using the signature from the original key (d2a8...).
d2a8...
What you need to do is update the kid to match with the following parameters:
-hc kid -hv jwt_tool
This makes the kid refer to the injected JWK:
Sorry, something went wrong.
I've created a fix here if you want to test this version with your original parameters?
No branches or pull requests
Hi,
I am trying to solve this lab from PortSwigger academy using
jwt_tool
.In order to solve the lab, one needs to inject a jwk into jwt header, like the following:
Also modify the payload to change
sub
intoadministrator
:Then sign the jwt with injected key in jwk.
So far I've tried different combinations of options to obtain the requested JWT, without success.
For example I've tried:
And got the jwt with modified payload:
But then how can I use it with option
-X i
to inject inline jwt ?The text was updated successfully, but these errors were encountered: