Island: Fix processing exploit credentials encrypt/decrypt

This commit is contained in:
Ilija Lazoroski 2022-07-27 15:11:47 +02:00
parent 8c6e4dbc90
commit a1896de9c8
2 changed files with 5 additions and 3 deletions

View File

@ -31,7 +31,7 @@ def censor_password(password, plain_chars=3, secret_chars=5):
"""
if not password:
return ""
password = get_datastore_encryptor().decrypt(password)
password = get_datastore_encryptor().decrypt(password.encode()).decode()
return password[0:plain_chars] + "*" * secret_chars
@ -45,5 +45,5 @@ def censor_hash(str_hash, plain_chars=5):
"""
if not str_hash:
return ""
str_hash = get_datastore_encryptor().decrypt(str_hash)
str_hash = get_datastore_encryptor().decrypt(str_hash.encode()).decode()
return str_hash[0:plain_chars] + " ..."

View File

@ -52,4 +52,6 @@ def encrypt_exploit_creds(telemetry_json):
credential = attempts[i][field]
if credential: # PowerShell exploiter's telem may have `None` here
if len(credential) > 0:
attempts[i][field] = get_datastore_encryptor().encrypt(credential)
attempts[i][field] = (
get_datastore_encryptor().encrypt(credential.encode()).decode()
)