scapy.scapypipes

class scapy.scapypipes.ConvertPipe(low_type=None, high_type=None, name=None)

Bases: scapy.pipetool.Drain

进入时发送的数据包将转换为另一种类型的数据包.

   +-------------+
>>-|--[convert]--|->>
   |             |
 >-|--[convert]--|->
   +-------------+

See Packet.convert_packet.

high_push(msg)
push(msg)
class scapy.scapypipes.FDSourceSink(fd, name=None)

Bases: scapy.pipetool.Source

使用文件描述符作为源和接收器

   +-------------+
>>-|             |->>
   |             |
 >-|-[file desc]-|->
   +-------------+
deliver()
fileno()
push(msg)
class scapy.scapypipes.Inject3Sink(iface=None, name=None)

Bases: scapy.scapypipes.InjectSink

start()
class scapy.scapypipes.InjectSink(iface=None, name=None)

Bases: scapy.pipetool.Sink

低输入接收的数据包被注入接口

   +-----------+
>>-|           |->>
   |           |
 >-|--[iface]  |->
   +-----------+
push(msg)
start()
stop()
class scapy.scapypipes.RdpcapSource(fname, name=None)

Bases: scapy.pipetool.Source

从PCAP文件读取的数据包会将它们发送到低出口.

   +----------+
>>-|          |->>
   |          |
 >-|  [pcap]--|->
   +----------+
check_recv()
deliver()
fileno()
start()
stop()
class scapy.scapypipes.SniffSource(iface=None, filter=None, socket=None, name=None)

Bases: scapy.pipetool.Source

从接口读取数据包并将其发送到低出口.

   +-----------+
>>-|           |->>
   |           |
 >-|  [iface]--|->
   +-----------+

如果没有指定ifacesocket参数,则Scapy将从第一个网络接口捕获.

Parameters
  • iface –嗅探数据包的第2层接口. 与socket参数互斥.

  • filter –捕获时使用的数据包过滤器. 参见L2listen . 不与socket参数一起使用.

  • 套接字SuperSocket数据包的SuperSocket 套接字 .

check_recv()
deliver()
fileno()
start()
stop()
class scapy.scapypipes.TCPConnectPipe(addr='', port=0, name=None)

Bases: scapy.pipetool.Source

TCP连接到addr:port并将其用作源和接收器

   +-------------+
>>-|             |->>
   |             |
 >-|-[addr:port]-|->
   +-------------+
deliver()
fileno()
push(msg)
start()
stop()
class scapy.scapypipes.TCPListenPipe(addr='', port=0, name=None)

Bases: scapy.scapypipes.TCPConnectPipe

TCP在[addr:]端口上侦听并使用第一个连接作为源和接收器; 发送对等地址到高输出

   +------^------+
>>-|    +-[peer]-|->>
   |   /         |
 >-|-[addr:port]-|->
   +-------------+
deliver()
push(msg)
start()
class scapy.scapypipes.TriggerDrain(f, name=None)

Bases: scapy.pipetool.Drain

传递消息并在满足条件时触发

   +------^------+
>>-|-[condition]-|->>
   |      |      |
 >-|-[condition]-|->
   +-------------+
high_push(msg)
push(msg)
class scapy.scapypipes.TriggeredMessage(msg, name=None)

Bases: scapy.pipetool.Drain

触发并链式触发时发送预加载的消息

   +------^------+
>>-|      | /----|->>
   |      |/     |
 >-|-[ message ]-|->
   +------^------+
on_trigger(trigmsg)
class scapy.scapypipes.TriggeredQueueingValve(start_state=True, name=None)

Bases: scapy.pipetool.Drain

让消息交替传递或排队,在触发时更改

   +------^-------+
>>-|-[pass/queue]-|->>
   |      |       |
 >-|-[pass/queue]-|->
   +------^-------+
high_push(msg)
on_trigger(msg)
push(msg)
start()
class scapy.scapypipes.TriggeredSwitch(start_state=True, name=None)

Bases: scapy.pipetool.Drain

让消息交替地高或低,触发时改变

   +------^------+
>>-|-\    |    /-|->>
   |  [up/down]  |
 >-|-/    |    \-|->
   +------^------+
high_push(msg)
on_trigger(msg)
push(msg)
class scapy.scapypipes.TriggeredValve(start_state=True, name=None)

Bases: scapy.pipetool.Drain

让消息交替传递或不传递,在触发时更改

   +------^------+
>>-|-[pass/stop]-|->>
   |      |      |
 >-|-[pass/stop]-|->
   +------^------+
high_push(msg)
on_trigger(msg)
push(msg)
class scapy.scapypipes.UDPDrain(ip='127.0.0.1', port=1234)

Bases: scapy.pipetool.Drain

高入口处接收到的UDP有效负载通过UDP发送

   +-------------+
>>-|--[payload]--|->>
   |      X      |
 >-|----[UDP]----|->
   +-------------+
high_push(msg)
push(msg)
class scapy.scapypipes.WiresharkSink(name=None, linktype=None, args=None)

Bases: scapy.scapypipes.WrpcapSink

低输入端收到的数据包将推送到Wireshark.

   +----------+
>>-|          |->>
   |          |
 >-|--[pcap]  |->
   +----------+
start()
class scapy.scapypipes.WrpcapSink(fname, name=None, linktype=None)

Bases: scapy.pipetool.Sink

低输入收到的数据包将写入PCAP文件

   +----------+
>>-|          |->>
   |          |
 >-|--[pcap]  |->
   +----------+
push(msg)
start()
stop()