From bf8b7a49d174adfae6a7645b6ef5a546c920f790 Mon Sep 17 00:00:00 2001 From: Steve Bate Date: Sat, 27 Jun 2020 08:11:17 -0400 Subject: [PATCH 1/2] Added code to support Windows 10 operation. Manually tested with Python 3.8.3. Using SelectorEventLoop because of issues with default ProactorEventLoop on Windows (e.g., missing add_reader implementation needed by aiodns). Made the uvloop install requirement conditional on the operating system (skipped on Windows platforms). This change doesn't allow setup.py to run on Windows (because of /etc/theHarvester reference), but supports running theHarvester.py directly from a cloned workspace. --- requirements/base.txt | 2 +- theHarvester.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 3a063c09..c884e16f 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -11,5 +11,5 @@ retrying==1.3.3 shodan==1.23.0 texttable==1.6.2 lxml==4.5.1 -uvloop==0.14.0 +uvloop==0.14.0; platform_system != "Windows" certifi==2020.4.5.1 \ No newline at end of file diff --git a/theHarvester.py b/theHarvester.py index 707860ff..cb30ceb8 100755 --- a/theHarvester.py +++ b/theHarvester.py @@ -4,7 +4,6 @@ from platform import python_version import sys import asyncio -import uvloop if python_version()[0:3] < '3.7': print('\033[93m[!] Make sure you have Python 3.7+ installed, quitting.\n\n \033[0m') @@ -12,5 +11,10 @@ from theHarvester import __main__ -uvloop.install() +if sys.platform == 'win32': + asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy +else: + import uvloop + uvloop.install() + asyncio.run(__main__.entry_point()) From 3728560c8bc822dc9bcaae76807b0671d2e3b239 Mon Sep 17 00:00:00 2001 From: L1ghtn1ng Date: Sun, 28 Jun 2020 16:05:12 +0100 Subject: [PATCH 2/2] Update deps --- requirements/base.txt | 8 ++++---- requirements/dev.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index c884e16f..03bef306 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -3,13 +3,13 @@ aiohttp==3.6.2 aiosqlite==0.13.0 beautifulsoup4==4.9.1 dnspython==1.16.0 -netaddr==0.7.19 -plotly==4.7.1 +netaddr==0.7.20 +plotly==4.8.2 PyYAML==5.3.1 -requests==2.23.0 +requests==2.24.0 retrying==1.3.3 shodan==1.23.0 texttable==1.6.2 lxml==4.5.1 uvloop==0.14.0; platform_system != "Windows" -certifi==2020.4.5.1 \ No newline at end of file +certifi==2020.6.20 \ No newline at end of file diff --git a/requirements/dev.txt b/requirements/dev.txt index cb07c592..6cce9103 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,7 +1,7 @@ -r base.txt -flake8==3.8.2 -mypy==0.770 +flake8==3.8.3 +mypy==0.782 mypy-extensions==0.4.3 pyflakes==2.2.0 -pytest==5.4.2 -pytest-asyncio==0.12.0 \ No newline at end of file +pytest==5.4.3 +pytest-asyncio==0.14.0 \ No newline at end of file