当前位置: 首页>>代码示例>>Python>>正文


Python Helpers.color方法代码示例

本文整理汇总了Python中Helpers.Helpers.color方法的典型用法代码示例。如果您正苦于以下问题:Python Helpers.color方法的具体用法?Python Helpers.color怎么用?Python Helpers.color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Helpers.Helpers的用法示例。


在下文中一共展示了Helpers.color方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TemplatePrint

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplatePrint(self, Task):
     '''
     This function will print 
     to the console the output of the email.
     '''
     try:
         EmailRender = Task.Render()
         RenderName = Task.RenderName
         with open(RenderName, "w+") as myfile:
             myfile.write(EmailRender)
         try:
             # time.sleep(0)
             temp = "\n"
             temp += subprocess.check_output(["w3m",
                                              "-dump", "-T", "text/html", RenderName])
             print Helpers.Reindent(temp, 1)
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is w3m installed (run Setup.sh)?")
             print e
         # now remove temp file
         # time.sleep(2)
         os.remove(RenderName)
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:27,代码来源:TaskController.py

示例2: TemplateRender

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateRender(self, Task):
     '''
     This function will return the location output
     This will default to the ~/Desktop/ folder
     '''
     try:
         EmailRender = Task.Render()
         # print EmailRender
         RenderName = Task.RenderName
         with open(RenderName, "w+") as myfile:
             myfile.write(EmailRender)
         try:
             # time.sleep(0)
             if ".eml" in RenderName:
                 subprocess.check_call(["icedove", RenderName])
             else:
                 temp = subprocess.check_call(["iceweasel", RenderName])
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is a default browser installed?")
         # now remove temp file
         # time.sleep(2)
         os.remove(RenderName)
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:27,代码来源:TaskController.py

示例3: TemplateCompleteScreen

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateCompleteScreen(self, Task, FileLocation, FileName, ModuleInt):
     '''
     Function takes in output data and presents it to user.
     '''
     self.TitleScreen()
     p = " [*] Email Template Generation has been completed:\n"
     line = """{0}
        Task Performed:\t\t{1}
        File Location: \t\t{2}
        Email File:\t\t\t{3}
     """.format(Helpers.color(p, green=True), Task.Name, FileLocation, FileName)
     print line
     # Now check if they want to open the file
     p = Helpers.color(
         " [>] ", status=True) + "Would you like to view the generated template? (y) or (n): "
     while True:
         a = raw_input(p)
         if a.lower() == "y":
             self.TemplateFinalRender(FileLocation, FileName, Task)
             break
         if a.lower() == "n":
             break
     p = Helpers.color(
         " [>] ", status=True) + "Would you like to return to Current Module? (y) or (n): "
     while True:
         a = raw_input(p)
         if a.lower() == "y":
             self.TemplateMenu(Task, ModuleInt)
             break
         if a.lower() == "n":
             self.TaskSelector()
     print line
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:34,代码来源:TaskController.py

示例4: TemplateView

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateView(self, Task):
     FileName = Task.SampleImage
     try:
         subprocess.check_call(["xdg-open", FileName])
     except Exception as e:
         s = "status 4"
         if s in str(e):
             print Helpers.color(" [!] Sorry no image submitted yet!")
         else:
             print Helpers.color(" [!] Is a default image viewer installed?")
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:12,代码来源:TaskController.py

示例5: TitleScreen

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TitleScreen(self):
     os.system('clear')
     # stolen from Veil :)
     p = "[Twitter]"
     w = "[Web]"
     print " ============================================================"
     print " Current: " + self.version + " | SimplyTemplate | " + Helpers.color(w, status=True) + ": CyberSyndicates.com"
     print " ============================================================"
     print "   " + Helpers.color(p, status=True) + ": @CyberSyndicates  | " + Helpers.color(p, status=True) + ": @Killswitch_gui"
     print " ============================================================"
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:12,代码来源:TaskController.py

