Skip to content

Commit bfe00b3

Browse files
author
Mohamed Elbadry
committed
Gasset update
1 parent 8d79061 commit bfe00b3

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

Diff for: lib/thirdparty/Gasset/asset.py

+25-2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@ def HandleResponse(self, res):
138138
else:
139139
return False
140140

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+
141164
class Censys(BaseThreaded):
142165
Q = queue.Queue()
143166
def __init__(self, domain, shared=None):
@@ -237,10 +260,10 @@ def main(domain):
237260
subdomains_final = multiprocessing.Manager().list()
238261

239262
if not config["COOKIE"]['fb_cookie'] == "":
240-
active_resources = [Crt, FDNS, VirusTotal, CertSpotter, Censys]
263+
active_resources = [Crt, FDNS, Shodan, VirusTotal, CertSpotter, Censys]
241264
else:
242265
asset_logger.error("Facebook cookies not found ignoring Censys, VirusTotal")
243-
active_resources = [Crt, FDNS, CertSpotter]
266+
active_resources = [Crt, FDNS, CertSpotter, Shodan]
244267

245268
threads = [resource(domain, subdomains_final) for resource in active_resources]
246269
for thread in threads:

0 commit comments

Comments
 (0)