scapy.layers.tls.extensions

TLS握手扩展.

class scapy.layers.tls.extensions.OCSPStatusRequest

Bases: scapy.packet.Packet

这是RFC 6066中定义的结构,而不是RFC 6960中定义的结构!

aliastypes
fields_desc
OCSPStatusRequest字段

respidlen

FieldLenField

None

respid

PacketListField

[]

reqextlen

FieldLenField

None

reqext

PacketField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ProtocolListField(name, default, cls=None, count_from=None, length_from=None, next_cls_cb=None)

Bases: scapy.fields.PacketListField

i2repr(pkt, x)
class scapy.layers.tls.extensions.ProtocolName

Bases: scapy.packet.Packet

aliastypes
fields_desc
ProtocolName字段

len

FieldLenField

None

protocol

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ResponderID

Bases: scapy.packet.Packet

aliastypes
fields_desc
ResponderID字段

respidlen

FieldLenField

None

respid

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.ServerLenField(name, default, length_of=None, fmt='H', count_of=None, adjust=<function FieldLenField.<lambda>>, fld=None)

Bases: scapy.fields.FieldLenField

没有服务器名时(例如,在ServerHello中)没有长度.

addfield(pkt, s, val)
class scapy.layers.tls.extensions.ServerListField(name, default, cls=None, count_from=None, length_from=None, next_cls_cb=None)

Bases: scapy.fields.PacketListField

i2repr(pkt, x)
class scapy.layers.tls.extensions.ServerName

Bases: scapy.packet.Packet

aliastypes
fields_desc
ServerName字段

nametype

ByteEnumField

0

namelen

FieldLenField

None

servername

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.TACertSHA1Hash

Bases: scapy.packet.Packet

aliastypes
fields_desc
TACertSHA1哈希字段

idtype

ByteEnumField

3

id

StrFixedLenField

None

guess_payload_class(p)
class scapy.layers.tls.extensions.TAKeySHA1Hash

Bases: scapy.packet.Packet

aliastypes
fields_desc
TAKeySHA1哈希字段

idtype

ByteEnumField

1

id

StrFixedLenField

None

guess_payload_class(p)
class scapy.layers.tls.extensions.TAPreAgreed

Bases: scapy.packet.Packet

aliastypes
fields_desc
TAPre同意的字段

idtype

ByteEnumField

0

guess_payload_class(p)
class scapy.layers.tls.extensions.TAX509Name

Bases: scapy.packet.Packet

RFC 4366的XXX第3.4节.实现一个更具体的DNField而不是当前的StrLenField.

aliastypes
fields_desc
TAX509名称字段

idtype

ByteEnumField

2

dnlen

FieldLenField

None

dn

StrLenField

b''

