Skip to content

Commit 9359ac2

Browse files
Merge pull request Pennyw0rth#237 from Pennyw0rth/marshall-bugfix-3292024
bugfixes: add-computer & nanodump modules
2 parents 2d7ac3c + 6104b5d commit 9359ac2

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

nxc/modules/add-computer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from impacket.dcerpc.v5 import samr, epm, transport
44
import sys
55

6-
76
class NXCModule:
87
"""
98
Module by CyberCelt: @Cyb3rC3lt
@@ -41,6 +40,7 @@ def options(self, context, module_options):
4140

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

@@ -87,8 +87,7 @@ def on_login(self, context, connection):
8787
# If SAMR fails now try over LDAPS
8888
if not self.noLDAPRequired:
8989
self.do_ldaps_add(connection, context)
90-
else:
91-
sys.exit(1)
90+
9291

9392
def do_samr_add(self, context):
9493
"""
@@ -178,7 +177,6 @@ def do_samr_add(self, context):
178177
samr.hSamrLookupNamesInDomain(dce, domain_handle, [self.__computerName])
179178
self.noLDAPRequired = True
180179
context.log.highlight("{}".format('Computer account already exists with the name: "' + self.__computerName + '"'))
181-
sys.exit(1)
182180
except samr.DCERPCSessionError as e:
183181
if e.error_code != 0xC0000073:
184182
raise

nxc/modules/nanodump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def on_admin_login(self, context, connection):
174174
self.context.log.fail(f"Error deleting lsass.dmp file on share {self.share}: {e}")
175175
else:
176176
try:
177-
exec_method = MSSQLEXEC(self.connection.conn)
177+
exec_method = MSSQLEXEC(self.connection.conn, self.context.log)
178178
exec_method.get_file(self.remote_tmp_dir + nano_log_name, filename)
179179
self.context.log.success(f"Dumpfile of lsass.exe was transferred to {filename}")
180180
except Exception as e:

0 commit comments

Comments
 (0)