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


Python Color.pe方法代码示例

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


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

示例1: call

# 需要导入模块: from Color import Color [as 别名]
# 或者: from Color.Color import pe [as 别名]
    def call(command, cwd=None,shell=False):
        '''
            Calls a command (either string or list of args).
            Returns tuple:
                (stdout, stderr)
        '''
        if type(command) != str or ' ' in command or shell:
            shell = True
            if Configuration.verbose > 1:
                Color.pe("\n {C}[?] {W} Executing (Shell): {B}%s{W}" % command)
        else:
            shell = False
            if Configuration.verbose > 1:
                Color.pe("\n {C}[?]{W} Executing: {B}%s{W}" % command)

        pid = Popen(command, cwd=cwd, stdout=PIPE, stderr=PIPE, shell=shell)
        pid.wait()
        (stdout, stderr) = pid.communicate()

        if Configuration.verbose > 1 and stdout.strip() != '':
            Color.pe("{P} [stdout] %s{W}" % '\n [stdout] '.join(stdout.split('\n')))
        if Configuration.verbose > 1 and stderr.strip() != '':
            Color.pe("{P} [stderr] %s{W}" % '\n [stderr] '.join(stderr.split('\n')))

        return (stdout, stderr)
开发者ID:Andrey-Omelyanuk,项目名称:wifite2,代码行数:27,代码来源:Process.py

示例2: deauth_hidden_targets

# 需要导入模块: from Color import Color [as 别名]
# 或者: from Color.Color import pe [as 别名]
    def deauth_hidden_targets(self):
        '''
            Sends deauths (to broadcast and to each client) for all
            targets (APs) that have unknown ESSIDs (hidden router names).
        '''
        self.decloaking = False

        # Do not deauth if requested
        if Configuration.no_deauth: return

        # Do not deauth if channel is not fixed.
        if self.channel is None: return

        # Reusable deauth command
        deauth_cmd = [
            'aireplay-ng',
            '-0', # Deauthentication
            str(Configuration.num_deauths), # Number of deauth packets to send
            '--ignore-negative-one'
        ]
        for target in self.targets:
            if target.essid_known: continue
            now = int(time.time())
            secs_since_decloak = now - self.decloaked_times.get(target.bssid, 0)
            # Decloak every AP once every 30 seconds
            if secs_since_decloak < 30: continue
            self.decloaking = True
            self.decloaked_times[target.bssid] = now
            if Configuration.verbose > 1:
                from Color import Color
                verbout = " [?] Deauthing %s" % target.bssid
                verbout += " (broadcast & %d clients)" % len(target.clients)
                Color.pe("\n{C}" + verbout + "{W}")
            # Deauth broadcast
            iface = Configuration.interface
            Process(deauth_cmd + ['-a', target.bssid, iface])
            # Deauth clients
            for client in target.clients:
                Process(deauth_cmd + ['-a', target.bssid, '-c', client.bssid, iface])
开发者ID:schoonc,项目名称:wifite2,代码行数:41,代码来源:Airodump.py

示例3: __init__

# 需要导入模块: from Color import Color [as 别名]
# 或者: from Color.Color import pe [as 别名]
    def __init__(self, command, devnull=False, stdout=PIPE, stderr=PIPE, cwd=None):
        ''' Starts executing command '''

        if type(command) == str:
            # Commands have to be a list
            command = command.split(' ')

        self.command = command

        if Configuration.verbose > 1:
            Color.pe("\n {C}[?] {W} Executing: {B}%s{W}" % ' '.join(command))

        self.out = None
        self.err = None
        if devnull:
            sout = Process.devnull()
            serr = Process.devnull()
        else:
            sout = stdout
            serr = stderr

        self.start_time = time.time()

        self.pid = Popen(command, stdout=sout, stderr=serr, cwd=cwd)
开发者ID:Andrey-Omelyanuk,项目名称:wifite2,代码行数:26,代码来源:Process.py

示例4: stderr

# 需要导入模块: from Color import Color [as 别名]
# 或者: from Color.Color import pe [as 别名]
 def stderr(self):
     ''' Waits for process to finish, returns stderr output '''
     self.get_output()
     if Configuration.verbose > 1 and self.err.strip() != '':
         Color.pe("{P} [stderr] %s{W}" % '\n [stderr] '.join(self.err.split('\n')))
     return self.err
开发者ID:Andrey-Omelyanuk,项目名称:wifite2,代码行数:8,代码来源:Process.py


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