#130 - set and call VT API with configured proxies

This commit is contained in:
Jérôme Leonard 2017-12-21 08:08:52 +01:00
parent 1c4d3ec591
commit 6359dd892e

View File

@ -8,6 +8,7 @@ import time
import hashlib import hashlib
from virustotal_api import PublicApi as VirusTotalPublicApi from virustotal_api import PublicApi as VirusTotalPublicApi
#from virus_total_apis import PublicApi as VirusTotalPublicApi
from cortexutils.analyzer import Analyzer from cortexutils.analyzer import Analyzer
@ -18,6 +19,8 @@ class VirusTotalAnalyzer(Analyzer):
self.service = self.getParam('config.service', None, 'Service parameter is missing') self.service = self.getParam('config.service', None, 'Service parameter is missing')
self.virustotal_key = self.getParam('config.key', None, 'Missing VirusTotal API key') self.virustotal_key = self.getParam('config.key', None, 'Missing VirusTotal API key')
self.polling_interval = self.getParam('config.polling_interval', 60) self.polling_interval = self.getParam('config.polling_interval', 60)
self.proxies = self.getParam('config.proxy', None)
def wait_file_report(self, id): def wait_file_report(self, id):
results = self.check_response(self.vt.get_file_report(id)) results = self.check_response(self.vt.get_file_report(id))
@ -133,8 +136,7 @@ class VirusTotalAnalyzer(Analyzer):
def run(self): def run(self):
Analyzer.run(self) Analyzer.run(self)
self.vt = VirusTotalPublicApi(self.virustotal_key, self.proxies)
self.vt = VirusTotalPublicApi(self.virustotal_key)
if self.service == 'scan': if self.service == 'scan':
if self.data_type == 'file': if self.data_type == 'file':