scapy.scapypipes
- class scapy.scapypipes.FDSourceSink(fd: ObjectPipe[Any], name: Any | None = None)[源代码]
基类:
SourceUse a file descriptor as source and sink
+-------------+ >>-| |->> | | >-|-[file desc]-|-> +-------------+
- class scapy.scapypipes.Inject3Sink(iface: NetworkInterface | str | None = None, name: str | None = None)[源代码]
基类:
InjectSink
- class scapy.scapypipes.InjectSink(iface: NetworkInterface | str | None = None, name: str | None = None)[源代码]
基类:
SinkPackets received on low input are injected to an interface
+-----------+ >>-| |->> | | >-|--[iface] |-> +-----------+
- class scapy.scapypipes.RdpcapSource(fname: str, name: Any | None = None)[源代码]
基类:
SourceRead packets from a PCAP file send them to low exit.
+----------+ >>-| |->> | | >-| [pcap]--|-> +----------+
- class scapy.scapypipes.SniffSource(iface: str | None = None, filter: Any | None = None, socket: SuperSocket | None = None, name: Any | None = None)[源代码]
基类:
SourceRead packets from an interface and send them to low exit.
+-----------+ >>-| |->> | | >-| [iface]--|-> +-----------+
If neither of the
ifaceorsocketparameters are specified, then Scapy will capture from the first network interface.- 参数:
iface -- A layer 2 interface to sniff packets from. Mutually exclusive with the
socketparameter.filter -- Packet filter to use while capturing. See
L2listen. Not used withsocketparameter.socket -- A
SuperSocketto sniff packets from.
- class scapy.scapypipes.TCPConnectPipe(addr: str = '', port: int = 0, name: str | None = None)[源代码]
基类:
SourceTCP connect to addr:port and use it as source and sink
+-------------+ >>-| |->> | | >-|-[addr:port]-|-> +-------------+
- class scapy.scapypipes.TCPListenPipe(addr: str = '', port: int = 0, name: str | None = None)[源代码]
-
TCP listen on [addr:]port and use first connection as source and sink; send peer address to high output
+------^------+ >>-| +-[peer]-|->> | / | >-|-[addr:port]-|-> +-------------+
- class scapy.scapypipes.TriggerDrain(f: Callable[[...], None], name: str | None = None)[源代码]
基类:
DrainPass messages and trigger when a condition is met
+------^------+ >>-|-[condition]-|->> | | | >-|-[condition]-|-> +-------------+
- class scapy.scapypipes.TriggeredMessage(msg: str, name: Any | None = None)[源代码]
基类:
DrainSend a preloaded message when triggered and trigger in chain
+------^------+ >>-| | /----|->> | |/ | >-|-[ message ]-|-> +------^------+
- class scapy.scapypipes.TriggeredQueueingValve(start_state: bool = True, name: Any | None = None)[源代码]
基类:
DrainLet messages alternatively pass or queued, changing on trigger
+------^-------+ >>-|-[pass/queue]-|->> | | | >-|-[pass/queue]-|-> +------^-------+
- class scapy.scapypipes.TriggeredSwitch(start_state: bool = True, name: Any | None = None)[源代码]
基类:
DrainLet messages alternatively high or low, changing on trigger
+------^------+ >>-|-\ | /-|->> | [up/down] | >-|-/ | \-|-> +------^------+
- class scapy.scapypipes.TriggeredValve(start_state: bool = True, name: Any | None = None)[源代码]
基类:
DrainLet messages alternatively pass or not, changing on trigger
+------^------+ >>-|-[pass/stop]-|->> | | | >-|-[pass/stop]-|-> +------^------+
- class scapy.scapypipes.UDPClientPipe(addr: str = '', port: int = 0, name: str | None = None)[源代码]
-
UDP send packets to addr:port and use it as source and sink Start trying to receive only once a packet has been send
+-------------+ >>-| |->> | | >-|-[addr:port]-|-> +-------------+
- class scapy.scapypipes.UDPDrain(ip: str = '127.0.0.1', port: int = 1234)[源代码]
基类:
DrainUDP payloads received on high entry are sent over UDP
+-------------+ >>-|--[payload]--|->> | X | >-|----[UDP]----|-> +-------------+
- class scapy.scapypipes.UDPServerPipe(addr: str = '', port: int = 0, name: str | None = None)[源代码]
-
UDP bind to [addr:]port and use as source and sink Use (ip, port) from first received IP packet as destination for all data
+------^------+ >>-| +-[peer]-|->> | / | >-|-[addr:port]-|-> +-------------+
- class scapy.scapypipes.WiresharkSink(name: Any | None = None, linktype: int | None = None, args: List[str] | None = None)[源代码]
基类:
WrpcapSinkStreams
Packetfrom the low entry to Wireshark.Packets are written into a
pcapstream (likeWrpcapSink), and streamed to a new Wireshark process on itsstdin.Wireshark is run with the
-ki -arguments, which cause it to treatstdinas a capture device. Arguments inargswill be appended after this.Extends
WrpcapSink.+----------+ >>-| |->> | | >-|--[pcap] |-> +----------+
- 参数:
linktype (None or int) -- See
WrpcapSink.linktype.args (None or list[str]) -- See
args.
- args
Additional arguments for the Wireshark process.
This must be either
None(the default), or alistofstr.This attribute has no effect after calling
PipeEngine.start().See wireshark(1) for more details.
- class scapy.scapypipes.WrpcapSink(fname: str, name: str | None = None, linktype: int | None = None, **kwargs: Any)[源代码]
基类:
SinkWrites
Packeton the low entry to apcapfile. Ignores all messages on the high entry.备注
Due to limitations of the
pcapformat, all packets must be of the same link type. This class will not mutate packets to conform with the expected link type.+----------+ >>-| |->> | | >-|--[pcap] |-> +----------+
- 参数:
fname (str) -- Filename to write packets to.
linktype (None or int) -- See
linktype.
- linktype
Set an explicit link-type (
DLT_) for packets. This must be anintorNone.This is the same as the
wrpcap()linktypeparameter.If
None(the default), the linktype will be auto-detected on the first packet. This field will not be updated with the result of this auto-detection.This attribute has no effect after calling
PipeEngine.start().