示例6: Template_Info

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def Template_Info(self, Task):
     try:
         self.TitleScreen()
         print Helpers.color("\n Template Information:\n", status=True)
         for item in self.TemplateInfo:
             task = "Task." + str(item.rstrip(":"))
             if task == "Task.Sophistication":
                 if eval(task).lower() == "high":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), green=True)
                 if eval(task).lower() == "medium":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), firewall=True)
                 if eval(task).lower() == "low":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), warning=True)
             elif task == "Task.SampleImage":
                 print "\t" + item + "\t\t" + eval(task)
             elif task == "Task.Info":
                 print Helpers.FormatLong("Info:", Task.Info, spacing=24)
             else:
                 print "\t" + item + "\t\t\t" + eval(task)
         # https://github.com/Veil-Framework/Veil-Evasion/blob/master/modules/common/controller.py
         # Taken from line 246
         print Helpers.color("\n Template Required Options:\n", status=True)
         print " Setting\t\tValue Set\t\t\tDescription of Setting"
         print " -------\t\t---------\t\t\t----------------------"
         for key in sorted(Task.RequiredOptions.iterkeys()):
             print " %s%s%s" % ('{0: <16}'.format(key).ljust(23), '{0: <8}'.format(Task.RequiredOptions[key][0]).ljust(32), Task.RequiredOptions[key][1])
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number\n"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:33,代码来源:TaskController.py

示例7: ModuleSelection

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def ModuleSelection(self, selection):
     ModuleInt = int(selection[1])
     try:
         SelectedModule = self.Dmodules[ModuleInt]
         Task = SelectedModule.TemplateModule()
         return Task
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:13,代码来源:TaskController.py

示例8: TemplateGen

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateGen(self, Task, ModuleInt):
     '''
     This Function takes in the template Task Object
     It will run the pre-defined Class Call
     '''
     try:
         FileLocation = self.TemplateLocation()
         Name = self.TemplateName(Task)
         Task.Generate(FileLocation, Name, Verbose=False)
         self.TemplateCompleteScreen(Task, FileLocation, Name, ModuleInt)
     except Exception as e:
         p = " [!] Major issue with template gen: " + str(e)
         print Helpers.color(p, warning=True)
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:15,代码来源:TaskController.py

示例9: TemplateMenu

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
    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
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:51,代码来源:TaskController.py

示例10: TemplateSet

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
    def TemplateSet(self, Task, Value, Raw):
        try:
            option = Value[1]
            if Value[1] not in Task.RequiredOptions:
                print Helpers.color(" [!] Invalid option specified.", firewall=True)

            else:
                Raw = Raw.strip(Value[0])
                Raw = Raw.lstrip(' ')
                Raw = Raw.lstrip(Value[1])
                Raw = Raw.lstrip(' ')
                Task.RequiredOptions[option][0] = Raw
                return
        except Exception as e:
            print e
            print Helpers.color(" [!] Error in setting option, likely invalid option name.", firewall=True)
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:18,代码来源:TaskController.py

示例11: ModuleRequiredOptions

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def ModuleRequiredOptions(self, selection):
     ModuleInt = int(selection[1])
     try:
         SelectedModule = self.Dmodules[ModuleInt]
         Task = SelectedModule.TemplateModule()
         # https://github.com/Veil-Framework/Veil-Evasion/blob/master/modules/common/controller.py
         # Taken from line 246
         print Helpers.color("\n Template Required Options:\n", status=True)
         print " Setting\t\tValue Set\t\tDescription of Setting"
         print " -------\t\t---------\t\t----------------------"
         for key in sorted(Task.RequiredOptions.iterkeys()):
             print " %s%s%s" % ('{0: <16}'.format(key).ljust(10), '{0: <8}'.format(Task.RequiredOptions[key][0]).ljust(30), Task.RequiredOptions[key][1])
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number\n"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:19,代码来源:TaskController.py

