From 79f48eccfe675336e8f99fad81898d9fd735cd1d Mon Sep 17 00:00:00 2001 From: Tristan METAYER Date: Tue, 2 May 2017 14:41:22 +0200 Subject: [PATCH] If filename add iocfilename as attachment --- .../modules/import_mod/openiocimport.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/misp_modules/modules/import_mod/openiocimport.py b/misp_modules/modules/import_mod/openiocimport.py index 27ef3f9..50bc8ba 100755 --- a/misp_modules/modules/import_mod/openiocimport.py +++ b/misp_modules/modules/import_mod/openiocimport.py @@ -33,8 +33,24 @@ def handler(q=False): return json.dumps({"success": 0}) pkg = openioc.load_openioc(package) + + # add origin file as attachment + if q.get("filename"): + r["results"].append({ + "values": [q.get('filename')], + "types": ['attachment'], + "categories": ['Support Tool'], + "data" : q.get('data'), + }) + + # return all attributes for attrib in pkg.attributes: - r["results"].append({"values": [attrib.value], "types": [attrib.type], "categories": [attrib.category]}) + r["results"].append({ + "values": [attrib.value], + "types": [attrib.type], + "categories": [attrib.category], + "comment":attrib.comment}) + return r