Skip to content

Commit

Permalink
Merge pull request #237 from Pennyw0rth/marshall-bugfix-3292024
Browse files Browse the repository at this point in the history
bugfixes: add-computer & nanodump modules
  • Loading branch information
Marshall-Hallenbeck authored Apr 5, 2024
2 parents 2d7ac3c + 6104b5d commit 9359ac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions nxc/modules/add-computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from impacket.dcerpc.v5 import samr, epm, transport
import sys


class NXCModule:
"""
Module by CyberCelt: @Cyb3rC3lt
Expand Down Expand Up @@ -41,6 +40,7 @@ def options(self, context, module_options):

if "CHANGEPW" in module_options and ("NAME" not in module_options or "PASSWORD" not in module_options):
context.log.error("NAME and PASSWORD options are required!")
sys.exit(1)
elif "CHANGEPW" in module_options:
self.__noAdd = True

Expand Down Expand Up @@ -87,8 +87,7 @@ def on_login(self, context, connection):
# If SAMR fails now try over LDAPS
if not self.noLDAPRequired:
self.do_ldaps_add(connection, context)
else:
sys.exit(1)


def do_samr_add(self, context):
"""
Expand Down Expand Up @@ -178,7 +177,6 @@ def do_samr_add(self, context):
samr.hSamrLookupNamesInDomain(dce, domain_handle, [self.__computerName])
self.noLDAPRequired = True
context.log.highlight("{}".format('Computer account already exists with the name: "' + self.__computerName + '"'))
sys.exit(1)
except samr.DCERPCSessionError as e:
if e.error_code != 0xC0000073:
raise
Expand Down
2 changes: 1 addition & 1 deletion nxc/modules/nanodump.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def on_admin_login(self, context, connection):
self.context.log.fail(f"Error deleting lsass.dmp file on share {self.share}: {e}")
else:
try:
exec_method = MSSQLEXEC(self.connection.conn)
exec_method = MSSQLEXEC(self.connection.conn, self.context.log)
exec_method.get_file(self.remote_tmp_dir + nano_log_name, filename)
self.context.log.success(f"Dumpfile of lsass.exe was transferred to {filename}")
except Exception as e:
Expand Down

0 comments on commit 9359ac2

Please sign in to comment.