Skip to content

Commit

Permalink
Merge pull request #640 from Cosive/feature/virustotal_enrichment
Browse files Browse the repository at this point in the history
Fix regression in Virustotal modules
  • Loading branch information
adulau committed Oct 13, 2023
2 parents 7a0666b + 0f5532b commit a4e84ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions misp_modules/modules/expansion/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def parse_hash(self, file_hash: str) -> str:
('contacted_domains', 'communicates-with'),
('contacted_ips', 'communicates-with')
]:
files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
for file in files_iterator:
file_object = self.create_misp_object(file)
file_object.add_reference(file_object.uuid, misp_name)
self.misp_event.add_object(**file_object)
related_files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
for related_file in related_files_iterator:
related_file_object = self.create_misp_object(related_file)
related_file_object.add_reference(file_object.uuid, misp_name)
self.misp_event.add_object(**related_file_object)

self.misp_event.add_object(**file_object)
return file_object.uuid
Expand Down
10 changes: 5 additions & 5 deletions misp_modules/modules/expansion/virustotal_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ def parse_hash(self, file_hash: str) -> str:
('contacted_domains', 'communicates-with'),
('contacted_ips', 'communicates-with')
]:
files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
for file in files_iterator:
file_object = self.create_misp_object(file)
file_object.add_reference(file_object.uuid, misp_name)
self.misp_event.add_object(**file_object)
related_files_iterator = self.client.iterator(f'/files/{file_report.id}/{relationship_name}', limit=self.limit)
for related_file in related_files_iterator:
related_file_object = self.create_misp_object(related_file)
related_file_object.add_reference(file_object.uuid, misp_name)
self.misp_event.add_object(**related_file_object)

self.misp_event.add_object(**file_object)
return file_object.uuid
Expand Down

0 comments on commit a4e84ab

Please sign in to comment.