mirror of https://github.com/MISP/misp-modules
Keep zip content as binary
parent
9f84db3659
commit
1051e2210b
|
@ -193,7 +193,7 @@ def get_zipped_contents(filename, data, password=None):
|
|||
password = str.encode(password) # Byte encoded password required
|
||||
for zip_file_name in zf.namelist(): # Get all files in the zip file
|
||||
with zf.open(zip_file_name, mode='r', pwd=password) as fp:
|
||||
file_data = io.TextIOWrapper(fp).read().encode()
|
||||
file_data = fp.read()
|
||||
unzipped_files.append({"values": zip_file_name,
|
||||
"data": base64.b64encode(file_data).decode(), # Any password works when not encrypted
|
||||
"comment": "Extracted from {0}".format(filename)})
|
||||
|
|
Loading…
Reference in New Issue