From 1ecc05ecb724b757f13a768353186b81769c4bd7 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Fri, 31 May 2024 11:40:37 +0200 Subject: [PATCH] Implemented -download in Find module --- smbclientng/modules/Find.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/smbclientng/modules/Find.py b/smbclientng/modules/Find.py index 3148c5a..21e8c5e 100644 --- a/smbclientng/modules/Find.py +++ b/smbclientng/modules/Find.py @@ -177,9 +177,14 @@ def __recurse_action(self, paths=[], depth=0): do_print_entry = (entry.get_longname().lower() == self.options.iname.lower()) if do_print_entry: + # Actions on matches if self.options.download: - pass - elif self.options.ls: + if entry.is_directory(): + self.smbSession.get_file_recursively(path=(path + entry.get_longname() + ntpath.sep)) + else: + self.smbSession.get_file(path=(path + entry.get_longname() + ntpath.sep)) + # Output formats + if self.options.ls: if entry.is_directory(): windows_ls_entry(entry, (path + entry.get_longname() + ntpath.sep)) else: