From 993427d776c8799d8166edc99c4a686af4165360 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Mon, 6 Mar 2023 15:56:54 +0000 Subject: [PATCH 1/2] Fixed ability to update a value to an array --- jwt_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwt_tool.py b/jwt_tool.py index 9647dbe..0d1512d 100644 --- a/jwt_tool.py +++ b/jwt_tool.py @@ -589,7 +589,7 @@ def crackSig(sig, contents): cprintc(utf8errors, " UTF-8 incompatible passwords skipped", "cyan") def castInput(newInput): - if "{" in str(newInput): + if "{" or "[" in str(newInput): try: jsonInput = json.loads(newInput) return jsonInput From 1989527a77346397a84d9c1a1d7bae414fa09a2d Mon Sep 17 00:00:00 2001 From: Lloyd White Date: Mon, 6 Mar 2023 16:15:08 +0000 Subject: [PATCH 2/2] Extended castInput to recognise JSON with single quotes, along with double quotes --- jwt_tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jwt_tool.py b/jwt_tool.py index 0d1512d..30968ac 100644 --- a/jwt_tool.py +++ b/jwt_tool.py @@ -594,7 +594,11 @@ def castInput(newInput): jsonInput = json.loads(newInput) return jsonInput except ValueError: - pass + try: + jsonInput = json.loads(newInput.replace("'", "\"")) + return jsonInput + except ValueError: + pass if "\"" in str(newInput): return newInput.strip("\"") elif newInput == "True" or newInput == "true":