From 8cbeda40a5043eb2494d1d41c9431dabfce9d067 Mon Sep 17 00:00:00 2001 From: Sebdraven Date: Tue, 17 Jul 2018 18:42:01 +0200 Subject: [PATCH] add searching_stats --- misp_modules/modules/expansion/securitytrails.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/misp_modules/modules/expansion/securitytrails.py b/misp_modules/modules/expansion/securitytrails.py index 5294a62..f8f822e 100644 --- a/misp_modules/modules/expansion/securitytrails.py +++ b/misp_modules/modules/expansion/securitytrails.py @@ -151,6 +151,17 @@ def handle_ip(api, ip, misperrors): misperrors['error'] += ' Error in expand searching domain' return misperrors + time.sleep(1) + + r, status_ok = expand_search_stats(api, ip, misperrors) + + if status_ok: + if r: + result_filtered['results'].extend(r) + else: + misperrors['error'] += ' Error in expand searching stats' + return misperrors + return result_filtered @@ -549,7 +560,7 @@ def expand_search_stats(api, ip, misperror): status_ok = False try: - result = api.searching_stats(ipv4=ip) + result = api.search_stats(ipv4=ip) if result and 'top_organizations' in result: comment = '' for reg in result['top_organizations']: