def TemplateMenu(self, Task, ModuleInt):

        # start with Template menu and printing out the modules
        self.TitleScreen()
        p = "\n Template Loaded: " + Helpers.color(Task.Name, status=True)
        print p + "\n\n"
        self.TemplateRequiredOptions(Task)
        self.ModuleCommands()
        # setup module commands and required lists
        cmddict = self.TemplateCmdLoopCommands(Task)
        # now call cmd loop
        CmdLoop.start_loop(cmddict)
        while True:
            try:
                a = CmdLoop.input_loop()
                # a = raw_input(Helpers.color(p,status=True))
                if a.startswith("set") or a.startswith("s"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "set" or Split[0].lower(
                        ) == "s":
                            self.TemplateSet(Task, Split, a)
                    except Exception as e:
                        print e
                        print Helpers.color(
                            " [!] You must use [set] with Value",
                            firewall=True)
                if a.startswith("edit") or a.startswith("e"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "edit" or Split[0].lower(
                        ) == "e":
                            self.TemplateEdit(Task, Split, a)
                    except Exception as e:
                        print Helpers.color(
                            " [!] You must use [edit] with Value",
                            firewall=True)
                if a.lower() == "gen" or a.lower() == "g" or a.lower(
                ) == "run":
                    self.TemplateGen(Task, ModuleInt)
                if a.lower() == "info" or a.lower() == "i":
                    self.Template_Info(Task)
                if a.lower() == "view" or a.lower() == "v":
                    self.TemplateView(Task)
                if a.lower() == "print" or a.lower() == "p":
                    self.TemplatePrint(Task)
                if a.lower() == "render" or a.lower() == "r":
                    self.TemplateRender(Task)
                if a.lower() == "back" or a.lower() == "b":
                    self.TaskSelector()
                if a.lower() == "help" or a.lower() == "h" or a.lower() == "?":
                    self.ModuleHelp()
                if a.lower() == "exit":
                    Helpers.Exit()
            except Exception as e:
                print a
예제 #2
0
    def TemplateMenu(self, Task, ModuleInt):

        # start with Template menu and printing out the modules
        self.TitleScreen()
        p = "\n Template Loaded: " + Helpers.color(Task.Name, status=True)
        print p + "\n\n"
        self.TemplateRequiredOptions(Task)
        self.ModuleCommands()
        # setup module commands and required lists
        cmddict = self.TemplateCmdLoopCommands(Task)
        # now call cmd loop
        CmdLoop.start_loop(cmddict)
        while True:
            try:
                a = CmdLoop.input_loop()
                # a = raw_input(Helpers.color(p,status=True))
                if a.startswith("set") or a.startswith("s"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "set" or Split[0].lower() == "s":
                            self.TemplateSet(Task, Split, a)
                    except Exception as e:
                        print e
                        print Helpers.color(" [!] You must use [set] with Value", firewall=True)
                if a.startswith("edit") or a.startswith("e"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "edit" or Split[0].lower() == "e":
                            self.TemplateEdit(Task, Split, a)
                    except Exception as e:
                        print Helpers.color(" [!] You must use [edit] with Value", firewall=True)
                if a.lower() == "gen" or a.lower() == "g" or a.lower() == "run":
                    self.TemplateGen(Task, ModuleInt)
                if a.lower() == "info" or a.lower() == "i":
                    self.Template_Info(Task)
                if a.lower() == "view" or a.lower() == "v":
                    self.TemplateView(Task)
                if a.lower() == "print" or a.lower() == "p":
                    self.TemplatePrint(Task)
                if a.lower() == "render" or a.lower() == "r":
                    self.TemplateRender(Task)
                if a.lower() == "back" or a.lower() == "b":
                    self.TaskSelector()
                if a.lower() == "help" or a.lower() == "h" or a.lower() == "?":
                    self.ModuleHelp()
                if a.lower() == "exit":
                    Helpers.Exit()
            except Exception as e:
                print a
예제 #3
0
    def PromptSelection(self):
        # setup module commands and required lists
        cmddict = self.MainCmdLoopCommands()
        # now call cmd loop
        CmdLoop.start_loop(cmddict)
        # We also have to strip off and verfiy the number
        # make sure we strip when checking command
        # p = " [>] "
        # a = raw_input(Helpers.color(p,status=True))
        a = CmdLoop.input_loop()
        # Gives me a list of words of ints
        try:
            Split = Helpers.GetWords(a)
            if Split[0].lower() == "use" or Split[0].lower() == "u":
                # we will use this to select our module of choice
                # it will call a separate function to handle the Int
                # of the requested module

                Task = self.ModuleSelection(Split)
                self.TemplateMenu(Task, Split)
            if Split[0].lower() == "info" or Split[0].lower() == "i":
                self.ModuleInfo(Split)
        except Exception as e:
            pass
        if a.lower() == "help" or a.lower() == "h" or a.lower() == "?":
            self.ModuleHelp()
        try:
            if Split[0].lower() == "search" or Split[0].lower() == "s":
                self.ModuleSearch(Split)
        except Exception as e:
            pass
        if a.lower() == "list" or a.lower() == "l":
            self.ListModules()
            self.PromptSelection()
        if a.lower() == "update" or a.lower() == "u":
            Helpers.SelfUpdate()
        if a.lower() == "exit":
            Helpers.Exit()
        else:
            self.PromptSelection()
        return a
예제 #4
0
    def PromptSelection(self):
        # setup module commands and required lists
        cmddict = self.MainCmdLoopCommands()
        # now call cmd loop
        CmdLoop.start_loop(cmddict)
        # We also have to strip off and verfiy the number
        # make sure we strip when checking command
        # p = " [>] "
        # a = raw_input(Helpers.color(p,status=True))
        a = CmdLoop.input_loop()
        # Gives me a list of words of ints
        try:
            Split = Helpers.GetWords(a)
            if Split[0].lower() == "use" or Split[0].lower() == "u":
                # we will use this to select our module of choice
                # it will call a separate function to handle the Int
                # of the requested module

                Task = self.ModuleSelection(Split)
                self.TemplateMenu(Task, Split)
            if Split[0].lower() == "info" or Split[0].lower() == "i":
                self.ModuleInfo(Split)
        except Exception as e:
            pass
        if a.lower() == "help" or a.lower() == "h" or a.lower() == "?":
            self.ModuleHelp()
        try:
            if Split[0].lower() == "search" or Split[0].lower() == "s":
                self.ModuleSearch(Split)
        except Exception as e:
            pass
        if a.lower() == "list" or a.lower() == "l":
            self.ListModules()
            self.PromptSelection()
        if a.lower() == "update" or a.lower() == "u":
            Helpers.SelfUpdate()
        if a.lower() == "exit":
            Helpers.Exit()
        else:
            self.PromptSelection()
        return a