From 85bafe1670f23939290bae89113507cfea280925 Mon Sep 17 00:00:00 2001 From: trietend <212042+trietend@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:36:29 +0100 Subject: [PATCH] fixed encoding issues --- utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.py b/utils.py index e861b7e..61de23b 100644 --- a/utils.py +++ b/utils.py @@ -401,6 +401,11 @@ def SaveToDb(result): for k in [ 'module', 'type', 'client', 'hostname', 'user', 'cleartext', 'hash', 'fullhash' ]: if not k in result: result[k] = '' + if isinstance(result[k], str) and '\x00' in result[k]: + # some strings have a mixed encoding in a single string + # correct decoding is not possible + result[k] = result[k].replace("\x00","") + result['client'] = result['client'].replace("::ffff:","") if len(result['user']) < 2: print(color('[*] Skipping one character username: %s' % result['user'], 3, 1))