From 181e7a37f8018e97f8dea9e7ecc5d83fe29757ca Mon Sep 17 00:00:00 2001 From: Mario De Jesus Guzman Cabral <144813332+yudas-programador@users.noreply.github.com> Date: Thu, 16 Nov 2023 16:21:34 -0400 Subject: [PATCH] Update virustotal_public.py When the total virus IP that was given to you was brought up, the link to go see the information on the page was not allowed because it had the name ip_address, this changed the one used now it is ip-address --- misp_modules/modules/expansion/virustotal_public.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misp_modules/modules/expansion/virustotal_public.py b/misp_modules/modules/expansion/virustotal_public.py index dba60fae..70db1614 100644 --- a/misp_modules/modules/expansion/virustotal_public.py +++ b/misp_modules/modules/expansion/virustotal_public.py @@ -75,7 +75,7 @@ def create_misp_object(self, report: vt.Object) -> MISPObject: elif report.type == 'domain': misp_object = MISPObject('domain-ip') misp_object.add_attribute('domain', type='domain', value=report.id) - elif report.type == 'ip_address': + elif report.type == 'ip-address': misp_object = MISPObject('domain-ip') misp_object.add_attribute('ip', type='ip-dst', value=report.id) elif report.type == 'url': @@ -112,7 +112,7 @@ def parse_domain(self, domain: str) -> str: # RESOLUTIONS resolutions_iterator = self.client.iterator(f'/domains/{domain_report.id}/resolutions', limit=self.limit) for resolution in resolutions_iterator: - domain_object.add_attribute('ip', type='ip-dst', value=resolution.ip_address) + domain_object.add_attribute('ip', type='ip-dst', value=resolution.ip-address) # COMMUNICATING AND REFERRER FILES for relationship_name, misp_name in [ @@ -148,7 +148,7 @@ def parse_hash(self, file_hash: str) -> str: return file_object.uuid def parse_ip(self, ip: str) -> str: - ip_report = self.client.get_object(f'/ip_addresses/{ip}') + ip_report = self.client.get_object(f'/ip-addresses/{ip}') # IP ip_object = self.create_misp_object(ip_report) @@ -161,7 +161,7 @@ def parse_ip(self, ip: str) -> str: self.misp_event.add_object(**asn_object) # RESOLUTIONS - resolutions_iterator = self.client.iterator(f'/ip_addresses/{ip_report.id}/resolutions', limit=self.limit) + resolutions_iterator = self.client.iterator(f'/ip-addresses/{ip_report.id}/resolutions', limit=self.limit) for resolution in resolutions_iterator: ip_object.add_attribute('domain', type='domain', value=resolution.host_name)