Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit c75d7ab

Browse files
authored
Update fix about no credentials
1 parent 622245d commit c75d7ab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cme/modules/lsassy.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ def on_admin_login(self, context, connection):
120120
context.log.error(credentials['error_msg'])
121121
if context.verbose and credentials['error_exception']:
122122
context.log.error(credentials['error_exception'])
123-
elif json.loads(credentials['credentials']).items():
124-
self.process_credentials(context, connection, credentials["credentials"])
125123
else:
126-
context.log.highlight("No credential found :'(")
124+
self.process_credentials(context, connection, credentials["credentials"])
127125

128126

129127
def process_credentials(self, context, connection, credentials):
130-
for domain, creds in json.loads(credentials).items():
128+
credentials = json.loads(credentials)
129+
if len(credentials) == 0:
130+
context.log.info("No credentials found")
131+
for domain, creds in credentials.items():
131132
for username, passwords in creds.items():
132133
for password in passwords:
133134
plain = password["password"]

0 commit comments

Comments
 (0)