From 3808655afa7423469b920bc5196e518309904f41 Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sun, 20 Sep 2026 06:20:05 -0400 Subject: [PATCH] Add big timeout for backup-operator module for larger hives --- nxc/modules/backup_operator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nxc/modules/backup_operator.py b/nxc/modules/backup_operator.py index 857f6d42..7cba3a98 100644 --- a/nxc/modules/backup_operator.py +++ b/nxc/modules/backup_operator.py @@ -37,6 +37,8 @@ class NXCModule: dce = NXCRPCConnection(connection).connect(r"\winreg", rrp.MSRPC_UUID_RRP) try: + # Large hives can take minutes to save before the RPC call returns. + connection.conn.setTimeout(max(connection.args.smb_timeout, 60)) for hive in ["HKLM\\SAM", "HKLM\\SYSTEM", "HKLM\\SECURITY"]: hRootKey, subKey = self._strip_root_key(dce, hive) outputFileName = f"\\\\{connection.host}\\SYSVOL\\{subKey}_{rand_suffix}" @@ -52,6 +54,7 @@ class NXCModule: context.log.fail(f"Unexpected error: {e}") return finally: + connection.conn.setTimeout(connection.args.smb_timeout) with contextlib.suppress(Exception): dce.disconnect()