mirror of https://github.com/D4-project/d4-core
chg: [worker2 ja3] add debug
parent
7d96e76690
commit
e4e4d8d57e
|
@ -23,6 +23,7 @@ class TypeHandler(MetaTypesDefault):
|
||||||
self.reconstruct_data(data)
|
self.reconstruct_data(data)
|
||||||
|
|
||||||
def handle_reconstructed_data(self, data):
|
def handle_reconstructed_data(self, data):
|
||||||
|
decoded_data = data.decode()
|
||||||
self.set_last_time_saved(time.time())
|
self.set_last_time_saved(time.time())
|
||||||
self.set_last_saved_date(datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
|
self.set_last_saved_date(datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
|
||||||
|
|
||||||
|
@ -35,7 +36,12 @@ class TypeHandler(MetaTypesDefault):
|
||||||
os.makedirs(jsons_save_dir)
|
os.makedirs(jsons_save_dir)
|
||||||
|
|
||||||
# Extract certificates from json
|
# Extract certificates from json
|
||||||
mtjson = json.loads(data.decode())
|
try:
|
||||||
|
mtjson = json.loads(decoded_data)
|
||||||
|
except Exception as e:
|
||||||
|
print(decoded_data)
|
||||||
|
continue
|
||||||
|
#mtjson = json.loads(decoded_data)
|
||||||
for certificate in mtjson["Certificates"] or []:
|
for certificate in mtjson["Certificates"] or []:
|
||||||
cert = binascii.a2b_base64(certificate["Raw"])
|
cert = binascii.a2b_base64(certificate["Raw"])
|
||||||
# one could also load this cert with
|
# one could also load this cert with
|
||||||
|
@ -50,7 +56,7 @@ class TypeHandler(MetaTypesDefault):
|
||||||
# write json file to disk
|
# write json file to disk
|
||||||
jsons_path = os.path.join(jsons_save_dir, mtjson["Timestamp"]+'.json')
|
jsons_path = os.path.join(jsons_save_dir, mtjson["Timestamp"]+'.json')
|
||||||
with open(jsons_path, 'w') as j:
|
with open(jsons_path, 'w') as j:
|
||||||
j.write(data.decode())
|
j.write(decoded_data)
|
||||||
# Send data to Analyszer
|
# Send data to Analyszer
|
||||||
self.send_to_analyzers(jsons_path)
|
self.send_to_analyzers(jsons_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue