scapy.supersocket

SuperSocket.

class scapy.supersocket.IterSocket(obj: Union[List[scapy.packet.Packet], scapy.packet.Packet, scapy.base_classes.SetGen[scapy.packet.Packet], scapy.plist._PacketList[scapy.packet.Packet]])[source]

Bases: scapy.supersocket.SuperSocket

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

Bases: scapy.supersocket.SuperSocket

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

Bases: scapy.supersocket.SuperSocket

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

Bases: scapy.supersocket.StreamSocket

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

Bases: scapy.supersocket.SuperSocket

desc = 'wrapper around a classic socket'
nonblocking_socket: bool = True
class scapy.supersocket.StreamSocket(sock: socket.socket, basecls: Optional[Type[scapy.packet.Packet]] = None)[source]

Bases: scapy.supersocket.SimpleSocket

desc = 'transforms a stream socket into a layer 2'
ins: socket.socket
outs: Optional[socket.socket]
recv(x: int = 65535) Optional[scapy.packet.Packet][source]
class scapy.supersocket.SuperSocket(family: int = AddressFamily.AF_INET, type: int = SocketKind.SOCK_STREAM, proto: int = 0, iface: Optional[Union[scapy.interfaces.NetworkInterface, str]] = None, **kwargs: Any)[source]

Bases: object

am(cls: Type[Any], *args: Any, **kwargs: Any) Any[source]

Creates an AnsweringMachine associated with this socket.

Parameters

cls – A subclass of AnsweringMachine to instantiate

auxdata_available: bool = False
close() None[source]
closed: int = 0
fileno() int[source]
nonblocking_socket: bool = False
recv(x: int = 65535) Optional[scapy.packet.Packet][source]
recv_raw(x: int = 65535) Tuple[Optional[Type[scapy.packet.Packet]], Optional[bytes], Optional[float]][source]

Returns a tuple containing (cls, pkt_data, time)

static select(sockets: List[scapy.supersocket.SuperSocket], remain: Optional[float] = 0.05) List[scapy.supersocket.SuperSocket][source]

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

Parameters

sockets – an array of sockets that need to be selected

Returns

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

send(x: scapy.packet.Packet) int[source]
sniff(*args: Any, **kargs: Any) scapy.plist.PacketList[source]
sr(*args: Any, **kargs: Any) Tuple[scapy.plist.SndRcvList, scapy.plist.PacketList][source]
sr1(*args: Any, **kargs: Any) Optional[scapy.packet.Packet][source]
tshark(*args: Any, **kargs: Any) None[source]
class scapy.supersocket.tpacket_auxdata[source]

Bases: _ctypes.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