Skip to content

Commit

Permalink
Bugfix for password_fail logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-kevin committed Dec 22, 2023
1 parent ed75b53 commit 1bb5f54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion analyzer/windows/lib/common/zip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def extract_zip(zip_path, extract_path, password=b"infected", recursion_depth=1,
for pword in passwords:
try:
archive.extractall(path=extract_path, pwd=pword)
password_fail = False
except BadZipfile as e:
raise CuckooPackageError("Invalid Zip file") from e
except RuntimeError as e:
Expand All @@ -177,7 +178,6 @@ def extract_zip(zip_path, extract_path, password=b"infected", recursion_depth=1,
except RuntimeError as e:
raise CuckooPackageError(f"Unable to extract Zip file: {e}") from e
finally:
password_fail = False
if recursion_depth < 4:
# Extract nested archives.
for name in archive.namelist():
Expand Down

0 comments on commit 1bb5f54

Please sign in to comment.