Skip to content

Commit

Permalink
#130 - set and call VT API with configured proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Dec 21, 2017
1 parent 1c4d3ec commit 6359dd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions analyzers/VirusTotal/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import hashlib

from virustotal_api import PublicApi as VirusTotalPublicApi
#from virus_total_apis import PublicApi as VirusTotalPublicApi
from cortexutils.analyzer import Analyzer


Expand All @@ -18,6 +19,8 @@ def __init__(self):
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))
Expand Down Expand Up @@ -133,8 +136,7 @@ def summary(self, raw):

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':
Expand Down

0 comments on commit 6359dd8

Please sign in to comment.