def __init__(self): super(PrintThread, self).__init__() if platform.system() == 'Windows': init(convert=True) else: pass self.daemon = True
def error(string): """ retun a error information :param string: string, the string you want to print :return: """ init(autoreset=True) print(Fore.RED + "[!]" + string)
def warn(string): """ retun a warning information :param string: string, the string you want to print :return: """ init(autoreset=True) print(Fore.YELLOW + "[!]" + string)
def process(string): """ retun the process information :param string: string, the string you want to print :return: """ init(autoreset=True) print(Fore.BLUE + "[!]" + string)
def success(string): """ retun a success information :param string: string, the string you want to print :return: """ init(autoreset=True) print(Fore.GREEN + "[!]" + string)
def __init__(self, color): init() self.mutex = threading.Lock() self.blacklists = {} self.mutexCheckedPaths = threading.Lock() self.basePath = None self.errors = 0 self.color = color
def __init__(self): init() self.ORIG = Style.NORMAL + Fore.RESET self.HEADER = Back.CYAN + Style.BRIGHT + Fore.WHITE self.BR_GREEN = Style.BRIGHT + Fore.GREEN self.BR_CYAN = Style.BRIGHT + Fore.CYAN self.BR_YELLOW = Style.BRIGHT + Fore.YELLOW self.BR_RED = Style.BRIGHT + Fore.RED self.BR_MAGENTA = Style.BRIGHT + Fore.MAGENTA
def __init__(self, color): init() self.mutex = threading.Lock() self.blacklists = {} self.mutex_checked_paths = threading.Lock() self.base_path = None self.errors = 0 if not color: self.disable_colors()
def __init__(self, color): init() self.lastLength = 0 self.lastOutput = "" self.lastInLine = False self.mutex = threading.Lock() self.blacklists = {} self.basePath = None self.errors = 0 self.color = color
def __init__(self, color): init() self.last_length = 0 self.last_output = "" self.last_in_line = False self.mutex = threading.Lock() self.blacklists = {} self.base_path = None self.errors = 0 if not color: self.disable_colors()
def __init__(self, colors=True): self.colors = colors self.fore_table = { "red": Fore.RED, "green": Fore.GREEN, "yellow": Fore.YELLOW, "blue": Fore.BLUE, "magenta": Fore.MAGENTA, "cyan": Fore.CYAN, "white": Fore.WHITE } self.back_table = { "red": Back.RED, "green": Back.GREEN, "yellow": Back.YELLOW, "blue": Back.BLUE, "magenta": Back.MAGENTA, "cyan": Back.CYAN, "white": Back.WHITE } self.escape_seq = None self.prepare_sequence_escaper() init()
if len(result) != 0 and site not in self.sitesFromCrawler.keys(): self.sitesFromCrawler.update({site: result}) self.vprint("Found %s URL to SQLi scan" % (len(result)), 'cyan', 'info') self.vprint('-' * 35, 'yellow', 'info') self.vprint('SQLi scan started', 'green', 'info') for site, links in self.sitesFromCrawler.items(): self.vprint('Site: ' + site, 'yellow', 'info') for link in links: result = sqliscan.scan(link) if result == True: self.vprint('SQLi vuln! --> ' + link, 'cyan', 'info') elif result == "connection error": self.vprint('Connection error', 'red', 'err') self.vprint("Program shutting down", "yellow", "info") if __name__ == '__main__': init(autoreset=True) visql = viSQL() visql.main()
def initializeExp(): expNumber = 0 folders = [] if not os.path.isdir(paths.ZEROSCAN_PLUGINS_PATH): os.makedirs(paths.ZEROSCAN_PLUGINS_PATH) folders.append(paths.ZEROSCAN_PLUGINS_PATH) for folder in folders: files = os.listdir(folder) for file in files: if file.endswith(".py") and "__init__" not in file: expNumber += 1 kb.unloadedList.update({expNumber: os.path.join(folder, file)}) kb.expNumbers = expNumber init() class baseConsole(Cmd): """ ZEROScan 核心类 """ def __init__(self): Cmd.__init__(self) os.system("clear") banner() conf.url = None conf.urlFile = None conf.cookie = None #随机ua的实现
from proj.engine import Message from proj.runtime import context from thirdparty.ansiterm import termcolor import platform if platform.system() != "Windows": import readline from thirdparty import colorama # 通过colorama模块来做linux与windows下的控制台颜色适配 colorama.init() if sys.version_info.major != 2: raw_input = input if sys.version_info.major != 2: unicoded = lambda x, coding="utf-8": x else: unicoded = lambda x, coding="utf-8": x.decode(coding) class EncodedOutputStream(object): """ 针对某些不支持UTF-8编码的平台,需要包装一下标准输入输出 其实没有什么卵用,因为不同编码对字符的显示效果差别太大了 所以UTF-8都不支持的平台,俺为什么要做适配?
def main(): colorama.init() arg = argparse.ArgumentParser(usage=usage, description=description, epilog=epilog) printf(colorama.Fore.LIGHTBLUE_EX + banner + colorama.Fore.RESET) arg.add_argument("-u", type=str, help="set target url, must with protocl", metavar="") arg.add_argument("-U", type=str, help="set urls file", metavar="") arg.add_argument("-d", type=str, help="set dictionary, best to use txt format", default=default_dictionary, metavar="") arg.add_argument("-D", type=str, help="set dictionary folder", default=default_Dictionaryfolder, metavar="") arg.add_argument("-t", type=float, help="set timeout", metavar="", default=default_timeout) arg.add_argument( "-p", type=str, help="set proxy *format: ip:port@type, like 0.0.0.0:8080@http", default=default_proxy, metavar="") arg.add_argument("-P", type=str, help="set proxy file,random read", default="", metavar="") arg.add_argument("-m", type=str, help="set method, GET POST HEAD or others, default GET", default=default_method, metavar="") arg.add_argument("-e", type=int, help="set delay seconds, default 0", default=0, metavar="") arg.add_argument("-a", type=str, help="set User-Agent", default=default_ua, metavar="") arg.add_argument("-A", type=str, help="set User-Agent file,random read", default="", metavar="") arg.add_argument("-i", type=str, help="set ignore text", default=default_ignoretext, metavar="") arg.add_argument("-s", type=str, help="set whether to use SSL", default=default_ssl, metavar="") args = arg.parse_args() para = vars(args) url = addon.format_urls(para["u"], para["U"]) dictionary = addon.format_dicts(para["d"], para["D"]) timeout = addon.format_nums(para["t"]) proxy = addon.format_batchs(para["p"], para["P"]) delay = addon.format_nums(para["e"]) ua = addon.format_batchs(para["a"], para["A"]) ignore_text = para["i"] method = addon.filter_method(para["m"]) ssl = addon.read_file(para["s"]) if url and dictionary is None: for i in range(url.qsize()): target = net.Url(url.get(), "", timeout, proxy, delay, ua, ignore_text, method, ssl) target.get_info() elif url and dictionary: for i in range(url.qsize()): target = net.Url(url.get(), dictionary, timeout, proxy, delay, ua, ignore_text, method, ssl) target.set_reportfile() target.run() target.reconnect() report.end_html(target.report_filename)
def __init__(self, colors=True): self.colors = colors self.escape_seq = None self.prepare_sequence_escaper() init()
def initializeExp(): expNumber = 0 folders = [] if not os.path.isdir(paths.ZEROSCAN_PLUGINS_PATH): os.makedirs(paths.ZEROSCAN_PLUGINS_PATH) folders.append(paths.ZEROSCAN_PLUGINS_PATH) for folder in folders: files = os.listdir(folder) for file in files: if file.endswith(".py") and "__init__" not in file: expNumber += 1 kb.unloadedList.update({expNumber: os.path.join(folder, file)}) kb.expNumbers = expNumber init() class baseConsole(Cmd): """ ZEROScan 核心类 """ def __init__(self): Cmd.__init__(self) os.system("clear") banner() conf.url = None conf.urlFile = None conf.cookie = None
def main(): colorama.init() banner = """ ██ ▀▀ | dev <0.01> | ██ ██ ████▄██ ████ ██▄████ ▀█ ██ █▀ ██ ██ ██ ██ ██▀ ██ ██▄██▄██ ██ ██ ██ ██ ██ ██ ▀██ ██▀ ██ ██ ██ ▄▄▄██▄▄▄ ██ ██ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀▀▀▀▀▀▀ ▀▀ ▀▀ """ usage = "wmin.py -u url [options]" description = ''' Wmin is a web content discovery tool. It make requests and analyze the responses trying to figure out whether the resource is or not accessible. ''' epilog = "License, requests, etc: https://github.com/magician333/wmin" arg = argparse.ArgumentParser(usage=usage, description=description, epilog=epilog) printf(colorama.Fore.LIGHTBLUE_EX + banner + colorama.Fore.RESET) arg.add_argument("-u", type=str, help="set target url", default="", metavar="") arg.add_argument("-U", type=str, help="set urls file", default="", metavar="") arg.add_argument("-d", type=str, help="set dictionary", metavar="") arg.add_argument("-D", type=str, help="set dictionary folder", metavar="") # arg.add_argument("-r", type=str, help="set report filename", metavar="") arg.add_argument("-t", type=float, help="set timeout", metavar="", default=0.4) arg.add_argument("-p", type=str, help="set proxy *format: ip:port@type", default="", metavar="") arg.add_argument("-P", type=str, help="set proxy file,random read", default="", metavar="") arg.add_argument("-m", type=str, help="set method", default="get", metavar="") arg.add_argument("-e", type=int, help="set delay seconds", default=0, metavar="") arg.add_argument("-a", type=str, help="set User-Agent", metavar="", default="") arg.add_argument("-A", type=str, help="set User-Agent file,random read", default="", metavar="") arg.add_argument("-x", type=int, help="set multithreading number", default=1, metavar="") arg.add_argument("-X", type=int, help="set multiprocessing number", default=1, metavar="") arg.add_argument("-i", type=str, help="set ignore text", default="", metavar="") args = arg.parse_args() para = vars(args) url_list = addon.batch_deal(para["u"], para["U"]) dictionary = addon.deal_dict(para["d"], para["D"]) # report = addon.deal_report(para["r"]) timeout = addon.deal_num(para["t"]) proxy = addon.batch_deal(para["p"], para["P"]) delay = addon.deal_num(para["e"]) ua = addon.batch_deal(para["a"], para["A"]) ignore_text = para["i"] method = addon.filter_method(para["m"]) if "" != ignore_text and "head" == method: printf("Can't use head method and ignore text at same time", "error") exit() if url_list and dictionary is None: for url in url_list: target = Url.Url(url, "", timeout, proxy, delay, ua, ignore_text, method) target.get_info() elif url_list and dictionary: for url in url_list: target = Url.Url(url, dictionary, timeout, proxy, delay, ua, ignore_text, method) target.run()