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

Fixed improper exception handling of lsass dump parsing #538

Merged
merged 2 commits into from
Jun 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cme/modules/lsassy_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,18 @@ def on_admin_login(self, context, connection):
if dumper is None:
context.log.error("Unable to load dump method '{}'".format(self.method))
return False

file = dumper.dump()
if file is None:
context.log.error("Unable to dump lsass")
return False

credentials, tickets = Parser(file).parse()
parsed = Parser(file).parse()
if parsed is None:
context.log.error("Unable to parse lsass dump")
return False
credentials, tickets = parsed

file.close()
ImpacketFile.delete(session, file.get_file_path())
if credentials is None:
Expand All @@ -79,6 +85,7 @@ def process_credentials(self, context, connection, credentials):
if len(credentials) == 0:
context.log.info("No credentials found")
credz_bh = []
domain = None
for cred in credentials:
domain = cred["domain"]
if "." not in cred["domain"] and cred["domain"].upper() in connection.domain.upper():
Expand Down