ticarpi / jwt_tool

:snake: A toolkit for testing, tweaking and cracking JSON Web Tokens
GNU General Public License v3.0
5.46k stars 670 forks source link

TIMESTAMP Error #20

Closed m7x closed 4 years ago

m7x commented 4 years ago

Hello there,

I get the following error message. It looks like it is failing on the TIMESTAMP:

> python3 jwt_tool.py [JWT_TOKEN]

=====================
Decoded Token Values:
=====================

Token header values:
[+] typ = "JWT"
[+] alg = "HS512"

Token payload values:
[+] UserId = "215"
[+] App = "C467**********************"
[+] iss = "************* JWT"
[+] VenueId = 265
[+] UserName = "*************"
[+] VenueName = "*************"
[+] VenueType = 1
[+] SysCategory = 0
[+] aud = "C46***************************************"
[+] exp = 1594211740    ==> TIMESTAMP = 2020-07-08 13:35:40 (UTC)
Traceback (most recent call last):
  File "jwt_tool.py", line 1483, in <module>
    rejigToken(headDict, paylDict, sig)
  File "jwt_tool.py", line 1280, in rejigToken
    comparestamps, expiredtoken = dissectPayl(paylDict)
  File "jwt_tool.py", line 1171, in dissectPayl
    timestamp = datetime.datetime.fromtimestamp(int(paylDict[claim]))
ValueError: invalid literal for int() with base 10: '07/07/2020 12:35:40'

Thanks

m7x commented 4 years ago

The value of the iat is 07/07/2020 12:35:40 . jwt_tool is expecting a timestamp and that's why is failing.

ticarpi commented 4 years ago

Yes, looks like the token you're testing is having fun with the RFCs. Fairly uncommon issue, but I might something to handle errors like this gracefully in v2.0