Update sublist3r.py

Fix
This commit is contained in:
Kaustubh BM 2023-02-06 12:01:53 +05:30 committed by GitHub
parent f79a38dae9
commit 7a3b838b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 66 additions and 53 deletions

View File

@ -72,7 +72,15 @@ def no_color():
def banner(): def banner():
return print("""%s
____ _ _ _ _ _____
/ ___| _ _| |__ | (_)___| |_|___ / _ __
\___ \| | | | '_ \| | / __| __| |_ \| '__|
___) | |_| | |_) | | \__ \ |_ ___) | |
|____/ \__,_|_.__/|_|_|___/\__|____/|_|%s%s
# Coded By Ahmed Aboul-Ela - @aboul3la
""" % (R, W, Y))
def parser_error(errmsg): def parser_error(errmsg):
@ -665,55 +673,55 @@ class DNSdumpster(enumratorBaseThreaded):
return links return links
# class Virustotal(enumratorBaseThreaded): class Virustotal(enumratorBaseThreaded):
# def __init__(self, domain, subdomains=None, q=None, silent=False, verbose=True): def __init__(self, domain, subdomains=None, q=None, silent=False, verbose=True):
# subdomains = subdomains or [] subdomains = subdomains or []
# base_url = 'https://www.virustotal.com/ui/domains/{domain}/subdomains' base_url = 'https://www.virustotal.com/ui/domains/{domain}/subdomains'
# self.engine_name = "Virustotal" self.engine_name = "Virustotal"
# self.q = q self.q = q
# super(Virustotal, self).__init__(base_url, self.engine_name, domain, subdomains, q=q, silent=silent, verbose=verbose) super(Virustotal, self).__init__(base_url, self.engine_name, domain, subdomains, q=q, silent=silent, verbose=verbose)
# self.url = self.base_url.format(domain=self.domain) self.url = self.base_url.format(domain=self.domain)
# return return
#
# # the main send_req need to be rewritten # the main send_req need to be rewritten
# def send_req(self, url): def send_req(self, url):
# try: try:
# resp = self.session.get(url, headers=self.headers, timeout=self.timeout) resp = self.session.get(url, headers=self.headers, timeout=self.timeout)
# except Exception as e: except Exception as e:
# self.print_(e) self.print_(e)
# resp = None resp = None
#
# return self.get_response(resp) return self.get_response(resp)
#
# # once the send_req is rewritten we don't need to call this function, the stock one should be ok # once the send_req is rewritten we don't need to call this function, the stock one should be ok
# def enumerate(self): def enumerate(self):
# while self.url != '': while self.url != '':
# resp = self.send_req(self.url) resp = self.send_req(self.url)
# resp = json.loads(resp) resp = json.loads(resp)
# if 'error' in resp: if 'error' in resp:
# self.print_(R + "[!] Error: Virustotal probably now is blocking our requests" + W) self.print_(R + "[!] Error: Virustotal probably now is blocking our requests" + W)
# break break
# if 'links' in resp and 'next' in resp['links']: if 'links' in resp and 'next' in resp['links']:
# self.url = resp['links']['next'] self.url = resp['links']['next']
# else: else:
# self.url = '' self.url = ''
# self.extract_domains(resp) self.extract_domains(resp)
# return self.subdomains return self.subdomains
#
# def extract_domains(self, resp): def extract_domains(self, resp):
# #resp is already parsed as json #resp is already parsed as json
# try: try:
# for i in resp['data']: for i in resp['data']:
# if i['type'] == 'domain': if i['type'] == 'domain':
# subdomain = i['id'] subdomain = i['id']
# if not subdomain.endswith(self.domain): if not subdomain.endswith(self.domain):
# continue continue
# if subdomain not in self.subdomains and subdomain != self.domain: if subdomain not in self.subdomains and subdomain != self.domain:
# if self.verbose: if self.verbose:
# self.print_("%s%s: %s%s" % (R, self.engine_name, W, subdomain)) self.print_("%s%s: %s%s" % (R, self.engine_name, W, subdomain))
# self.subdomains.append(subdomain.strip()) self.subdomains.append(subdomain.strip())
# except Exception: except Exception:
# pass pass
class ThreatCrowd(enumratorBaseThreaded): class ThreatCrowd(enumratorBaseThreaded):
@ -911,6 +919,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
'ask': AskEnum, 'ask': AskEnum,
'netcraft': NetcraftEnum, 'netcraft': NetcraftEnum,
'dnsdumpster': DNSdumpster, 'dnsdumpster': DNSdumpster,
'virustotal': Virustotal,
'threatcrowd': ThreatCrowd, 'threatcrowd': ThreatCrowd,
'ssl': CrtSearch, 'ssl': CrtSearch,
'passivedns': PassiveDNS 'passivedns': PassiveDNS
@ -921,7 +930,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
if engines is None: if engines is None:
chosenEnums = [ chosenEnums = [
BaiduEnum, YahooEnum, GoogleEnum, BingEnum, AskEnum, BaiduEnum, YahooEnum, GoogleEnum, BingEnum, AskEnum,
NetcraftEnum, ThreatCrowd, NetcraftEnum, DNSdumpster, Virustotal, ThreatCrowd,
CrtSearch, PassiveDNS CrtSearch, PassiveDNS
] ]
else: else:
@ -988,10 +997,14 @@ def interactive():
engines = args.engines engines = args.engines
if verbose or verbose is None: if verbose or verbose is None:
verbose = True verbose = True
silent = args.silent
if args.no_color: if args.no_color:
no_color() no_color()
banner() if silent:
res = main(domain, threads, savefile, ports, silent= True, verbose=verbose, enable_bruteforce=enable_bruteforce, engines=engines) verbose = False
else:
banner()
res = main(domain, threads, savefile, ports, silent=silent, verbose=verbose, enable_bruteforce=enable_bruteforce, engines=engines)
if __name__ == "__main__": if __name__ == "__main__":
interactive() interactive()