mirror of https://github.com/MISP/misp-modules
correct key and return of functions
parent
731c06a939
commit
9063da88cd
|
@ -394,14 +394,15 @@ def expand_history_whois(api, domain):
|
||||||
if 'items' in results['result']:
|
if 'items' in results['result']:
|
||||||
for item in results['result']['items']:
|
for item in results['result']['items']:
|
||||||
item_registrant = __select_registrant_item(item)
|
item_registrant = __select_registrant_item(item)
|
||||||
|
if item_registrant:
|
||||||
r.extend(
|
r.extend(
|
||||||
{
|
{
|
||||||
'type': ['domain'],
|
'type': ['domain'],
|
||||||
'values': item['nameServers'],
|
'values': item['nameServers'],
|
||||||
'categories': ['Network activity'],
|
'categories': ['Network activity'],
|
||||||
'comment': 'Whois history Name Servers of %s '
|
'comment': 'Whois history Name Servers of %s '
|
||||||
'Status: %s ' % (domain, item['status'])
|
'Status: %s ' % (
|
||||||
|
domain, item['status'])
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -502,10 +503,11 @@ def version():
|
||||||
|
|
||||||
|
|
||||||
def __select_registrant_item(entry):
|
def __select_registrant_item(entry):
|
||||||
print(entry)
|
|
||||||
if 'contacts' in entry:
|
if 'contacts' in entry:
|
||||||
for c in entry['contacts']:
|
return list(filter(lambda x: x['type'] == 'registrant',
|
||||||
print(c)
|
entry['contacts']))[0]
|
||||||
if c['type'] == 'registrant':
|
|
||||||
print(c)
|
if 'contact' in entry:
|
||||||
return c
|
return list(filter(lambda x: x['type'] == 'registrant',
|
||||||
|
entry['contact']))[0]
|
||||||
|
|
Loading…
Reference in New Issue