33# Standard Python libraries.
44import argparse
55import json
6+ import urllib3
67
78# Third party Python libraries.
89from bs4 import BeautifulSoup
1112# Custom Python libraries.
1213
1314
14- __version__ = "1.0 .0"
15+ __version__ = "1.1 .0"
1516
1617"""
1718Dork dictionary example:
@@ -63,7 +64,21 @@ def retrieve_google_dorks(
6364 }
6465
6566 print (f"[+] Requesting URL: { url } " )
66- response = requests .get (url , headers = headers , timeout = 10 )
67+ try :
68+ response = requests .get (
69+ url ,
70+ headers = headers ,
71+ timeout = 10 ,
72+ )
73+ except requests .exceptions .SSLError :
74+ requests .packages .urllib3 .disable_warnings ()
75+ urllib3 .disable_warnings (urllib3 .exceptions .InsecureRequestWarning )
76+ response = requests .get (
77+ url ,
78+ headers = headers ,
79+ timeout = 10 ,
80+ verify = False ,
81+ )
6782
6883 if response .status_code != 200 :
6984 print (f"[-] Error retrieving google dorks from: { url } " )
@@ -84,7 +99,6 @@ def retrieve_google_dorks(
8499
85100 # Loop through dorks, collecting and organizing them.
86101 for dork in json_dorks :
87-
88102 # Extract dork from <a href> using BeautifulSoup.
89103 # "<a href=\"/ghdb/5052\">inurl:_cpanel/forgotpwd</a>"
90104 soup = BeautifulSoup (dork ["url_title" ], "html.parser" )
@@ -99,7 +113,6 @@ def retrieve_google_dorks(
99113
100114 # Create an empty list for each category if it doesn't already exist.
101115 if numeric_category_id not in category_dict :
102-
103116 category_dict [numeric_category_id ] = {"category_name" : category_name , "dorks" : []}
104117
105118 # Some of the URL titles have trailing tabs, use replace() to remove it in place. The strip() method cannot be
@@ -110,12 +123,10 @@ def retrieve_google_dorks(
110123
111124 # If requested, break up dorks into individual files based off category.
112125 if save_individual_categories_to_files :
113-
114126 # Sort category_dict based off the numeric keys.
115127 category_dict = dict (sorted (category_dict .items ()))
116128
117129 for key , value in category_dict .items ():
118-
119130 # Provide some category metrics.
120131 print (f"[*] Category { key } ('{ value ['category_name' ]} ') has { len (value ['dorks' ])} dorks" )
121132
@@ -163,7 +174,6 @@ def retrieve_google_dorks(
163174
164175
165176if __name__ == "__main__" :
166-
167177 categories = {
168178 1 : "Footholds" ,
169179 2 : "File Containing Usernames" ,
0 commit comments