Fixed broken Netcraft engine
This commit is contained in:
parent
61ebf366e0
commit
6af1b8c22b
14
sublist3r.py
14
sublist3r.py
|
|
@ -539,11 +539,14 @@ class NetcraftEnum(enumratorBaseThreaded):
|
||||||
resp = None
|
resp = None
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
def should_sleep(self):
|
||||||
|
time.sleep(random.randint(1, 2))
|
||||||
|
return
|
||||||
|
|
||||||
def get_next(self, resp):
|
def get_next(self, resp):
|
||||||
link_regx = re.compile('<A href="(.*?)"><b>Next page</b></a>')
|
link_regx = re.compile('<a.*?href="(.*?)">Next Page')
|
||||||
link = link_regx.findall(resp)
|
link = link_regx.findall(resp)
|
||||||
link = re.sub('host=.*?%s' % self.domain, 'host=%s' % self.domain, link[0])
|
url = 'http://searchdns.netcraft.com' + link[0]
|
||||||
url = 'http://searchdns.netcraft.com' + link
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def create_cookies(self, cookie):
|
def create_cookies(self, cookie):
|
||||||
|
|
@ -569,14 +572,15 @@ class NetcraftEnum(enumratorBaseThreaded):
|
||||||
while True:
|
while True:
|
||||||
resp = self.get_response(self.req(url, cookies))
|
resp = self.get_response(self.req(url, cookies))
|
||||||
self.extract_domains(resp)
|
self.extract_domains(resp)
|
||||||
if 'Next page' not in resp:
|
if 'Next Page' not in resp:
|
||||||
return self.subdomains
|
return self.subdomains
|
||||||
break
|
break
|
||||||
url = self.get_next(resp)
|
url = self.get_next(resp)
|
||||||
|
self.should_sleep()
|
||||||
|
|
||||||
def extract_domains(self, resp):
|
def extract_domains(self, resp):
|
||||||
links_list = list()
|
links_list = list()
|
||||||
link_regx = re.compile('<a href="http://toolbar.netcraft.com/site_report\?url=(.*)">')
|
link_regx = re.compile('<a class="results-table__host" href="(.*?)"')
|
||||||
try:
|
try:
|
||||||
links_list = link_regx.findall(resp)
|
links_list = link_regx.findall(resp)
|
||||||
for link in links_list:
|
for link in links_list:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue