def main():
    Settings.path = os.getcwd()
    if args.debug:
        Settings.debug = True
    if args.dev:
        Settings.development = True
    if args.verbose:
        Settings.verbose = True
    if not args.q:
        utils.banner(db.index_modules())

    if args.x:
        for c in args.x.split(";"):
            Cli.start(c)
        Cli.start()
    elif args.r:
        try:
            with open(args.r, "r") as f:
                cmds = f.readlines()
                for cmd in cmds:
                    Cli.start(cmd.strip())
            Cli.start()
        except:
            error("Can't open the specifed resource file!")
            exit(0)
    else:
        Cli.start()
    #You think it's simple when you look here huh :"D
    sys.exit()
Exemplo n.º 2
0
def main():
    Settings.path = os.getcwd()
    if args.debug:
        Settings.debug = True
    if args.dev:
        Settings.development = True
    if args.verbose:
        Settings.verbose = True
    if not args.q:
        utils.banner(db.index_modules())

    if args.x:
        for c in args.x.split(";"):
            Cli.start(c)
        Cli.start()
    elif args.r:
        try:
            with open(args.r,"r") as f:
                cmds = f.readlines()
                for cmd in cmds:
                    Cli.start(cmd.strip())
            Cli.start()
        except:
            error("Can't open the specifed resource file!")
            exit(0)
    else:
        Cli.start()
    #You think it's simple when you look here huh :"D
    sys.exit()
Exemplo n.º 3
0
def command_reload(text=False):
    global modules
    modules = db.index_modules()
    status("Database updated! ( {} module(s) loaded now )".format(
        len(modules)))
    utils.Input_completer(
        all_keywords +
        utils.my_map(lambda x: utils.pythonize(x).split(".")[-1], modules))
Exemplo n.º 4
0
===============
	Command               Description
	----------            --------------
	list/show             List modules you can use.
	options               Displays options for the current module.
	set                   Sets a context-specific variable to a value.
	run                   Launch the current module.
	use     <module>      Use an available module.
	info    <module>      Get information about an available module.
	search  <text>        Search for a module by a specific text in its name or in its description.
	previous              Sets the previously loaded module as the current module.
	back                  Move back from the current context.
""" + end

global_options = {}
modules = db.index_modules()
module_keywords = ["options", "set", "run", "back", "close"]


def Exec(all_keywords):
    global global_options, module_keywords, cli_keywords
    module_keywords += all_keywords
    cli_keywords = all_keywords
    mod = importlib.import_module(
        utils.pythonize("core.modules." + Settings.running_module))
    if Settings.development:
        mod = utils.reload(mod)
    global_options = getattr(mod, 'execution').module_type.options
    if os.name != "nt":
        utils.Input_completer(module_keywords + modules)
    Settings.add_module(Settings.running_module)
Exemplo n.º 5
0
===============
	Command               Description
	----------            --------------
	list/show             List modules you can use.
	options               Displays options for the current module.
	set                   Sets a context-specific variable to a value.
	run                   Launch the current module.
	use     <module>      Use an available module.
	info    <module>      Get information about an available module.
	search  <text>        Search for a module by a specific text in its name or in its description.
	previous              Sets the previously loaded module as the current module.
	back                  Move back from the current context.
"""+end

global_options = {}
modules = db.index_modules()
module_keywords = ["options","set","run","back","close"]
def Exec(all_keywords):
	global global_options, module_keywords, cli_keywords
	module_keywords += all_keywords
	cli_keywords = all_keywords
	mod            = importlib.import_module(utils.pythonize("core.modules."+Settings.running_module))
	if Settings.development:
		mod            = utils.reload(mod)
	global_options = getattr(mod, 'execution').module_type.options
	if os.name !="nt":
		utils.Input_completer(module_keywords+modules)
	Settings.add_module(Settings.running_module)

def handle(c):
	if c=="" or c[0]=="#":return