def do_use(self, plugin): """ 加载插件 :param plugin: string, 插件名称 :return: """ #在use新插件的时候要清除已经设置的变量以及结果 initializeKb() ClearConf() kb.CurrentPlugin = plugin zsp = PluginBase(package='zsplugins') plugin_zsp = zsp.make_plugin_source( searchpath=[paths.ZEROSCAN_PLUGINS_PATH]) expNames = plugin_zsp.list_plugins() if kb.CurrentPlugin: if plugin in expNames: self.prompt = "ZEROScan exploit({color}{content}{color_reset}) > ".format( color=Fore.RED, content=kb.CurrentPlugin, color_reset=Fore.RESET) else: log.error("plugin is not exist!") else: log.error("use <plugin>")
def main(): paths.ZEROSCAN_ROOT_PATH = modulePath() setPaths() kb.unloadedList = {} initializeKb() initializeExp() zs = baseConsole() zs.cmdloop()
def do_back(self, line): """ 返回主菜单 :param line: :return: """ ClearConf() initializeKb() self.current_plugin = "" self.prompt = "ZEROScan > "
def do_use(self, plugin): """ 加载插件 :param plugin: string, 插件名称 :return: """ #在use新插件的时候要清除已经设置的变量以及结果 initializeKb() ClearConf() kb.CurrentPlugin = plugin zsp = PluginBase(package='zsplugins') plugin_zsp = zsp.make_plugin_source(searchpath=[paths.ZEROSCAN_PLUGINS_PATH]) expNames = plugin_zsp.list_plugins() if kb.CurrentPlugin: if plugin in expNames: self.prompt = "ZEROScan exploit({color}{content}{color_reset}) > ".format( color=Fore.RED, content=kb.CurrentPlugin, color_reset=Fore.RESET) else: log.error("plugin is not exist!") else: log.error("use <plugin>")
def do_set(self, arg): """ 设置参数 :param arg: string, 以空格分割 option, value :return: """ try: initializeKb() if kb.CurrentPlugin: if len(arg.split()) == 2: option = arg.split()[0] value = arg.split()[1] rn = SetOption(option, value) if rn.startswith("Invalid option:"): log.error(rn) else: print rn else: log.error("set <option> <value>") else: log.error("Select a plugin first.") except: log.error("Select a plugin first.")
def do_clear(self, args): initializeKb() pass
#-*- coding:utf-8 -*- """ Copyright (c) 2014-2015 pocsuite developers (http://sebug.net) See the file 'docs/COPYING' for copying permission """ import sys from pocsuite import modulePath from lib.core.consoles import baseConsole from lib.core.data import kb from lib.core.data import paths from lib.core.common import setPaths from lib.core.consoles import initializePoc from lib.core.option import initializeKb if __name__ == "__main__": folders, sys.argv = sys.argv[1:], sys.argv[:1] paths.POCSUITE_ROOT_PATH = modulePath() setPaths() kb.unloadedList = {} initializeKb() initializePoc(folders) pcs = baseConsole() pcs.cmdloop()
#!/usr/bin/env python #-*- coding:utf-8 -*- """ Copyright (c) 2014-2015 pocsuite developers (http://sebug.net) See the file 'docs/COPYING' for copying permission """ import sys from pocsuite import modulePath from lib.core.consoles import baseConsole from lib.core.data import kb from lib.core.data import paths from lib.core.common import setPaths from lib.core.consoles import initializePoc from lib.core.option import initializeKb if __name__ == "__main__": folders, sys.argv = sys.argv[1:], sys.argv[:1] paths.POCSUITE_ROOT_PATH = modulePath() setPaths() kb.unloadedList = {} initializeKb() initializePoc(folders) pcs = baseConsole() pcs.cmdloop()