From 693da7120b53d8a0c06d7a4312e112f2c42031e8 Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Fri, 26 Jul 2024 16:59:48 -0400 Subject: [PATCH 1/2] Stop NetBiosTimeout and error producing large stack traces --- nxc/connection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nxc/connection.py b/nxc/connection.py index 2f97e86be..3aef6d78d 100755 --- a/nxc/connection.py +++ b/nxc/connection.py @@ -167,6 +167,8 @@ def __init__(self, args, db, target): except Exception as e: if "ERROR_DEPENDENT_SERVICES_RUNNING" in str(e): self.logger.error(f"Exception while calling proto_flow() on target {target}: {e}") + elif e.__class__.__name__ in ["NetBIOSTimeout", "NetBIOSError"]: + self.logger.error(f"{e.__class__.__name__} on target {target}: {e}") else: self.logger.exception(f"Exception while calling proto_flow() on target {target}: {e}") finally: From 4504cf29d03043e5e3b57a83803bb3a8e0cf721d Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Fri, 26 Jul 2024 17:06:35 -0400 Subject: [PATCH 2/2] Add comment --- nxc/connection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nxc/connection.py b/nxc/connection.py index 3aef6d78d..2cf587de9 100755 --- a/nxc/connection.py +++ b/nxc/connection.py @@ -167,6 +167,7 @@ def __init__(self, args, db, target): except Exception as e: if "ERROR_DEPENDENT_SERVICES_RUNNING" in str(e): self.logger.error(f"Exception while calling proto_flow() on target {target}: {e}") + # Catching impacket SMB specific exceptions, which should not be imported due to performance reasons elif e.__class__.__name__ in ["NetBIOSTimeout", "NetBIOSError"]: self.logger.error(f"{e.__class__.__name__} on target {target}: {e}") else: