Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirusTotal URL report #289

Merged
merged 3 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analyzers/VirusTotal/VirusTotal_GetReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
"license": "AGPL-V3",
"description": "Get the latest VirusTotal report for a file, hash, domain or an IP address.",
"dataTypeList": ["file", "hash", "domain", "ip"],
"dataTypeList": ["file", "hash", "domain", "ip", "url"],
"command": "VirusTotal/virustotal.py",
"baseConfig": "VirusTotal",
"config": {
Expand Down
5 changes: 3 additions & 2 deletions analyzers/VirusTotal/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def run(self):
data = self.get_param('data', None, 'Data is missing')
self.report(self.check_response(self.vt.get_ip_report(data)))
elif self.data_type == 'file':

hashes = self.get_param('attachment.hashes', None)
if hashes is None:
filepath = self.get_param('file', None, 'File is missing')
Expand All @@ -162,10 +161,12 @@ def run(self):
hash = next(h for h in hashes if len(h) == 64)

self.report(self.check_response(self.vt.get_file_report(hash)))

elif self.data_type == 'hash':
data = self.get_param('data', None, 'Data is missing')
self.report(self.check_response(self.vt.get_file_report(data)))
elif self.data_type == 'url':
data = self.get_param('data', None, 'Data is missing')
self.report(self.check_response(self.vt.get_url_report(data)))
else:
self.error('Invalid data type')
else:
Expand Down
4 changes: 4 additions & 0 deletions thehive-templates/VirusTotal_GetReport_3_0/long.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<a ng-href="https://www.virustotal.com/#/file/{{artifact.data}}/detection" target="_blank">
View Full Report</a>
</span>
<span ng-if="artifact.dataType === 'url'">
<i class="fa fa-search"></i>
<a ng-href="{{content.permalink}}" target="_blank">View Full Report</a>
</span>
</dd>
</dl>
</div>
Expand Down