From 876cdbeffa781bb06f92fcf762df5b57a150ac35 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 25 Aug 2021 19:31:36 +0530 Subject: [PATCH] island: Check if credential in exploit telemetry is `None` before processing it --- .../cc/services/telemetry/processing/exploit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/telemetry/processing/exploit.py b/monkey/monkey_island/cc/services/telemetry/processing/exploit.py index 6eb759b21..7fa5654c5 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/exploit.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/exploit.py @@ -74,5 +74,6 @@ def encrypt_exploit_creds(telemetry_json): for i in range(len(attempts)): for field in ["password", "lm_hash", "ntlm_hash"]: credential = attempts[i][field] - if len(credential) > 0: - attempts[i][field] = get_encryptor().enc(credential) + if credential: # PowerShell exploiter's telem may have `None` here + if len(credential) > 0: + attempts[i][field] = get_encryptor().enc(credential)