fixed IP address lookup error

This commit is contained in:
Joost Agterhoek 2025-07-08 22:09:12 +02:00
parent 1f39298386
commit 23b0e869fc
2 changed files with 9 additions and 5 deletions

View File

@ -49,7 +49,8 @@ class Lookedup(object):
self.metadata = domain_info(self.host)
self.domain = self.metadata["domain_name"]
self.email_security = spf_dmarc(self.domain)
self.vt, self.vt_dict = virustotal_api.analyse2(self.host, self.host_type)
# self.vt, self.vt_dict = virustotal_api.analyse2(self.host, self.host_type)
self.vt = virustotal_api.analyse2(self.host, self.host_type)
self.abuseipdb = abuseipdb_api.analyse(self.host)
return self

View File

@ -59,7 +59,8 @@ def analyse_IP(api_key, host):
analysis_json = requests.get(analysis_url, headers=headers)
response_dict = json.loads(analysis_json.text)
# Implement this: https://docs.virustotal.com/reference/ip-info
return response_dict, analysis_json
# return response_dict, analysis_json
return response_dict
def analyse(host, host_type):
@ -70,7 +71,8 @@ def analyse(host, host_type):
elif host_type == DOMAIN:
result, analysis_json = analyse_domain(api_key, host)
elif host_type == IPV4 or IPV6:
result, analysis_json = analyse_IP(api_key, host)
result = analyse_IP(api_key, host)
# result, analysis_json = analyse_IP(api_key, host)
return result, analysis_json
@ -81,9 +83,10 @@ def analyse2(host, host_type):
result, analysis_json = analyse_URL(api_key, response_id)
elif host_type == "domain" or host_type == "email address":
result, analysis_json = analyse_domain(api_key, host)
print("DOMAIN VT LOOKUP IS: ", result)
# print("DOMAIN VT LOOKUP IS: ", result)
elif host_type == "ip":
result, analysis_json = analyse_IP(api_key, host)
# result, analysis_json = analyse_IP(api_key, host)
result = analyse_IP(api_key, host)
if host_type == "url":
vt_stats = result["data"]["attributes"]["stats"]
vt_results = result["data"]["attributes"]["results"]