Skip to content

Commit

Permalink
fix: [virustotal] fix the typo for the VT link
Browse files Browse the repository at this point in the history
Fix #644
Fix #595
  • Loading branch information
adulau committed May 9, 2024
1 parent e4d9317 commit 8b25af8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions misp_modules/modules/expansion/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'format': 'misp_standard'}

# possible module-types: 'expansion', 'hover' or both
moduleinfo = {'version': '5', 'author': 'Hannah Ward',
moduleinfo = {'version': '6', 'author': 'Hannah Ward',
'description': 'Enrich observables with the VirusTotal v3 API',
'module-type': ['expansion']}

Expand Down Expand Up @@ -51,7 +51,11 @@ def get_result(self) -> dict:
def add_vt_report(self, report: vt.Object) -> str:
analysis = report.get('last_analysis_stats')
total = self.get_total_analysis(analysis, report.get('known_distributors'))
permalink = f'https://www.virustotal.com/gui/{report.type}/{report.id}'
if report.type == 'ip_address':
rtype = 'ip-address'
else:
rtype = report.type
permalink = f'https://www.virustotal.com/gui/{rtype}/{report.id}'

vt_object = MISPObject('virustotal-report')
vt_object.add_attribute('permalink', type='link', value=permalink)
Expand Down

0 comments on commit 8b25af8

Please sign in to comment.