Skip to content

Commit

Permalink
correct issue with rbcd.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaaz-fr committed Dec 8, 2024
1 parent 144c0ce commit 6cfa916
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions nxc/modules/rbcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,22 @@ def options(self, context, module_options):

def on_login(self, context, connection):

# Firstable we check if webdav client is enable on target / if not quit
try:
remote_file = RemoteFile(connection.conn, "DAV RPC Service", "IPC$", access=FILE_READ_DATA)
remote_file.open_file()
remote_file.close()

context.log.highlight(self.output.format(connection.conn.getRemotehost()))

except SessionError as e:
if e.getErrorCode() == nt_errors.STATUS_OBJECT_NAME_NOT_FOUND
return
elif e.getErrorCode() in nt_errors.ERROR_MESSAGES:
context.log.fail(f"Error enumerating WebDAV: {e.getErrorString()[0]}", color="magenta")
else:
raise e
# Firstable we check if webdav client is enable on target / if not quit
try:
remote_file = RemoteFile(connection.conn, "DAV RPC Service", "IPC$", access=FILE_READ_DATA)
remote_file.open_file()
remote_file.close()

# We assume webdav client is enable on target, we can continue with coerce's method check !
context.log.highlight(self.output.format(connection.conn.getRemotehost()))

except SessionError as e:
if e.getErrorCode() == nt_errors.STATUS_OBJECT_NAME_NOT_FOUND:
return
elif e.getErrorCode() in nt_errors.ERROR_MESSAGES:
context.log.fail(f"Error enumerating WebDAV: {e.getErrorString()[0]}", color="magenta")
else:
raise e
# We assume webdav client is enable on target, we can continue with coerce's method check
runmethod = False
if self.method == "all" or self.method[:1] == "d": # DFSCoerce
runmethod = True
Expand Down Expand Up @@ -95,8 +93,8 @@ def on_login(self, context, connection):
context.log.debug("Target is not vulnerable to DFSCoerce")
except Exception as e:
context.log.error(f"Error in DFSCoerce module: {e}")

""" DFSCOERCE END """

if self.method == "all" or self.method[:1] == "s": # ShadowCoerce
runmethod = True
""" ShadowCoerce START """
Expand Down

0 comments on commit 6cfa916

Please sign in to comment.