guess_payload_class(p)
class scapy.layers.tls.extensions.TLS_Ext_ALPN(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

aliastypes
fields_desc
TLS_Ext_ALPN字段

type

ShortEnumField

16

len

ShortField

None

protocolslen

FieldLenField

None

protocols

ProtocolListField

[]

class scapy.layers.tls.extensions.TLS_Ext_CSR(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_CSR字段

type

ShortEnumField

5

len

ShortField

None

stype

ByteEnumField

None

req

_StatusReqField

[]

class scapy.layers.tls.extensions.TLS_Ext_ClientAuthz(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

XXX不受支持

aliastypes
fields_desc
TLS_Ext_ClientAuthz字段

type

ShortEnumField

7

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_ClientCertType(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ClientCertType字段

type

ShortEnumField

9

len

ShortField

None

ctypeslen

FieldLenField

None

ctypes

FieldListField

[0, 1]

class scapy.layers.tls.extensions.TLS_Ext_ClientCertURL(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ClientCertURL字段

type

ShortEnumField

2

len

ShortField

None

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
build()
fields_desc
TLS_Ext_Cookie字段

type

ShortEnumField

44

len

ShortField

None

cookielen

FieldLenField

None

cookie

XStrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_EarlyDataIndication(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EarlyDataIndication字段

type

ShortEnumField

42

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_EarlyDataIndicationTicket(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EarlyDataIndicationTicket字段

type

ShortEnumField

42

len

ShortField

None

max_early_data_size

IntField

0

class scapy.layers.tls.extensions.TLS_Ext_EncryptThenMAC(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_EncryptThenMAC字段

type

ShortEnumField

22

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_EncryptedServerName(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

aliastypes
fields_desc
TLS_Ext_EncryptedServerName字段

type

ShortEnumField

65486

len

ShortField

None

cipher

EnumField

None

key_exchange_group

ShortEnumField

None

key_exchange_len

FieldLenField

None

key_exchange

XStrLenField

b''

record_digest_len

FieldLenField

None

record_digest

XStrLenField

b''

encrypted_sni_len

FieldLenField

None

encrypted_sni

XStrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_ExtendedMasterSecret(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ExtendedMasterSecret字段

type

ShortEnumField

23

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_Heartbeat(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_Heartbeat字段

type

ShortEnumField

15

len

ShortField

None

heartbeat_mode

ByteEnumField

2

class scapy.layers.tls.extensions.TLS_Ext_KeyShare(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_KeyShare字段

type

ShortEnumField

51

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_MaxFragLen(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_MaxFragLen字段

type

ShortEnumField

1

len

ShortField

None

maxfraglen

ByteEnumField

4

class scapy.layers.tls.extensions.TLS_Ext_NPN(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

在RFC-draft-agl-tls-nextprotoneg-03中定义. 不赞成使用ALPN.

aliastypes
fields_desc
TLS_Ext_NPN字段

type

ShortEnumField

13172

len

FieldLenField

None

protocols

ProtocolListField

[]

class scapy.layers.tls.extensions.TLS_Ext_PSKKeyExchangeModes(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PSKKeyExchangeModes字段

type

ShortEnumField

45

len

ShortField

None

kxmodeslen

FieldLenField

None

kxmodes

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_Padding(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_Padding字段

type

ShortEnumField

21

len

FieldLenField

None

padding

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_PostHandshakeAuth(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PostHandshakeAuth字段

type

ShortEnumField

49

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_PreSharedKey(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_PreSharedKey字段

type

ShortEnumField

41

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

用于server_name / ALPN / NPN的虚拟扩展名,表示形式更简洁:最终字段显示为1行列表,而不是大量数据包. XXX为Packet._show_or_dump中的数据包列表定义新条件?

aliastypes
fields_desc
TLS_Ext_PrettyPacketList字段

type

ShortEnumField

None

len

FieldLenField

None

val

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_RecordSizeLimit(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_RecordSizeLimit字段

type

ShortEnumField

28

len

ShortField

None

record_size_limit

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_RenegotiationInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_RenegotiationInfo字段

type

ShortEnumField

65281

len

ShortField

None

reneg_conn_len

FieldLenField

None

renegotiated_connection

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_ServerAuthz(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

XXX不受支持

aliastypes
fields_desc
TLS_Ext_ServerAuthz字段

type

ShortEnumField

8

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_ServerCertType(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_ServerCertType字段

type

ShortEnumField

9

len

ShortField

None

ctype

ByteEnumField

None

class scapy.layers.tls.extensions.TLS_Ext_ServerName(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_PrettyPacketList

aliastypes
fields_desc
TLS_Ext_ServerName字段

type

ShortEnumField

0

len

FieldLenField

None

servernameslen

ServerLenField

None

servernames

ServerListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SessionTicket(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

RFC 5077根据大多数实现更新了RFC 4507,该实现在全局" len"字段之后不使用另一个(无用的)" ticketlen"字段.

aliastypes
fields_desc
TLS_Ext_SessionTicket字段

type

ShortEnumField

35

len

FieldLenField

None

ticket

StrLenField

b''

class scapy.layers.tls.extensions.TLS_Ext_SignatureAlgorithms(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SignatureAlgorithms字段

type

ShortEnumField

13

len

ShortField

None

sig_algs_len

SigAndHashAlgsLenField

None

sig_algs

SigAndHashAlgsField

[]

class scapy.layers.tls.extensions.TLS_Ext_SignatureAlgorithmsCert(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SignatureAlgorithmsCert字段

type

ShortEnumField

49

len

ShortField

None

sig_algs_len

SigAndHashAlgsLenField

None

sig_algs

SigAndHashAlgsField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedEllipticCurves(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_SupportedGroups

aliastypes
fields_desc
TLS_Ext_SupportedEllipticCurves字段

type

ShortEnumField

10

len

ShortField

None

groupslen

FieldLenField

None

groups

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedGroups(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

在TLS 1.3合并ECDH和FFDH的两个组选择机制之前,此扩展被称为"支持的椭圆曲线".

aliastypes
fields_desc
TLS_Ext_SupportedGroups字段

type

ShortEnumField

10

len

ShortField

None

groupslen

FieldLenField

None

groups

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedPointFormat(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedPointFormat字段

type

ShortEnumField

11

len

ShortField

None

ecpllen

FieldLenField

None

ecpl

FieldListField

[0]

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersion_CH(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersion_CH字段

type

ShortEnumField

43

len

ShortField

None

versionslen

FieldLenField

None

versions

FieldListField

[]

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersion_SH(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersion_SH字段

type

ShortEnumField

43

len

ShortField

None

version

ShortEnumField

None

class scapy.layers.tls.extensions.TLS_Ext_SupportedVersions(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_SupportedVersions字段

type

ShortEnumField

43

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_TicketEarlyDataInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TicketEarlyDataInfo字段

type

ShortEnumField

46

len

ShortField

None

max_early_data_size

IntField

0

class scapy.layers.tls.extensions.TLS_Ext_TruncatedHMAC(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TruncatedHMAC字段

type

ShortEnumField

4

len

ShortField

None

class scapy.layers.tls.extensions.TLS_Ext_TrustedCAInd(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_TrustedCAInd字段

type

ShortEnumField

3

len

ShortField

None

talen

FieldLenField

None

ta

_TAListField

[]

class scapy.layers.tls.extensions.TLS_Ext_Unknown(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.session._GenericTLSSessionInheritance

为了避免循环导入,我们将其放在此处而不是extensions.py中.

aliastypes
fields_desc
TLS_Ext_Unknown字段

type

ShortEnumField

None

len

FieldLenField

None

val

StrLenField

b''

post_build(p, pay)
class scapy.layers.tls.extensions.TLS_Ext_UserMapping(_pkt='', post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields)

Bases: scapy.layers.tls.extensions.TLS_Ext_Unknown

aliastypes
fields_desc
TLS_Ext_UserMapping字段

type

ShortEnumField

6

len

ShortField

None

umlen

FieldLenField

None

um

FieldListField

[]