mirror of https://github.com/MISP/misp-modules
add history mx and soa
parent
43a49dafc6
commit
f47a64b364
|
@ -346,20 +346,23 @@ def expand_history_dns(api, domain):
|
||||||
if results:
|
if results:
|
||||||
status_ok = True
|
status_ok = True
|
||||||
|
|
||||||
if 'records' in results:
|
r.extend(__history_dns(results, domain, 'nameserver', 'ns'))
|
||||||
for record in results['records']:
|
|
||||||
if 'values' in record:
|
time.sleep(1)
|
||||||
for item in record['values']:
|
|
||||||
r.append(
|
results = api.history_dns_soa(results, domain)
|
||||||
{'types': ['domain|ip'],
|
|
||||||
'values': [
|
if results:
|
||||||
'%s|%s' % (domain, item['nameserver'])],
|
status_ok = True
|
||||||
'categories': ['Network activity'],
|
r.extend(__history_dns(results, domain, 'email', 'soa'))
|
||||||
'comment': 'history DNS of %s last seen: %s first seen: %s' %
|
|
||||||
(domain, record['last_seen'],
|
time.sleep(1)
|
||||||
record['first_seen'])
|
|
||||||
}
|
results = api.history_dns_mx(domain)
|
||||||
)
|
|
||||||
|
if results:
|
||||||
|
status_ok = True
|
||||||
|
r.extend(__history_dns(results, domain, 'host', 'mx'))
|
||||||
|
|
||||||
except APIError as e:
|
except APIError as e:
|
||||||
misperrors['error'] = e
|
misperrors['error'] = e
|
||||||
|
@ -387,6 +390,24 @@ def __history_ip(results, domain, type_ip='ip'):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
def __history_dns(results, domain, type_serv, service):
|
||||||
|
r = []
|
||||||
|
|
||||||
|
if 'records' in results:
|
||||||
|
for record in results['records']:
|
||||||
|
if 'values' in record:
|
||||||
|
for item in record['values']:
|
||||||
|
r.append(
|
||||||
|
{'types': ['domain|ip'],
|
||||||
|
'values': [item[type_serv]],
|
||||||
|
'categories': ['Network activity'],
|
||||||
|
'comment': 'history %s of %s last seen: %s first seen: %s' %
|
||||||
|
(service, domain, record['last_seen'],
|
||||||
|
record['first_seen'])
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return r
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
return mispattributes
|
return mispattributes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue