From 6cfa91655e7fd6d3d35d85c6674ed7c41602b9b5 Mon Sep 17 00:00:00 2001 From: shivaaz Date: Sun, 8 Dec 2024 12:29:04 -0500 Subject: [PATCH] correct issue with rbcd.py --- nxc/modules/rbcd.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/nxc/modules/rbcd.py b/nxc/modules/rbcd.py index f51daedae..71ba8b90c 100644 --- a/nxc/modules/rbcd.py +++ b/nxc/modules/rbcd.py @@ -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 @@ -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 """