From e96cd14a1aa7882e7d403869c869704ad815c7ec Mon Sep 17 00:00:00 2001 From: Korving-F Date: Thu, 13 Jul 2023 12:44:28 +0300 Subject: [PATCH] Adds additional check to make sure JSON object is valid when IP lookup error occurs. --- jarm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jarm.py b/jarm.py index 2f59423..cf205ea 100644 --- a/jarm.py +++ b/jarm.py @@ -511,7 +511,10 @@ def main(): else: file.write(destination_host + "," + ip + "," + result) else: - file.write(destination_host + ",Failed to resolve IP," + result) + if args.json: + file.write('{"host":"' + destination_host + '","ip":"' + 'Failed to resolve IP' + '","result":"' + result + '"') + else: + file.write(destination_host + ",Failed to resolve IP," + result) #Verbose mode adds pre-fuzzy-hashed JARM if args.verbose: if args.json: