Skip to content

Commit 2f27ff1

Browse files
committed
ta_import - support for TheatAnalyzer 6.1
1 parent 1fcc16e commit 2f27ff1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

misp_modules/modules/import_mod/threatanalyzer_import.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ def handler(q=False):
4646
with zf.open(zip_file_name, mode='r', pwd=None) as fp:
4747
file_data = fp.read()
4848
for line in file_data.decode().split('\n'):
49-
if line:
49+
if not line:
50+
continue
51+
if line.count('|') == 3:
5052
l_fname, l_size, l_md5, l_created = line.split('|')
51-
l_fname = cleanup_filepath(l_fname)
52-
if l_fname:
53-
if l_size == 0:
54-
pass # FIXME create an attribute for the filename/path
55-
else:
56-
# file is a non empty sample, upload the sample later
57-
modified_files_mapping[l_md5] = l_fname
53+
if line.count('|') == 4:
54+
l_fname, l_size, l_md5, l_sha256, l_created = line.split('|')
55+
l_fname = cleanup_filepath(l_fname)
56+
if l_fname:
57+
if l_size == 0:
58+
pass # FIXME create an attribute for the filename/path
59+
else:
60+
# file is a non empty sample, upload the sample later
61+
modified_files_mapping[l_md5] = l_fname
5862

5963
# now really process the data
6064
for zip_file_name in zf.namelist(): # Get all files in the zip file

0 commit comments

Comments
 (0)