forked from p15670423/monkey
Island: Fix processing exploit credentials encrypt/decrypt
This commit is contained in:
parent
8c6e4dbc90
commit
a1896de9c8
|
@ -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] + " ..."
|
||||
|
|
|
@ -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()
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue