def start(): if kb.targets and kb.targets.qsize() > 1: infoMsg = "pocsuite got a total of %d targets" % kb.targets.qsize() logger.log(CUSTOM_LOGGING.SYSINFO, infoMsg) runThreads(conf.threads, pocThreads) resultTable = PrettyTable(["target-url", "poc-name", "poc-id", "component", "version", "status"]) resultTable.padding_width = 1 if not kb.results: return toNum, sucNum = 0, 0 for row in kb.results: resultTable.add_row(list(row)[:-2]) toNum += 1 if row[5] == 'success': sucNum += 1 if not conf.quiet: print resultTable # infoMsg = "{} of {} success !".format(sucNum, toNum) # logger.log(CUSTOM_LOGGING.SYSINFO, infoMsg) print "success : {} / {}".format(sucNum, toNum) _createTargetDirs() _setRecordFiles() if conf.report: _setReport()
def do_show(self, args): graph = PrettyTable(["config", "value"]) graph.align["config"] = "l" for k, v in conf.iteritems(): if v and k != 'httpHeaders': graph.add_row([k, v]) print graph
def do_search(self, args): graph = PrettyTable(["pocId", "PocName"]) graph.align["PocName"] = "m" graph.padding_width = 1 for k, v in kb.unloadedList.iteritems(): if str(args) in v: graph.add_row([k, filepathParser(v)[1]]) print graph pass
def avaliable(): graph = PrettyTable(["pocId", "avaliablePocName", "Folder"]) graph.align["PocsName"] = "m" graph.padding_width = 1 for k, v in kb.unloadedList.iteritems(): path, name = filepathParser(v) graph.add_row([k, name, os.path.relpath(path, paths.POCSUITE_ROOT_PATH)]) print graph print
def do_unload(self, args): # TODO 补全 graph = PrettyTable(["pocId", "unloadPocsName"]) graph.align["unloadPocsName"] = "m" graph.padding_width = 1 if hasattr(kb, 'unloadedList') and getattr(kb, 'unloadedList'): for no in sorted(kb.unloadedList.keys()): from ntpath import split graph.add_row([no, split(kb.unloadedList[no])[1]]) else: graph.add_row(["0", "None"]) print graph print
def do_loaded(self, args): registerPocFromDict() graph = PrettyTable(["pocId", "loadedPocsName"]) graph.align["LoadedPocsName"] = "m" graph.padding_width = 1 count = 0 if hasattr(kb, 'registeredPocs') and getattr(kb, 'registeredPocs'): for poc in sorted(kb.registeredPocs.keys()): count += 1 graph.add_row([count, poc]) else: graph.add_row(["0", "None"]) print graph print
def do_unload(self, args): # TODO 补全 graph = PrettyTable(["pocId", "unloadPocsName"]) graph.align["unloadPocsName"] = "m" graph.padding_width = 1 count = 0 if hasattr(kb, 'unloadedList') and getattr(kb, 'unloadedList'): for no in sorted(kb.unloadedList.keys()): from ntpath import split graph.add_row([no, split(kb.unloadedList[no])[1]]) else: graph.add_row(["0", "None"]) print graph print