Skip to content

Commit

Permalink
Merge branch 'hotfix/3.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jan 10, 2024
2 parents 1148801 + f91a0ff commit e23e7fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion analyzers/VirusTotal/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from vt import Client, error
from cortexutils.analyzer import Analyzer
from base64 import urlsafe_b64encode, b64decode
from vt.object import WhistleBlowerDict


class VirusTotalAnalyzer(Analyzer):
Expand Down Expand Up @@ -362,8 +363,15 @@ def run(self):
else:
self.error("Invalid service")
results['iocs'] = iocs
self.report(results)
self.report(self.convert_WhistleBlowerDict_to_dict(results))

def convert_WhistleBlowerDict_to_dict(self, o):
if isinstance(o, (dict, WhistleBlowerDict)):
return {k: self.convert_WhistleBlowerDict_to_dict(v) for k, v in o.items()}
elif isinstance(o, (list, tuple)):
return [self.convert_WhistleBlowerDict_to_dict(v) for v in o]
else:
return o
def get_yararuleset(self, results, iocs):
for yara_result in results["attributes"].get( "crowdsourced_yara_results", []):
yara_ruleset = self.vt.get_object(
Expand Down

0 comments on commit e23e7fe

Please sign in to comment.