From 8d86b5a90b0d04c1b0114a4dd6efb9e278748b83 Mon Sep 17 00:00:00 2001 From: Hynek Petrak Date: Wed, 14 Aug 2024 08:38:28 +0200 Subject: [PATCH] fix endless loop in FIND_NEXT2, by providing ResumeKey (#1629) Co-authored-by: Hynek Petrak --- impacket/smb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impacket/smb.py b/impacket/smb.py index 7968764fd3..611e1db633 100644 --- a/impacket/smb.py +++ b/impacket/smb.py @@ -3982,7 +3982,7 @@ def list_path(self, service, path = '*', password = None): findNextParameter['SID'] = sid findNextParameter['SearchCount'] = 1024 findNextParameter['InformationLevel'] = SMB_FIND_FILE_BOTH_DIRECTORY_INFO - findNextParameter['ResumeKey'] = 0 + findNextParameter['ResumeKey'] = record["FileIndex"] findNextParameter['Flags'] = SMB_FIND_RETURN_RESUME_KEYS | SMB_FIND_CLOSE_AT_EOS if self.__flags2 & SMB.FLAGS2_UNICODE: findNextParameter['FileName'] = resume_filename + b'\x00\x00'