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

Fix spider_plus bug where len was applied to the count not an array #392

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 6 additions & 8 deletions nxc/modules/spider_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from os.path import abspath, join, split, exists, splitext, getsize, sep
from os import makedirs, remove, stat
import time
import traceback
from nxc.paths import TMP_PATH
from nxc.protocols.smb.remotefile import RemoteFile
from impacket.smb3structs import FILE_READ_DATA
Expand Down Expand Up @@ -159,8 +158,8 @@ def read_chunk(self, remote_file, chunk_size=CHUNK_SIZE):
remote_file.__smbConnection = self.smb.conn
return self.read_chunk(remote_file)

except Exception:
traceback.print_exc()
except Exception as e:
self.logger.exception(e)
break

return chunk
Expand Down Expand Up @@ -214,13 +213,13 @@ def spider_shares(self):
# Start the spider at the root of the share folder
self.results[share_name] = {}
self.spider_folder(share_name, "")
except SessionError:
traceback.print_exc()
except SessionError as e:
self.logger.exception(e)
self.logger.fail("Got a session error while spidering.")
self.reconnect()

except Exception as e:
traceback.print_exc()
self.logger.exception(e)
self.logger.fail(f"Error enumerating shares: {e!s}")

# Save the metadata.
Expand Down Expand Up @@ -412,8 +411,7 @@ def print_stats(self):
self.logger.display(f"Total folders found: {num_folders}")
num_folders_filtered = self.stats.get("num_folders_filtered", 0)
if num_folders_filtered:
num_filtered_folders = len(num_folders_filtered)
self.logger.display(f"Folders Filtered: {num_filtered_folders}")
self.logger.display(f"Folders Filtered: {num_folders_filtered}")

# File statistics.
num_files = self.stats.get("num_files", 0)
Expand Down
1 change: 0 additions & 1 deletion nxc/netexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def main():

protocol_object = getattr(p_loader.load_protocol(protocol_path), args.protocol)
nxc_logger.debug(f"Protocol Object: {protocol_object}, type: {type(protocol_object)}")
nxc_logger.debug(f"Protocol Object dir: {dir(protocol_object)}")
protocol_db_object = p_loader.load_protocol(protocol_db_path).database
nxc_logger.debug(f"Protocol DB Object: {protocol_db_object}")

Expand Down
Loading