def add_poc(self, poc, fullname=None): ret = False poc = self.format_poc(poc) if self.check_poc(poc): try: load_string_to_module(poc, fullname) ret = True except Exception as ex: msg = "[PLUGIN] load PoC script failed: {0}".format(str(ex)) single_time_warn_message(msg) else: err_msg = "[PLUGIN] invalid pocsuite3 PoC code" logger.error(err_msg) return ret
def add_poc_from_file(self, filename): ret = False if os.path.exists(filename): try: load_file_to_module(filename) ret = True except SystemExit: pass except Exception as ex: msg = "[PLUGIN] load PoC script failed: {0}".format(str(ex)) single_time_warn_message(msg) else: err_msg = "[PLUGIN] invalid pocsuite3 PoC file {}".format(filename) logger.error(err_msg) return ret