scapy.contrib.socks module

SOCKS4/5 Protocol

You can change the server ports that are used in the SOCKS layer by editing. conf.contribs[‘socks’][‘serverports’]

class scapy.contrib.socks.SOCKS

Bases: scapy.packet.Packet

add_payload(payload)
aliastypes = [<class 'scapy.contrib.socks.SOCKS'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS).vn>]
guess_payload_class(pkt)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.socks.SOCKS4Reply

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.socks.SOCKS4Reply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS4Reply).cd>, <Field (SOCKS4Request,SOCKS4Reply).dstport>, <Field (SOCKS4Request,SOCKS4Reply).dst>]
class scapy.contrib.socks.SOCKS4Request

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.socks.SOCKS4Request'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS4Request).cd>, <Field (SOCKS4Request,SOCKS4Reply).dstport>, <Field (SOCKS4Request,SOCKS4Reply).dst>, <Field (SOCKS4Request).userid>, <Field (SOCKS4Request).null>]
class scapy.contrib.socks.SOCKS5Reply

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.socks.SOCKS5Reply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS5Reply).rep>, <Field (SOCKS5Request,SOCKS5Reply).res>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).atyp>, <scapy.fields.MultipleTypeField object>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).port>]
class scapy.contrib.socks.SOCKS5Request

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.socks.SOCKS5Request'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS5Request).cd>, <Field (SOCKS5Request,SOCKS5Reply).res>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).atyp>, <scapy.fields.MultipleTypeField object>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).port>]
class scapy.contrib.socks.SOCKS5UDP

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.socks.SOCKS5UDP'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SOCKS5UDP).res>, <Field (SOCKS5UDP).frag>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).atyp>, <scapy.fields.MultipleTypeField object>, <Field (SOCKS5Request,SOCKS5Reply,SOCKS5UDP).port>]
guess_payload_class(s)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class