scapy.supersocket
SuperSocket.
- class scapy.supersocket.IterSocket(obj: List[Packet] | Packet | SetGen[Packet] | _PacketList[Packet])[source]
Bases:
SuperSocket
- desc = 'wrapper around an iterable'
- nonblocking_socket: bool = True
- static select(sockets: List[SuperSocket], remain: Any | None = None) List[SuperSocket] [source]
- 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)[source]
Bases:
SuperSocket
- desc = 'read packets at layer 2 using tcpdump'
- static select(sockets: List[SuperSocket], remain: float | None = None) List[SuperSocket] [source]
- class scapy.supersocket.L3RawSocket(type: int = 2048, filter: str | None = None, iface: NetworkInterface | str | None = None, promisc: bool | None = None, nofilter: int = 0)[source]
Bases:
SuperSocket
- desc = 'Layer 3 using Raw sockets (PF_INET/SOCK_RAW)'
- class scapy.supersocket.L3RawSocket6(type: int = 34525, filter: str | None = None, iface: NetworkInterface | str | None = None, promisc: bool | None = None, nofilter: bool = False)[source]
Bases:
L3RawSocket
- ins: socket
- outs: socket | None
- class scapy.supersocket.SSLStreamSocket(sock: socket, basecls: Type[Packet] | None = None)[source]
Bases:
StreamSocket
- desc = 'similar usage than StreamSocket but specialized for handling SSL-wrapped sockets'
- class scapy.supersocket.SimpleSocket(sock: socket)[source]
Bases:
SuperSocket
- desc = 'wrapper around a classic socket'
- class scapy.supersocket.StreamSocket(sock: socket, basecls: Type[Packet] | None = None)[source]
Bases:
SimpleSocket
- desc = 'transforms a stream socket into a layer 2'
- ins: socket
- nonblocking_socket: bool = True
- outs: socket | 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)[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
- closed: bool = False
- nonblocking_socket: bool = False
- recv_raw(x: int = 65535) Tuple[Type[Packet] | None, bytes | None, float | None] [source]
Returns a tuple containing (cls, pkt_data, time)
- static select(sockets: List[SuperSocket], remain: float | None = 0.05) List[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)
- sniff(*args: Any, **kargs: Any) PacketList [source]
- sr(*args: Any, **kargs: Any) Tuple[SndRcvList, PacketList] [source]
- class scapy.supersocket.tpacket_auxdata[source]
Bases:
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