Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dom = tc_data.pop("domain_resolutions")#this key returns a list
domstring = ""
if len(dom) == 0:
domstring = "None found"
for x in range(len(dom)):
entry = dom[x]
domstring = domstring + entry
tc_domain_resolutions = domstring
tc_verdict = tc_data.pop("verdict_response_code")
tc_data.clear()
#Get Domain Tools Data
dt_domains = ""
try:
response = dtapi.dtapi.reverse_ip(addr)
for domain in dtapi.dtapi.domainlist_reverseip(response):
dt_domains = dt_domains + domain + ";"
except:
dt_domains = "None found"
#Get WhoIs Data
try:
obj = IPWhois(addr, timeout=20)
results = obj.lookup_rdap()#default depth is 0, we only need top level values for the file
whois_asn = (newline_clean(results['asn']))
whois_asn_country_code = (newline_clean(results['asn_country_code']))
whois_network_cidr = (newline_clean(results['network']['cidr']))
tmp_links = (newline_clean(results['network']['links']))
def get_dt_domains(ip):
d = ""
try:
dt_response = dtapi.dtapi.reverse_ip(ip)
for domain in dtapi.dtapi.domainlist_reverseip(dt_response):
d = d + domain + ";"
except: d = "N/A"
return d