Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfixes: add-computer & nanodump modules #237

Merged
merged 4 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
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)

NeffIsBack marked this conversation as resolved.
Show resolved Hide resolved

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)
NeffIsBack marked this conversation as resolved.
Show resolved Hide resolved
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
Loading