mirror of https://github.com/MISP/misp-modules
add a test to check if the list is not empty
parent
dbeec4682e
commit
f0a4c71908
|
@ -72,55 +72,57 @@ def handler(q=False):
|
||||||
def handle_domain(api, domain, misperrors):
|
def handle_domain(api, domain, misperrors):
|
||||||
result_filtered = {"results": []}
|
result_filtered = {"results": []}
|
||||||
|
|
||||||
# r, status_ok = expand_domain_info(api, misperrors, domain)
|
r, status_ok = expand_domain_info(api, misperrors, domain)
|
||||||
#
|
#
|
||||||
# if status_ok:
|
if status_ok:
|
||||||
# result_filtered['results'].extend(r)
|
if r:
|
||||||
# else:
|
result_filtered['results'].extend(r)
|
||||||
# misperrors['error'] = misperrors['error'] + ' Error DNS result'
|
else:
|
||||||
# return misperrors
|
misperrors['error'] = misperrors['error'] + ' Error DNS result'
|
||||||
#
|
return misperrors
|
||||||
# time.sleep(1)
|
|
||||||
# r, status_ok = expand_subdomains(api, domain)
|
time.sleep(1)
|
||||||
#
|
r, status_ok = expand_subdomains(api, domain)
|
||||||
# if status_ok:
|
|
||||||
# result_filtered['results'].extend(r)
|
if status_ok:
|
||||||
# else:
|
if r:
|
||||||
# misperrors['error'] = misperrors['error'] + ' Error subdomains result'
|
result_filtered['results'].extend(r)
|
||||||
# return misperrors
|
else:
|
||||||
#
|
misperrors['error'] = misperrors['error'] + ' Error subdomains result'
|
||||||
# time.sleep(1)
|
return misperrors
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
r, status_ok = expand_whois(api, domain)
|
r, status_ok = expand_whois(api, domain)
|
||||||
|
|
||||||
if status_ok:
|
if status_ok:
|
||||||
print(r)
|
if r:
|
||||||
result_filtered['results'].extend(r)
|
result_filtered['results'].extend(r)
|
||||||
else:
|
else:
|
||||||
misperrors['error'] = misperrors['error'] + ' Error whois result'
|
misperrors['error'] = misperrors['error'] + ' Error whois result'
|
||||||
return misperrors
|
return misperrors
|
||||||
#
|
|
||||||
# time.sleep(1)
|
|
||||||
# r, status_ok = expand_history_ipv4_ipv6(api, domain)
|
|
||||||
# #
|
|
||||||
#
|
|
||||||
# if status_ok:
|
|
||||||
# print(r)
|
|
||||||
# result_filtered['results'].extend(r)
|
|
||||||
# else:
|
|
||||||
# misperrors['error'] = misperrors['error'] + ' Error history ipv4'
|
|
||||||
# return misperrors
|
|
||||||
|
|
||||||
# time.sleep(1)
|
time.sleep(1)
|
||||||
|
r, status_ok = expand_history_ipv4_ipv6(api, domain)
|
||||||
# r, status_ok = expand_history_dns(api, domain)
|
|
||||||
#
|
#
|
||||||
# if status_ok:
|
|
||||||
# print(r)
|
if status_ok:
|
||||||
# result_filtered['results'].extend(r)
|
if r:
|
||||||
# else:
|
result_filtered['results'].extend(r)
|
||||||
# misperrors['error'] = misperrors[
|
else:
|
||||||
# 'error'] + ' Error in expand History DNS'
|
misperrors['error'] = misperrors['error'] + ' Error history ipv4'
|
||||||
# return misperrors
|
return misperrors
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
r, status_ok = expand_history_dns(api, domain)
|
||||||
|
|
||||||
|
if status_ok:
|
||||||
|
if r:
|
||||||
|
result_filtered['results'].extend(r)
|
||||||
|
else:
|
||||||
|
misperrors['error'] = misperrors[
|
||||||
|
'error'] + ' Error in expand History DNS'
|
||||||
|
return misperrors
|
||||||
return result_filtered
|
return result_filtered
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue