From 604dc2a3fdc2d402e90df7be3222929c7bce285e Mon Sep 17 00:00:00 2001 From: L1ghtn1ng Date: Wed, 25 Dec 2019 00:53:22 +0000 Subject: [PATCH] Update github ci and a style fixes --- .github/workflows/theHarvester.yml | 2 +- theHarvester/__main__.py | 18 ++++++------------ theHarvester/lib/core.py | 3 ++- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/theHarvester.yml b/.github/workflows/theHarvester.yml index c02d2897..66f04fbb 100644 --- a/.github/workflows/theHarvester.yml +++ b/.github/workflows/theHarvester.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v1.1.1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index 18553a20..a4a1da5c 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -25,20 +25,14 @@ async def start(): parser.add_argument('-d', '--domain', help='company name or domain to search', required=True) parser.add_argument('-l', '--limit', help='limit the number of search results, default=500', default=500, type=int) parser.add_argument('-S', '--start', help='start with result number X, default=0', default=0, type=int) - parser.add_argument('-g', '--google-dork', help='use Google Dorks for Google search', default=False, - action='store_true') - parser.add_argument('-p', '--port-scan', help='scan the detected hosts and check for Takeovers (21,22,80,443,8080)', - default=False, action='store_true') - parser.add_argument('-s', '--shodan', help='use Shodan to query discovered hosts', default=False, - action='store_true') - parser.add_argument('-v', '--virtual-host', help='verify host name via DNS resolution and search for virtual hosts', - action='store_const', const='basic', default=False) + parser.add_argument('-g', '--google-dork', help='use Google Dorks for Google search', default=False, action='store_true') + parser.add_argument('-p', '--port-scan', help='scan the detected hosts and check for Takeovers (21,22,80,443,8080)', default=False, action='store_true') + parser.add_argument('-s', '--shodan', help='use Shodan to query discovered hosts', default=False, action='store_true') + parser.add_argument('-v', '--virtual-host', help='verify host name via DNS resolution and search for virtual hosts', action='store_const', const='basic', default=False) parser.add_argument('-e', '--dns-server', help='DNS server to use for lookup') parser.add_argument('-t', '--dns-tld', help='perform a DNS TLD expansion discovery, default False', default=False) - parser.add_argument('-n', '--dns-lookup', help='enable DNS server lookup, default False', default=False, - action='store_true') - parser.add_argument('-c', '--dns-brute', help='perform a DNS brute force on the domain', default=False, - action='store_true') + parser.add_argument('-n', '--dns-lookup', help='enable DNS server lookup, default False', default=False, action='store_true') + parser.add_argument('-c', '--dns-brute', help='perform a DNS brute force on the domain', default=False, action='store_true') parser.add_argument('-f', '--filename', help='save the results to an HTML and/or XML file', default='', type=str) parser.add_argument('-b', '--source', help='''baidu, bing, bingapi, certspotter, crtsh, dnsdumpster, dogpile, duckduckgo, goofile, github-code, google, diff --git a/theHarvester/lib/core.py b/theHarvester/lib/core.py index c3ce957c..a7ee1358 100644 --- a/theHarvester/lib/core.py +++ b/theHarvester/lib/core.py @@ -390,8 +390,9 @@ class AsyncFetcher: @staticmethod async def fetch_all(urls, headers='', params='') -> list: - timeout = aiohttp.ClientTimeout(total=30) # By default timeout is 5 minutes, 30 seconds should suffice + timeout = aiohttp.ClientTimeout(total=30) + if len(headers) == 0: headers = {'User-Agent': Core.get_user_agent()} if len(params) == 0: