|
16 | 16 |
|
17 | 17 | # Custom Python libraries. |
18 | 18 |
|
19 | | -__version__ = "2.0.0" |
| 19 | +__version__ = "2.1.0" |
20 | 20 |
|
21 | 21 | # Logging |
22 | 22 | ROOT_LOGGER = logging.getLogger("pagodo") |
@@ -47,6 +47,7 @@ def __init__( |
47 | 47 | save_urls_to_file=False, |
48 | 48 | minimum_delay_between_dork_searches_in_seconds=37, |
49 | 49 | maximum_delay_between_dork_searches_in_seconds=60, |
| 50 | + disable_verify_ssl=False, |
50 | 51 | verbosity=4, |
51 | 52 | ): |
52 | 53 | """Initialize Pagodo class object.""" |
@@ -89,6 +90,7 @@ def __init__( |
89 | 90 | self.save_urls_to_file = save_urls_to_file |
90 | 91 | self.minimum_delay_between_dork_searches_in_seconds = minimum_delay_between_dork_searches_in_seconds |
91 | 92 | self.maximum_delay_between_dork_searches_in_seconds = maximum_delay_between_dork_searches_in_seconds |
| 93 | + self.disable_verify_ssl = disable_verify_ssl |
92 | 94 | self.verbosity = verbosity |
93 | 95 |
|
94 | 96 | # 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): |
197 | 199 | # Max desired valid URLs to collect per dork. |
198 | 200 | max_search_result_urls_to_return=self.max_search_result_urls_to_return_per_dork, |
199 | 201 | proxy=proxy, |
| 202 | + verify_ssl=not self.disable_verify_ssl, |
200 | 203 | verbosity=self.verbosity, |
201 | 204 | ) |
202 | 205 |
|
@@ -261,6 +264,12 @@ def go(self): |
261 | 264 | except Exception as e: |
262 | 265 | ROOT_LOGGER.error(f"Error with dork: {dork}") |
263 | 266 | ROOT_LOGGER.error(f"EXCEPTION: {e}") |
| 267 | + if type(e).__name__ == "SSLError" and (not self.disable_verify_ssl): |
| 268 | + ROOT_LOGGER.info( |
| 269 | + "If you are using self-signed certificates for an HTTPS proxy, try-rerunning with the -l " |
| 270 | + "switch to disable verifying SSL/TLS certificates. Exiting..." |
| 271 | + ) |
| 272 | + sys.exit(1) |
264 | 273 |
|
265 | 274 | dork_counter += 1 |
266 | 275 |
|
@@ -318,6 +327,14 @@ def go(self): |
318 | 327 | default=60, |
319 | 328 | help="Maximum delay (in seconds) between a Google dork search. Default: 60", |
320 | 329 | ) |
| 330 | + parser.add_argument( |
| 331 | + "-l", |
| 332 | + dest="disable_verify_ssl", |
| 333 | + action="store_true", |
| 334 | + required=False, |
| 335 | + default=False, |
| 336 | + help="Disable SSL/TLS validation. Sometimes required if using an HTTPS proxy with self-signed certificates.", |
| 337 | + ) |
321 | 338 | parser.add_argument( |
322 | 339 | "-m", |
323 | 340 | dest="max_search_result_urls_to_return_per_dork", |
|
0 commit comments