mirror of
https://github.com/valitydev/Cortex-Analyzers.git
synced 2024-11-06 09:05:19 +00:00
#130 - set and call VT API with configured proxies
This commit is contained in:
parent
1c4d3ec591
commit
6359dd892e
@ -8,6 +8,7 @@ import time
|
||||
import hashlib
|
||||
|
||||
from virustotal_api import PublicApi as VirusTotalPublicApi
|
||||
#from virus_total_apis import PublicApi as VirusTotalPublicApi
|
||||
from cortexutils.analyzer import Analyzer
|
||||
|
||||
|
||||
@ -18,6 +19,8 @@ class VirusTotalAnalyzer(Analyzer):
|
||||
self.service = self.getParam('config.service', None, 'Service parameter is missing')
|
||||
self.virustotal_key = self.getParam('config.key', None, 'Missing VirusTotal API key')
|
||||
self.polling_interval = self.getParam('config.polling_interval', 60)
|
||||
self.proxies = self.getParam('config.proxy', None)
|
||||
|
||||
|
||||
def wait_file_report(self, id):
|
||||
results = self.check_response(self.vt.get_file_report(id))
|
||||
@ -133,8 +136,7 @@ class VirusTotalAnalyzer(Analyzer):
|
||||
|
||||
def run(self):
|
||||
Analyzer.run(self)
|
||||
|
||||
self.vt = VirusTotalPublicApi(self.virustotal_key)
|
||||
self.vt = VirusTotalPublicApi(self.virustotal_key, self.proxies)
|
||||
|
||||
if self.service == 'scan':
|
||||
if self.data_type == 'file':
|
||||
|
Loading…
Reference in New Issue
Block a user