Skip to content

Commit 576b3c9

Browse files
author
Sebdraven
committed
history whois dns
1 parent 5106703 commit 576b3c9

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

misp_modules/modules/expansion/securitytrails.py

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def expand_history_ipv4_ipv6(api, domain):
340340

341341
except APIError as e:
342342
misperrors['error'] = e
343-
print(e)
343+
return [], False
344344

345345
return r, status_ok
346346

@@ -372,12 +372,71 @@ def expand_history_dns(api, domain):
372372

373373
except APIError as e:
374374
misperrors['error'] = e
375+
return [], False
375376

376377
status_ok = True
377378

378379
return r, status_ok
379380

380381

382+
def expand_history_whois(api, domain):
383+
r = []
384+
status_ok = False
385+
try:
386+
results = api.history_whois(domain)
387+
388+
if results:
389+
390+
if 'items' in results['results']:
391+
for item in results['results']['items']:
392+
item_registrant = __select_registrant_item(item)
393+
394+
r.extend(
395+
{
396+
'type': ['domain'],
397+
'values': item['nameServers'],
398+
'categories': ['Network activity'],
399+
'comment': 'Whois history Name Servers of %s '
400+
'Status: %s ' % (domain, item['status'])
401+
402+
}
403+
)
404+
if 'email' in item_registrant:
405+
r.append(
406+
{
407+
'types': ['whois-registrant-email'],
408+
'values': [item_registrant['email']],
409+
'categories': ['Attribution'],
410+
'comment': 'Whois history registrant email of %s'
411+
'Status: %s' % (
412+
domain, item['status'])
413+
}
414+
)
415+
416+
if 'telephone' in item_registrant:
417+
r.append(
418+
{
419+
'types': ['whois-registrant-phone'],
420+
'values': [item_registrant['telephone']],
421+
'categories': ['Attribution'],
422+
'comment': 'Whois history registrant phone of %s'
423+
'Status: %s' % (
424+
domain, item['status'])
425+
}
426+
)
427+
428+
429+
430+
431+
except APIError as e:
432+
misperrors['error'] = e
433+
return [], False
434+
435+
436+
437+
return r, status_ok
438+
439+
381440
def __history_ip(results, domain, type_ip='ip'):
382441
r = []
383442
if 'records' in results:

0 commit comments

Comments
 (0)