From 098616846da8ee85f6a9a02061e8e08e816161db Mon Sep 17 00:00:00 2001 From: Sebdraven Date: Fri, 23 Apr 2021 16:19:47 +0200 Subject: [PATCH] add hostname --- misp_modules/modules/expansion/onyphe.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/misp_modules/modules/expansion/onyphe.py b/misp_modules/modules/expansion/onyphe.py index 64fd62e..2ab3677 100644 --- a/misp_modules/modules/expansion/onyphe.py +++ b/misp_modules/modules/expansion/onyphe.py @@ -52,6 +52,15 @@ class OnypheClient: elif type(domain) == str: self.__get_object_domain_ip(domain, 'domain') + if 'hostname' in r: + hostname = r['hostname'] + if type(hostname) == list: + for d in hostname: + self.__get_object_domain_ip(d, 'domain') + elif type(hostname) == str: + self.__get_object_domain_ip(hostname, 'domain') + + def __get_object_domain_ip(self, obs, relation): objet_domain_ip = MISPObject('domain-ip') objet_domain_ip.add_attribute(relation, obs)