add expand subdomains

pull/208/head
Sebdraven 2018-06-29 17:19:21 +02:00
parent 2d1adf4aa9
commit 64847a8a04
1 changed files with 24 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import json
import logging
import sys
from dnstrails import DnsTrails
from dnstrails import APIError
log = logging.getLogger('dnstrails')
log.setLevel(logging.DEBUG)
@ -163,9 +164,31 @@ def expand_domain_info(api, misperror,domain):
results['current_dns']['soa']['first_seen'])
})
return r, status_ok
def expand_subdomains(api, domain):
r = []
status_ok = False
try:
results = api.subdomains(domain)
if results:
status_ok = True
if 'subdomains' in results:
r.append({
'type': ['domain'],
'values': ['%s.%s' % (sub,domain) for sub in results['subdomains']],
}
)
except APIError as e:
misperrors['error'] = e
return r, status_ok
def introspection():
return mispattributes