示例12: TemplateFinalRender

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateFinalRender(self, FilePath, FileName, Task):
     '''
     This function will open the 
     Produced .MHT file
     '''
     try:
         # print EmailRender
         Path = str(FilePath) + str(FileName)
         try:
             time.sleep(1)
             if ".eml" in Path:
                 subprocess.check_call(["icedove", "-File", Path])
             else:
                 subprocess.check_call(["iceweasel", Path])
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is a Iceweasel browser installed? (Run Setup)")
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:21,代码来源:TaskController.py

示例13: ListModules

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
    def ListModules(self):
        self.TitleScreen()
        print Helpers.color("\n  [*] Available Modules are:\t\t\t\t Core Options:\t\t\tSophistication:", blue=True)
        print "  -------------------------\t\t\t\t -------------\t\t\t---------------"

        lastBase = None
        x = 1
        for name in self.Modules:
            parts = name.split("/")
            if lastBase and parts[0] != lastBase:
                print ""
            lastBase = parts[0]
            SelectedModule = self.Modules[name]
            Task = SelectedModule.TemplateModule()
            if x < 10:
                print "  %s)   %s" % (str(x).ljust(1), '{0: <24}'.format(name).ljust(50)) + Task.CoreOptions.ljust(32) + "[" + Task.Sophistication + "]"
            if x >= 10:
                print "  %s)  %s" % (str(x).ljust(1), '{0: <24}'.format(name).ljust(50)) + Task.CoreOptions.ljust(32) + "[" + Task.Sophistication + "]"
            x += 1
        print ""
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:22,代码来源:TaskController.py

示例14: TemplateEdit

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateEdit(self, Task, Value, Raw):
     try:
         try:
             if Task.RequiredText:
                 EditValue = True
         except:
             EditValue = False
             print Helpers.color(" [!] Template does not support edit yet!")
         if EditValue:
             if Value[1] not in Task.RequiredText:
                 print Helpers.color(" [!] Invalid option specified.", firewall=True)
             else:
                 Text = Task.RequiredText[Value[1]][0]
                 raw = TemplateEdit.root(Text)
                 if raw:
                     Task.RequiredText[Value[1]][0] = raw
                 return
             # raw = TemplateEdit.root(str(self.RequiredText["TextBlock1"][0]))
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:22,代码来源:TaskController.py

示例15: TemplateRequiredOptions

# 需要导入模块: from Helpers import Helpers [as 别名]
# 或者: from Helpers.Helpers import color [as 别名]
 def TemplateRequiredOptions(self, Task):
     '''
     Function for required option for "only" a template.
     '''
     try:
         # https://github.com/Veil-Framework/Veil-Evasion/blob/master/modules/common/controller.py
         # Taken from line 246
         print Helpers.color("\n Template Required Options:\n", status=True)
         print " Setting\t\tValue Set\t\t\tDescription of Setting"
         print " -------\t\t---------\t\t\t----------------------"
         for key in sorted(Task.RequiredOptions.iterkeys()):
             print " %s%s%s" % ('{0: <16}'.format(key).ljust(23), '{0: <8}'.format(Task.RequiredOptions[key][0]).ljust(32), Task.RequiredOptions[key][1])
         try:
             if Task.RequiredText:
                 print Helpers.color("\n Template TextEdit Options:\n", status=True)
                 print " Setting\t\tValue Set\t\t\tDescription of Setting"
                 print " -------\t\t---------\t\t\t----------------------"
                 for key in sorted(Task.RequiredText.iterkeys()):
                     print " %s%s%s" % ('{0: <16}'.format(key).ljust(23), '{0: <8}'.format(Task.RequiredText[key][0].replace("\n", "")[0:25] + str('..')).ljust(32), Task.RequiredText[key][1])
         except Exception as e:
             pass
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number\n"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:28,代码来源:TaskController.py


注:本文中的Helpers.Helpers.color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。