Skip to content

Commit

Permalink
Fixed the '<BR>' issue in CrtSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
aboul3la committed Apr 5, 2020
1 parent 3f5fc6d commit 61ebf36
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions sublist3r.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ def __init__(self, base_url, engine_name, domain, subdomains=None, silent=False,
self.silent = silent
self.verbose = verbose
self.headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.8',
'Accept-Encoding': 'gzip',
}
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.8',
'Accept-Encoding': 'gzip',
}
self.print_banner()

def print_(self, text):
Expand Down Expand Up @@ -792,18 +792,26 @@ def extract_domains(self, resp):
try:
links = link_regx.findall(resp)
for link in links:
subdomain = link.strip()
if not subdomain.endswith(self.domain) or '*' in subdomain:
continue
link = link.strip()
subdomains = []
if '<BR>' in link:
subdomains = link.split('<BR>')
else:
subdomains.append(link)

for subdomain in subdomains:
if not subdomain.endswith(self.domain) or '*' in subdomain:
continue

if '@' in subdomain:
subdomain = subdomain[subdomain.find('@')+1:]
if '@' in subdomain:
subdomain = subdomain[subdomain.find('@')+1:]

if subdomain not in self.subdomains and subdomain != self.domain:
if self.verbose:
self.print_("%s%s: %s%s" % (R, self.engine_name, W, subdomain))
self.subdomains.append(subdomain.strip())
if subdomain not in self.subdomains and subdomain != self.domain:
if self.verbose:
self.print_("%s%s: %s%s" % (R, self.engine_name, W, subdomain))
self.subdomains.append(subdomain.strip())
except Exception as e:
print(e)
pass


Expand Down

0 comments on commit 61ebf36

Please sign in to comment.