From 4c8fe9d8ef5a6a66765299922bb00e7afde33b6c Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Thu, 25 Jul 2019 17:43:11 +0200 Subject: [PATCH] fix: Testing if there is some screenshot data before trying to fetch it --- misp_modules/lib/joe_parser.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misp_modules/lib/joe_parser.py b/misp_modules/lib/joe_parser.py index 182398f..4b4c4c1 100644 --- a/misp_modules/lib/joe_parser.py +++ b/misp_modules/lib/joe_parser.py @@ -146,10 +146,12 @@ class JoeParser(): relationship_type='initiates')) def parse_screenshot(self): - screenshotdata = self.data['behavior']['screenshotdata']['interesting']['$'] - attribute = {'type': 'attachment', 'value': 'screenshot.jpg', - 'data': screenshotdata, 'disable_correlation': True} - self.misp_event.add_attribute(**attribute) + screenshotdata = self.data['behavior']['screenshotdata'] + if screenshotdata: + screenshotdata = screenshotdata['interesting']['$'] + attribute = {'type': 'attachment', 'value': 'screenshot.jpg', + 'data': screenshotdata, 'disable_correlation': True} + self.misp_event.add_attribute(**attribute) def parse_system_behavior(self): system = self.data['behavior']['system']