mirror of https://github.com/MISP/PyMISP
parent
a7c3d8869c
commit
11b3470167
|
@ -1,3 +1,3 @@
|
||||||
__version__ = '1.10'
|
__version__ = '1.11'
|
||||||
|
|
||||||
from .api import PyMISP
|
from .api import PyMISP
|
||||||
|
|
|
@ -572,14 +572,19 @@ class PyMISP(object):
|
||||||
for f in result['result']:
|
for f in result['result']:
|
||||||
decoded = base64.b64decode(f['base64'])
|
decoded = base64.b64decode(f['base64'])
|
||||||
zipped = BytesIO(decoded)
|
zipped = BytesIO(decoded)
|
||||||
archive = zipfile.ZipFile(zipped)
|
|
||||||
try:
|
try:
|
||||||
# New format
|
archive = zipfile.ZipFile(zipped)
|
||||||
unzipped = BytesIO(archive.open(f['md5'], pwd='infected').read())
|
try:
|
||||||
except KeyError:
|
# New format
|
||||||
# Old format
|
unzipped = BytesIO(archive.open(f['md5'], pwd='infected').read())
|
||||||
unzipped = BytesIO(archive.open(f['filename'], pwd='infected').read())
|
except KeyError:
|
||||||
details.append([f['event_id'], f['filename'], unzipped])
|
# Old format
|
||||||
|
unzipped = BytesIO(archive.open(f['filename'], pwd='infected').read())
|
||||||
|
details.append([f['event_id'], f['filename'], unzipped])
|
||||||
|
except zipfile.BadZipfile:
|
||||||
|
# In case the sample isn't zipped
|
||||||
|
details.append([f['event_id'], f['filename'], zipped])
|
||||||
|
|
||||||
return True, details
|
return True, details
|
||||||
|
|
||||||
def download_last(self, last):
|
def download_last(self, last):
|
||||||
|
|
Loading…
Reference in New Issue