concat results

pull/208/head
Sebdraven 2018-07-10 15:12:27 +02:00
parent 1223d93d52
commit 1d100833a4
1 changed files with 15 additions and 14 deletions

View File

@ -222,27 +222,28 @@ def expand_whois(api, domain):
if results: if results:
status_ok = True status_ok = True
item_registrant = __select_registrant_item(results) item_registrant = __select_registrant_item(results)
types = ['whois-registrant-email', 'whois-registrant-phone',
r.append({
'types': ['whois-registrant-email', 'whois-registrant-phone',
'whois-registrant-name', 'whois-registrar', 'whois-registrant-name', 'whois-registrar',
'whois-creation-date'], 'whois-creation-date']
'values': [item_registrant['email'], values = [item_registrant['email'],
item_registrant['telephone'], item_registrant['telephone'],
item_registrant['name'], results['registrarName'], item_registrant['name'], results['registrarName'],
results['createdDate']], results['createdDate']]
'categories': ['attribution'], for t, v in zip(types, values):
'comment': 'whois information of %s by securitytrails' % domain r.append({
} 'types': t,
'values': v,
'categories': ['attribution'],
'comment': 'whois information of %s by securitytrails' % domain
}
) )
# TODO File "modules/expansion/dnstrails.py", line 230, in expand_whois # TODO File "modules/expansion/dnstrails.py", line 230, in expand_whois
# 'values': [item_registrant['email'], # 'values': [item_registrant['email'],
# TypeError: 'NoneType' object is not subscriptable # TypeError: 'NoneType' object is not subscriptable
except APIError as e: except APIError as e:
misperrors['error'] = e misperrors['error'] = e
print(e)
return r, status_ok return r, status_ok
@ -258,6 +259,6 @@ def version():
def __select_registrant_item(entry): def __select_registrant_item(entry):
if 'contacts' in entry: if 'contacts' in entry:
for c in entry['contacts']: for c in entry['contacts']:
print(c)
if c['type'] == 'registrant': if c['type'] == 'registrant':
return c return c