Skip to content

Commit

Permalink
Merge pull request #62 from opsdisk/add-verify_ssl-option
Browse files Browse the repository at this point in the history
Added suppport to disable SSL verification
  • Loading branch information
opsdisk authored Sep 5, 2021
2 parents 53d70cc + cffda19 commit da32f63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion pagodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Custom Python libraries.

__version__ = "2.0.0"
__version__ = "2.1.0"

# Logging
ROOT_LOGGER = logging.getLogger("pagodo")
Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
beautifulsoup4==4.9.3
colorama==0.4.4
yagooglesearch==1.1.0
yagooglesearch==1.2.0
requests==2.26.0

0 comments on commit da32f63

Please sign in to comment.