From cffda19f127879c91ff7ecf6ab37cbbfc80dafb3 Mon Sep 17 00:00:00 2001 From: opsdisk Date: Sun, 5 Sep 2021 17:30:03 -0500 Subject: [PATCH] Added suppport to disable SSL verification --- README.md | 2 +- pagodo.py | 19 ++++++++++++++++++- requirements.txt | 3 +-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 37eec3c..bef396c 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ them to `pagodo` Pass a comma separated string of proxies to `pagodo` using the `-p` switch. ```bash -python pagodo.py -g dorks.txt -p https://myproxy:8080,socks5h://127.0.0.1:9050,socks5h://127.0.0.1:9051 +python pagodo.py -g dorks.txt -p http://myproxy:8080,socks5h://127.0.0.1:9050,socks5h://127.0.0.1:9051 ``` You could even decrease the `-i` and `-x` values because you will be leveraging different proxy IPs. The proxies passed diff --git a/pagodo.py b/pagodo.py index c749a08..cd59f10 100644 --- a/pagodo.py +++ b/pagodo.py @@ -16,7 +16,7 @@ # Custom Python libraries. -__version__ = "2.0.0" +__version__ = "2.1.0" # Logging ROOT_LOGGER = logging.getLogger("pagodo") @@ -47,6 +47,7 @@ def __init__( save_urls_to_file=False, minimum_delay_between_dork_searches_in_seconds=37, maximum_delay_between_dork_searches_in_seconds=60, + disable_verify_ssl=False, verbosity=4, ): """Initialize Pagodo class object.""" @@ -89,6 +90,7 @@ def __init__( self.save_urls_to_file = save_urls_to_file self.minimum_delay_between_dork_searches_in_seconds = minimum_delay_between_dork_searches_in_seconds self.maximum_delay_between_dork_searches_in_seconds = maximum_delay_between_dork_searches_in_seconds + self.disable_verify_ssl = disable_verify_ssl self.verbosity = verbosity # Fancy way of generating a list of 20 random values between minimum_delay_between_dork_searches_in_seconds and @@ -197,6 +199,7 @@ def go(self): # Max desired valid URLs to collect per dork. max_search_result_urls_to_return=self.max_search_result_urls_to_return_per_dork, proxy=proxy, + verify_ssl=not self.disable_verify_ssl, verbosity=self.verbosity, ) @@ -261,6 +264,12 @@ def go(self): except Exception as e: ROOT_LOGGER.error(f"Error with dork: {dork}") ROOT_LOGGER.error(f"EXCEPTION: {e}") + if type(e).__name__ == "SSLError" and (not self.disable_verify_ssl): + ROOT_LOGGER.info( + "If you are using self-signed certificates for an HTTPS proxy, try-rerunning with the -l " + "switch to disable verifying SSL/TLS certificates. Exiting..." + ) + sys.exit(1) dork_counter += 1 @@ -318,6 +327,14 @@ def go(self): default=60, help="Maximum delay (in seconds) between a Google dork search. Default: 60", ) + parser.add_argument( + "-l", + dest="disable_verify_ssl", + action="store_true", + required=False, + default=False, + help="Disable SSL/TLS validation. Sometimes required if using an HTTPS proxy with self-signed certificates.", + ) parser.add_argument( "-m", dest="max_search_result_urls_to_return_per_dork", diff --git a/requirements.txt b/requirements.txt index f172324..f560a13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ beautifulsoup4==4.9.3 -colorama==0.4.4 -yagooglesearch==1.1.0 +yagooglesearch==1.2.0 requests==2.26.0