@@ -138,6 +138,29 @@ def HandleResponse(self, res):
138
138
else :
139
139
return False
140
140
141
+ class Shodan (BaseThreaded ):
142
+ def __init__ (self , domain , shared = None ):
143
+ BaseThreaded .__init__ (self , domain , shared )
144
+ self .BASE_URL = "https://beta.shodan.io/domain/{domain}"
145
+ self .url = self .BASE_URL .format (domain = domain )
146
+
147
+ def SendRequest (self , url ):
148
+ return self .session .get (url , stream = True )
149
+
150
+ def HandleResponse (self , res ):
151
+ sc = res .status_code
152
+ if sc == 200 :
153
+ res = BS (res .text ,"lxml" )
154
+ domains = res .find_all ("ul" ,{"id" : "subdomains" })[0 ].find_all ("li" )
155
+ for dom in domains :
156
+ dom_name = "{0}.{1}"
157
+ dom_full = dom_name .format (dom .text .replace ("*." ,"09." ),self .domain )
158
+ self .domains .append (dom_full )
159
+ self .done = True
160
+ return True
161
+ else :
162
+ return False
163
+
141
164
class Censys (BaseThreaded ):
142
165
Q = queue .Queue ()
143
166
def __init__ (self , domain , shared = None ):
@@ -237,10 +260,10 @@ def main(domain):
237
260
subdomains_final = multiprocessing .Manager ().list ()
238
261
239
262
if not config ["COOKIE" ]['fb_cookie' ] == "" :
240
- active_resources = [Crt , FDNS , VirusTotal , CertSpotter , Censys ]
263
+ active_resources = [Crt , FDNS , Shodan , VirusTotal , CertSpotter , Censys ]
241
264
else :
242
265
asset_logger .error ("Facebook cookies not found ignoring Censys, VirusTotal" )
243
- active_resources = [Crt , FDNS , CertSpotter ]
266
+ active_resources = [Crt , FDNS , CertSpotter , Shodan ]
244
267
245
268
threads = [resource (domain , subdomains_final ) for resource in active_resources ]
246
269
for thread in threads :
0 commit comments