scapy.supersocket

SuperSocket.

class scapy.supersocket.IterSocket(obj: List[Packet] | Packet | SetGen[Packet] | _PacketList[Packet])[源代码]

基类:SuperSocket

close() None[源代码]
desc = 'wrapper around an iterable'
nonblocking_socket: bool = True
recv(*args: Any) Packet | None[源代码]
static select(sockets: List[SuperSocket], remain: Any = None) List[SuperSocket][源代码]
class scapy.supersocket.L2ListenTcpdump(iface: NetworkInterface | str | None = None, promisc: bool | None = None, filter: str | None = None, nofilter: bool = False, prog: str | None = None, *arg: Any, **karg: Any)[源代码]

基类:SuperSocket

close() None[源代码]
desc = 'read packets at layer 2 using tcpdump'
recv(x: int = 65535) Packet | None[源代码]
static select(sockets: List[SuperSocket], remain: float | None = None) List[SuperSocket][源代码]
class scapy.supersocket.L3RawSocket(type: int = 2048, filter: str | None = None, iface: NetworkInterface | str | None = None, promisc: bool | None = None, nofilter: int = 0)[源代码]

基类:SuperSocket

desc = 'Layer 3 using Raw sockets (PF_INET/SOCK_RAW)'
recv(x: int = 65535) Packet | None[源代码]
send(x: Packet) int[源代码]
class scapy.supersocket.SSLStreamSocket(sock: socket, basecls: Type[Packet] | None = None)[源代码]

基类:StreamSocket

desc = 'similar usage than StreamSocket but specialized for handling SSL-wrapped sockets'
recv(x: int = 65535) Packet | None[源代码]
class scapy.supersocket.SimpleSocket(sock: socket)[源代码]

基类:SuperSocket

desc = 'wrapper around a classic socket'
class scapy.supersocket.StreamSocket(sock: socket, basecls: Type[Packet] | None = None)[源代码]

基类:SimpleSocket

desc = 'transforms a stream socket into a layer 2'
nonblocking_socket: bool = True
recv(x: int = 65535) Packet | None[源代码]
class scapy.supersocket.SuperSocket(family: int = AddressFamily.AF_INET, type: int = SocketKind.SOCK_STREAM, proto: int = 0, iface: NetworkInterface | str | None = None, **kwargs: Any)[源代码]

基类:object

am(cls: Type[Any], *args: Any, **kwargs: Any) Any[源代码]

Creates an AnsweringMachine associated with this socket.

参数:

cls -- A subclass of AnsweringMachine to instantiate

auxdata_available: bool = False
close() None[源代码]
closed: bool = False
fileno() int[源代码]
nonblocking_socket: bool = False
recv(x: int = 65535) Packet | None[源代码]
recv_raw(x: int = 65535) Tuple[Type[Packet] | None, bytes | None, float | None][源代码]

Returns a tuple containing (cls, pkt_data, time)

static select(sockets: List[SuperSocket], remain: float | None = 0.05) List[SuperSocket][源代码]

This function is called during sendrecv() routine to select the available sockets.

参数:

sockets -- an array of sockets that need to be selected

返回:

an array of sockets that were selected and the function to be called next to get the packets (i.g. recv)

send(x: Packet) int[源代码]
sniff(*args: Any, **kargs: Any) PacketList[源代码]
sr(*args: Any, **kargs: Any) Tuple[SndRcvList, PacketList][源代码]
sr1(*args: Any, **kargs: Any) Packet | None[源代码]
tshark(*args: Any, **kargs: Any) None[源代码]
class scapy.supersocket.tpacket_auxdata[源代码]

基类:Structure

tp_len

Structure/Union member

tp_mac

Structure/Union member

tp_net

Structure/Union member

tp_snaplen

Structure/Union member

tp_status

Structure/Union member

tp_vlan_tci

Structure/Union member

tp_vlan_tpid

Structure/Union member