From e9a707a2fa4abd2eb3314eade5f99a5c11698614 Mon Sep 17 00:00:00 2001 From: Sascha Rommelfangen Date: Thu, 18 Jul 2019 11:06:26 +0200 Subject: [PATCH] temporary fix for attachments --- mail_to_misp.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mail_to_misp.py b/mail_to_misp.py index fc3f8cf..e9ad2fa 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -82,13 +82,13 @@ class Mail2MISP(): # Attach sane file self.misp_event.add_attribute('attachment', value='Report', data=BytesIO(attachment.get_content().as_bytes())) - else: - f_object, main_object, sections = make_binary_objects(pseudofile=BytesIO(attachment.get_content()), - filename=attachment.get_filename(), standalone=False) - self.misp_event.add_object(f_object) - if main_object: - self.misp_event.add_object(main_object) - [self.misp_event.add_object(section) for section in sections] + #else: + #f_object, main_object, sections = make_binary_objects(pseudofile=BytesIO(attachment.get_content()), + # filename=attachment.get_filename(), standalone=False) + #self.misp_event.add_object(f_object) + #if main_object: + # self.misp_event.add_object(main_object) + # [self.misp_event.add_object(section) for section in sections] def email_from_spamtrap(self): '''The email comes from a spamtrap and should be attached as-is.''' @@ -108,13 +108,13 @@ class Mail2MISP(): for attachment_name, attachment in email_object.attachments: if not attachment_name: attachment_name = 'NameMissing' - f_object, main_object, sections = make_binary_objects(pseudofile=attachment, filename=attachment_name, standalone=False) - self.misp_event.add_object(f_object) - if main_object: - self.misp_event.add_object(main_object) - for section in sections: - self.misp_event.add_object(section) - email_object.add_reference(f_object.uuid, 'related-to', 'Email attachment') + #f_object, main_object, sections = make_binary_objects(pseudofile=attachment, filename=attachment_name, standalone=False) + #self.misp_event.add_object(f_object) + #if main_object: + # self.misp_event.add_object(main_object) + # for section in sections: + # self.misp_event.add_object(section) + #email_object.add_reference(f_object.uuid, 'related-to', 'Email attachment') self.process_body_iocs(email_object) self.misp_event.add_object(email_object)