From 9ba63bc690220c7f96298e6ccb3ddacbd73ce6fe Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Tue, 11 Feb 2020 14:25:03 -0500 Subject: [PATCH 1/2] Fixed error where would attempt to fetch with proxy as empty string. --- theHarvester/lib/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theHarvester/lib/core.py b/theHarvester/lib/core.py index b51db7b5..9852f99e 100644 --- a/theHarvester/lib/core.py +++ b/theHarvester/lib/core.py @@ -95,7 +95,7 @@ def proxy_list() -> List: with open('/etc/theHarvester/proxies.yaml', 'r') as api_keys: keys = yaml.safe_load(api_keys) except FileNotFoundError: - with open('proxies.yaml', 'r') as api_keys: + with open('/mnt/d/repos/theHarvester/proxies.yaml', 'r') as api_keys: keys = yaml.safe_load(api_keys) http_list = [f'http://{proxy}' for proxy in keys['http']] if keys['http'] is not None else [] return http_list @@ -434,7 +434,7 @@ async def fetch(session, url, params='', json=False, proxy="") -> Union[str, dic async with session.get(url, params=params, proxy=proxy) as response: return await response.text() if json is False else await response.json() else: - async with session.get(url, proxy=proxy) as response: + async with session.get(url) as response: await asyncio.sleep(2) return await response.text() if json is False else await response.json() From 11e498128540ec1aaeab313cc8d96af8f1c8693e Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Tue, 11 Feb 2020 14:31:42 -0500 Subject: [PATCH 2/2] Pushed change. --- theHarvester/lib/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theHarvester/lib/core.py b/theHarvester/lib/core.py index 9852f99e..5efbf825 100644 --- a/theHarvester/lib/core.py +++ b/theHarvester/lib/core.py @@ -95,7 +95,7 @@ def proxy_list() -> List: with open('/etc/theHarvester/proxies.yaml', 'r') as api_keys: keys = yaml.safe_load(api_keys) except FileNotFoundError: - with open('/mnt/d/repos/theHarvester/proxies.yaml', 'r') as api_keys: + with open('proxies.yaml', 'r') as api_keys: keys = yaml.safe_load(api_keys) http_list = [f'http://{proxy}' for proxy in keys['http']] if keys['http'] is not None else [] return http_list