def _attack_mode(self, mod): """ 根据不同模式发起不同的验证 :param mod: 模式类型 verify|attack|shell :return: """ # 设置全局参数 if self.current_module.current_protocol == POC_CATEGORY.PROTOCOL.HTTP: target = self.current_module.getg_option("target") else: rhost = self.current_module.getg_option("rhost") rport = self.current_module.getg_option("rport") ssl = self.current_module.getg_option("ssl") scheme = "http" if ssl: scheme = "https" target = "{scheme}://{rhost}:{rport}".format(scheme=scheme, rhost=rhost, rport=rport) conf.mode = mod kb.task_queue.put((target, self.current_module)) try: start() except PocsuiteShellQuitException: pass kb.results = []
def main(): """ @function Main function of pocsuite when running from command line. """ try: check_environment() set_paths(module_path()) banner() init_options(cmd_line_parser().__dict__) data_to_stdout("[*] starting at {0}\n\n".format(time.strftime("%X"))) init() try: start() except threading.ThreadError: raise except PocsuiteUserQuitException: pass except PocsuiteShellQuitException: pass except PocsuiteSystemException: pass except KeyboardInterrupt: pass except EOFError: pass except SystemExit: pass except Exception: exc_msg = traceback.format_exc() data_to_stdout(exc_msg) raise SystemExit finally: data_to_stdout("\n[*] shutting down at {0}\n\n".format( time.strftime("%X")))
def start_pocsuite(): start()