Merge pull request #53 from mikemadden42/master
Add whitespace after modulo & comma.
This commit is contained in:
commit
9f69fdb000
25
sublist3r.py
25
sublist3r.py
|
|
@ -71,6 +71,7 @@ def parser_error(errmsg):
|
||||||
print(R + "Error: " + errmsg + W)
|
print(R + "Error: " + errmsg + W)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
# parse the arguments
|
# parse the arguments
|
||||||
parser = argparse.ArgumentParser(epilog='\tExample: \r\npython ' + sys.argv[0] + " -d google.com")
|
parser = argparse.ArgumentParser(epilog='\tExample: \r\npython ' + sys.argv[0] + " -d google.com")
|
||||||
|
|
@ -274,7 +275,7 @@ class GoogleEnum(enumratorBaseThreaded):
|
||||||
subdomain = urlparse.urlparse(link).netloc
|
subdomain = urlparse.urlparse(link).netloc
|
||||||
if subdomain and subdomain not in self.subdomains and subdomain != self.domain:
|
if subdomain and 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
|
||||||
|
|
@ -308,7 +309,7 @@ class YahooEnum(enumratorBaseThreaded):
|
||||||
self.engine_name = "Yahoo"
|
self.engine_name = "Yahoo"
|
||||||
self.MAX_DOMAINS = 10
|
self.MAX_DOMAINS = 10
|
||||||
self.MAX_PAGES = 0
|
self.MAX_PAGES = 0
|
||||||
super(YahooEnum, self).__init__(base_url, self.engine_name,domain, subdomains, q=q, silent=silent, verbose=verbose)
|
super(YahooEnum, self).__init__(base_url, self.engine_name, domain, subdomains, q=q, silent=silent, verbose=verbose)
|
||||||
self.q = q
|
self.q = q
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -373,7 +374,7 @@ class AskEnum(enumratorBaseThreaded):
|
||||||
subdomain = urlparse.urlparse(link).netloc
|
subdomain = urlparse.urlparse(link).netloc
|
||||||
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
|
||||||
|
|
@ -517,7 +518,7 @@ class NetcraftEnum(enumratorBaseThreaded):
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
resp = self.session.get(url, headers=headers, timeout=self.timeout,cookies=cookies)
|
resp = self.session.get(url, headers=headers, timeout=self.timeout, cookies=cookies)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.print_(e)
|
self.print_(e)
|
||||||
resp = None
|
resp = None
|
||||||
|
|
@ -573,6 +574,7 @@ class NetcraftEnum(enumratorBaseThreaded):
|
||||||
pass
|
pass
|
||||||
return links_list
|
return links_list
|
||||||
|
|
||||||
|
|
||||||
class DNSdumpster(enumratorBaseThreaded):
|
class DNSdumpster(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 []
|
||||||
|
|
@ -693,7 +695,7 @@ class Virustotal(enumratorBaseThreaded):
|
||||||
return self.subdomains
|
return self.subdomains
|
||||||
|
|
||||||
def extract_domains(self, resp):
|
def extract_domains(self, resp):
|
||||||
link_regx = re.compile('<div class="enum.*?">.*?<a target="_blank" href=".*?">(.*?)</a>',re.S)
|
link_regx = re.compile('<div class="enum.*?">.*?<a target="_blank" href=".*?">(.*?)</a>', re.S)
|
||||||
try:
|
try:
|
||||||
links = link_regx.findall(resp)
|
links = link_regx.findall(resp)
|
||||||
for link in links:
|
for link in links:
|
||||||
|
|
@ -754,7 +756,7 @@ class ThreatCrowd(enumratorBaseThreaded):
|
||||||
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 as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
@ -806,7 +808,7 @@ class CrtSearch(enumratorBaseThreaded):
|
||||||
|
|
||||||
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 as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
@ -854,7 +856,7 @@ class PassiveDNS(enumratorBaseThreaded):
|
||||||
subdomain = link[:link.find('[')].strip()
|
subdomain = link[:link.find('[')].strip()
|
||||||
if subdomain not in self.subdomains and subdomain != self.domain and subdomain.endswith(self.domain):
|
if subdomain not in self.subdomains and subdomain != self.domain and subdomain.endswith(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
|
||||||
|
|
@ -889,6 +891,7 @@ class portscan():
|
||||||
t = threading.Thread(target=self.port_scan, args=(subdomain, self.ports))
|
t = threading.Thread(target=self.port_scan, args=(subdomain, self.ports))
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
|
|
||||||
def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, engines):
|
def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, engines):
|
||||||
bruteforce_list = set()
|
bruteforce_list = set()
|
||||||
search_list = set()
|
search_list = set()
|
||||||
|
|
@ -915,7 +918,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
|
||||||
parsed_domain = urlparse.urlparse(domain)
|
parsed_domain = urlparse.urlparse(domain)
|
||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
print(B + "[-] Enumerating subdomains now for %s"%parsed_domain.netloc + W)
|
print(B + "[-] Enumerating subdomains now for %s" % parsed_domain.netloc + W)
|
||||||
|
|
||||||
if verbose and not silent:
|
if verbose and not silent:
|
||||||
print(Y + "[-] verbosity is enabled, will show the subdomains results in realtime" + W)
|
print(Y + "[-] verbosity is enabled, will show the subdomains results in realtime" + W)
|
||||||
|
|
@ -983,7 +986,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
|
||||||
|
|
||||||
if ports:
|
if ports:
|
||||||
if not silent:
|
if not silent:
|
||||||
print(G + "[-] Start port scan now for the following ports: %s%s" % (Y,ports) + W)
|
print(G + "[-] Start port scan now for the following ports: %s%s" % (Y, ports) + W)
|
||||||
ports = ports.split(',')
|
ports = ports.split(',')
|
||||||
pscan = portscan(subdomains, ports)
|
pscan = portscan(subdomains, ports)
|
||||||
pscan.run()
|
pscan.run()
|
||||||
|
|
@ -994,7 +997,7 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
|
||||||
return subdomains
|
return subdomains
|
||||||
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__ == "__main__":
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
domain = args.domain
|
domain = args.domain
|
||||||
threads = args.threads
|
threads = args.threads
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue