Skip to content

Commit 054d9ba

Browse files
authored
Use ZIP_DEFLATE instead of ZIP_LZMA (#2728)
This makes archives easier to decompress/decrypt as ZIP_DEFLATE is supported by all standard ZIP libraries. ZIP_LZMA requires third-party tools like 7Zip.
1 parent e593cbe commit 054d9ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/cuckoo/common/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def create_zip(files=False, folder=False, encrypted=False):
153153

154154
mem_zip = BytesIO()
155155
if encrypted and HAVE_PYZIPPER:
156-
zipper = pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES)
156+
zipper = pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_DEFLATED, encryption=pyzipper.WZ_AES)
157157
else:
158158
zipper = zipfile.ZipFile(mem_zip, "a", zipfile.ZIP_DEFLATED, False)
159159
with zipper as zf:

web/analysis/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ def file(request, category, task_id, dlfile):
19641964
return resp
19651965
else:
19661966
mem_zip = BytesIO()
1967-
with pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf:
1967+
with pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_DEFLATED, encryption=pyzipper.WZ_AES) as zf:
19681968
zf.setpassword(settings.ZIP_PWD)
19691969
if not isinstance(path, list):
19701970
path = [path]
@@ -2032,7 +2032,7 @@ def procdump(request, task_id, process_id, start, end, zipped=False):
20322032
s.seek(0)
20332033
if zipped and HAVE_PYZIPPER:
20342034
mem_zip = BytesIO()
2035-
with pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf:
2035+
with pyzipper.AESZipFile(mem_zip, "w", compression=pyzipper.ZIP_DEFLATED, encryption=pyzipper.WZ_AES) as zf:
20362036
zf.setpassword(settings.ZIP_PWD)
20372037
zf.writestr(file_name, s.getvalue())
20382038
file_name += ".zip"

0 commit comments

Comments
 (0)