def init_options(input_options=AttribDict(), override_options=False): cmd_line_options.update(input_options) _set_conf_attributes() _set_poc_options(input_options) _set_kb_attributes() _merge_options(input_options, override_options) # export rules, dont run the poc in the default status if conf.rule or conf.rule_req: logger.info( "The rule export function is in use. The POC is not executed at this point" ) if conf.pocs_path: if check_path(conf.pocs_path): paths.USER_POCS_PATH = conf.pocs_path for root, dirs, files in os.walk(paths.USER_POCS_PATH): files = list( filter( lambda x: not x.startswith("__") and x.endswith( ".py"), files)) regex_rule(list(paths.USER_POCS_PATH + i for i in files)) if conf.poc: regex_rule(conf.poc) exit() # if check version if conf.show_version: exit()
def init_options(input_options=AttribDict(), override_options=False): cmd_line_options.update(input_options) _set_conf_attributes() _set_poc_options(input_options) _set_kb_attributes() _merge_options(input_options, override_options) # if check version if conf.show_version: exit()
def main(): """ @function Main function of pocsuite when running from command line. """ try: check_environment() set_paths(module_path()) banner() cmd_line_options.update(cmd_line_parser().__dict__) init_options(cmd_line_options) 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 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 init_options(input_options=AttribDict(), override_options=False): cmd_line_options.update(input_options) _set_conf_attributes() _set_poc_options(input_options) _set_kb_attributes() _merge_options(input_options, override_options)