From 7b664cced5b516b617512f8ef7d63578dd9b43d6 Mon Sep 17 00:00:00 2001 From: labu Date: Wed, 4 Dec 2024 13:22:18 +0100 Subject: [PATCH] add proxies to phistank_checkurl.py --- analyzers/PhishTank/phishtank_checkurl.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/analyzers/PhishTank/phishtank_checkurl.py b/analyzers/PhishTank/phishtank_checkurl.py index bf1d2f37f..77b3319ec 100755 --- a/analyzers/PhishTank/phishtank_checkurl.py +++ b/analyzers/PhishTank/phishtank_checkurl.py @@ -8,14 +8,15 @@ class PhishtankAnalyzer(Analyzer): def __init__(self): Analyzer.__init__(self) - self.phishtank_key = self.get_param('config.key', None, - 'Missing PhishTank API key') + self.phishtank_key = self.get_param('config.key', None, 'Missing PhishTank API key') + self.proxies = {'http': self.get_param('config.proxy_http', None), + 'https': self.get_param('config.proxy_https', None)} def phishtank_checkurl(self, data): url = 'https://checkurl.phishtank.com/checkurl/' postheaders = {"User-Agent": "phishtank/cortex"} postdata = {'url': data, 'format': 'json', 'app_key': self.phishtank_key} - r = requests.post(url, headers=postheaders, data=postdata) + r = requests.post(url, headers=postheaders, data=postdata, proxies=self.proxies) return r.json() def summary(self, raw):