From d7b33532eb776c8eb560d91c9e5d7313ee5958ac Mon Sep 17 00:00:00 2001 From: CheYenBzh Date: Wed, 4 Jan 2017 13:43:45 +0100 Subject: [PATCH] Update virustotal.py --- misp_modules/modules/expansion/virustotal.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/misp_modules/modules/expansion/virustotal.py b/misp_modules/modules/expansion/virustotal.py index 4048942..340d21b 100755 --- a/misp_modules/modules/expansion/virustotal.py +++ b/misp_modules/modules/expansion/virustotal.py @@ -136,12 +136,20 @@ def getMoreInfo(req, key): params = {"hash":hsh, "apikey":key}) malsample = sample.content - r.append({"types":["malware-sample"], - "categories":["Payload delivery"], - "values":data["submission_names"], - "data": str(base64.b64encode(malsample), 'utf-8') - } - ) + if isset(data, "submission_names"): + r.append({"types":["malware-sample"], + "categories":["Payload delivery"], + "values":data["submission_names"], + "data": str(base64.b64encode(malsample), 'utf-8') + } + ) + else: + r.append({"types":["malware-sample"], + "categories":["Payload delivery"], + "values":data["submission_names"], + "data": str(base64.b64encode(malsample), 'utf-8') + } + ) return r def introspection():