scapy.supersocket

SuperSocket.

class scapy.supersocket.L2ListenTcpdump(iface=None, promisc=None, filter=None, nofilter=False, prog=None, *arg, **karg)[source]

Bases: scapy.supersocket.SuperSocket

close()[source]
desc = 'read packets at layer 2 using tcpdump'
recv(x=65535)[source]
static select(sockets, remain=None)[source]
class scapy.supersocket.L3RawSocket(type=2048, filter=None, iface=None, promisc=None, nofilter=0)[source]

Bases: scapy.supersocket.SuperSocket

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

Bases: scapy.supersocket.StreamSocket

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

Bases: scapy.supersocket.SuperSocket

desc = 'wrapper around a classic socket'
class scapy.supersocket.StreamSocket(sock, basecls=None)[source]

Bases: scapy.supersocket.SimpleSocket

desc = 'transforms a stream socket into a layer 2'
nonblocking_socket = True
recv(x=65535)[source]
class scapy.supersocket.SuperSocket(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=0)[source]

Bases: object

am(cls, *args, **kwargs)[source]

Creates an AnsweringMachine associated with this socket.

Parameters

cls – A subclass of AnsweringMachine to instantiate

auxdata_available = False
close()[source]
closed = 0
desc = None
fileno()[source]
nonblocking_socket = False
recv(x=65535)[source]
recv_raw(x=65535)[source]

Returns a tuple containing (cls, pkt_data, time)

static select(sockets, remain=0.05)[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)[source]
sniff(*args, **kargs)[source]
sr(*args, **kargs)[source]
sr1(*args, **kargs)[source]
tshark(*args, **kargs)[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_padding

Structure/Union member

tp_snaplen

Structure/Union member

tp_status

Structure/Union member

tp_vlan_tci

Structure/Union member