scapy.layers.eap

Extensible Authentication Protocol (EAP)

class scapy.layers.eap.EAP(_pkt, /, *, code=4, id=0, len=None, type=0, desired_auth_types=[], identity=b'', message=b'')[source]

Bases: Packet

RFC 3748 - Extensible Authentication Protocol (EAP)

FAILURE = 4
FINISH = 6
INITIATE = 5
REQUEST = 1
RESPONSE = 2
SUCCESS = 3
aliastypes
answers(other)[source]
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |       DESIRED AUTH TYPES      |    IDENTITY   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |            MESSAGE            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                             Fig. EAP                             
EAP fields

code

ByteEnumField

4

id

ByteField

0

len

ShortField

None

type

ByteEnumField (Cond)

0

desired_auth_types

FieldListField (Cond)

[]

identity

StrLenField (Cond)

b''

message

StrLenField (Cond)

b''

guess_payload_class(_)[source]
mysummary()[source]
post_build(p, pay)[source]
classmethod register_variant()[source]
registered_methods = {0: <class 'scapy.layers.eap.EAP'>, 4: <class 'scapy.layers.eap.EAP_MD5'>, 13: <class 'scapy.layers.eap.EAP_TLS'>, 17: <class 'scapy.layers.eap.LEAP'>, 21: <class 'scapy.layers.eap.EAP_TTLS'>, 25: <class 'scapy.layers.eap.EAP_PEAP'>, 43: <class 'scapy.layers.eap.EAP_FAST'>}
class scapy.layers.eap.EAPOL(_pkt, /, *, version=1, type=0, len=None)[source]

Bases: Packet

EAPOL - IEEE Std 802.1X-2010

ASF = 4
EAP_PACKET = 0
KEY = 3
LOGOFF = 2
START = 1
aliastypes
answers(other)[source]
extract_padding(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    VERSION    |      TYPE     |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. EAPOL                            
EAPOL fields

version

ByteEnumField

1

type

ByteEnumField

0

len

LenField

None

hashret()[source]
mysummary()[source]
payload_guess

Possible sublayers: EAPOL_KEY, EAP, MKAPDU

class scapy.layers.eap.EAPOL_KEY(_pkt, /, *, key_descriptor_type=1, res2=0, smk_message=0, encrypted_key_data=0, request=0, error=0, secure=0, has_key_mic=1, key_ack=0, install=0, res=0, key_type=0, key_descriptor_type_version=0, key_length=None, key_replay_counter=0, key_nonce=b'', key_iv=b'', key_rsc=b'', key_id=b'', key_mic=b'', key_data_length=None, key_data=b'')[source]

Bases: Packet

aliastypes
answers(other)[source]
deprecated_fields: Dict[str, Tuple[str, str]] = {'key': ('key_data', '2.6.0'), 'len': ('key_length', '2.6.0')}
extract_padding(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|KEY DESCRIPTOR |RES|S|E|R|E|S|H|K|I|RES|K|KEY D|   KEY LENGTH  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |               KEY REPLAY COUNTER              |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                   KEY NONCE                   |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                     KEY IV                    |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                    KEY RSC                    |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                     KEY ID                    |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                    KEY MIC                    |
+-+-+-+-+-+-+-+-+                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |        KEY DATA LENGTH        |    KEY DATA   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                          Fig. EAPOL_KEY                          
EAPOL_KEY fields

key_descriptor_type

ByteEnumField

1

res2

BitField (2 bits)

0

smk_message

BitField (1 bit)

0

encrypted_key_data

BitField (1 bit)

0

request

BitField (1 bit)

0

error

BitField (1 bit)

0

secure

BitField (1 bit)

0

has_key_mic

BitField (1 bit)

1

key_ack

BitField (1 bit)

0

install

BitField (1 bit)

0

res

BitField (2 bits)

0

key_type

BitEnumField

0

key_descriptor_type_version

BitEnumField

0

key_length

LenField

None

key_replay_counter

LongField

0

key_nonce

XStrFixedLenField

b''

key_iv

XStrFixedLenField

b''

key_rsc

XStrFixedLenField

b''

key_id

XStrFixedLenField

b''

key_mic

XStrFixedLenField

b''

key_data_length

FieldLenField

None

key_data

XStrLenField

b''

guess_key_number()[source]

Determines 4-way handshake key number

Returns:

key number (1-4), or 0 if it cannot be determined

hashret()[source]
class scapy.layers.eap.EAP_FAST(_pkt, /, *, code=1, id=0, len=None, type=43, L=0, M=0, S=0, reserved=0, version=0, message_len=0, data=b'')[source]

Bases: EAP

RFC 4851 - “The Flexible Authentication via Secure Tunneling Extensible Authentication Protocol Method (EAP-FAST)”

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |L|M|S|RES|VERSI|          MESSAGE LEN          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |              DATA             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. EAP_FAST                           
EAP_FAST fields

code

ByteEnumField

1

id

ByteField

0

len

FieldLenField

None

type

ByteEnumField

43

L

BitField (1 bit)

0

M

BitField (1 bit)

0

S

BitField (1 bit)

0

reserved

BitField (2 bits)

0

version

BitField (3 bits)

0

message_len

IntField (Cond)

0

data

XStrLenField

b''

match_subclass = True
class scapy.layers.eap.EAP_MD5(_pkt, /, *, code=1, id=0, len=None, type=4, value_size=None, value=b'', optional_name=b'')[source]

Bases: EAP

RFC 3748 - “Extensible Authentication Protocol (EAP)”

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |   VALUE SIZE  |             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         OPTIONAL NAME         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. EAP_MD5                           
EAP_MD5 fields

code

ByteEnumField

1

id

ByteField

0

len

FieldLenField

None

type

ByteEnumField

4

value_size

FieldLenField

None

value

XStrLenField

b''

optional_name

XStrLenField

b''

match_subclass = True
class scapy.layers.eap.EAP_PEAP(_pkt, /, *, code=1, id=0, len=None, type=25, L=0, M=0, S=0, reserved=0, version=1, tls_message_len=0, tls_data=b'')[source]

Bases: EAP

draft-josefsson-pppext-eap-tls-eap-05.txt - “Protected EAP Protocol (PEAP)”

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |L|M|S|RESER|VER|        TLS MESSAGE LEN        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |            TLS DATA           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. EAP_PEAP                           
EAP_PEAP fields

code

ByteEnumField

1

id

ByteField

0

len

FieldLenField

None

type

ByteEnumField

25

L

BitField (1 bit)

0

M

BitField (1 bit)

0

S

BitField (1 bit)

0

reserved

BitField (3 bits)

0

version

BitField (2 bits)

1

tls_message_len

IntField (Cond)

0

tls_data

XStrLenField

b''

match_subclass = True
class scapy.layers.eap.EAP_TLS(_pkt, /, *, code=1, id=0, len=None, type=13, L=0, M=0, S=0, reserved=0, tls_message_len=0, tls_data=b'')[source]

Bases: EAP

RFC 5216 - “The EAP-TLS Authentication Protocol”

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |L|M|S| RESERVED|        TLS MESSAGE LEN        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |            TLS DATA           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. EAP_TLS                           
EAP_TLS fields

code

ByteEnumField

1

id

ByteField

0

len

FieldLenField

None

type

ByteEnumField

13

L

BitField (1 bit)

0

M

BitField (1 bit)

0

S

BitField (1 bit)

0

reserved

BitField (5 bits)

0

tls_message_len

IntField (Cond)

0

tls_data

XStrLenField

b''

match_subclass = True
class scapy.layers.eap.EAP_TTLS(_pkt, /, *, code=1, id=0, len=None, type=21, L=0, M=0, S=0, reserved=0, version=0, message_len=0, data=b'')[source]

Bases: EAP

RFC 5281 - “Extensible Authentication Protocol Tunneled Transport Layer Security Authenticated Protocol Version 0 (EAP-TTLSv0)”

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |L|M|S|RES|VERSI|          MESSAGE LEN          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |              DATA             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. EAP_TTLS                           
EAP_TTLS fields

code

ByteEnumField

1

id

ByteField

0

len

FieldLenField

None

type

ByteEnumField

21

L

BitField (1 bit)

0

M

BitField (1 bit)

0

S

BitField (1 bit)

0

reserved

BitField (2 bits)

0

version

BitField (3 bits)

0

message_len

IntField (Cond)

0

data

XStrLenField

b''

match_subclass = True
class scapy.layers.eap.LEAP(_pkt, /, *, code=1, id=0, len=None, type=17, version=1, unused=0, count=None, challenge_response=b'', username=b'')[source]

Bases: EAP

Cisco LEAP (Lightweight EAP) https://freeradius.org/rfc/leap.txt

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      CODE     |       ID      |              LEN              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |    VERSION    |     UNUSED    |     COUNT     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       CHALLENGE RESPONSE      |            USERNAME           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. LEAP                             
LEAP fields

code

ByteEnumField

1

id

ByteField

0

len

ShortField

None

type

ByteEnumField

17

version

ByteField

1

unused

XByteField

0

count

FieldLenField

None

challenge_response

XStrLenField

b''

username

StrLenField

b''

match_subclass = True
class scapy.layers.eap.MACsecSCI(_pkt, /, *, system_identifier=None, port_identifier=0)[source]

Bases: Packet

Secure Channel Identifier.

aliastypes
extract_padding(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       SYSTEM IDENTIFIER                       |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |        PORT IDENTIFIER        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. MACsecSCI                          
MACsecSCI fields

system_identifier

SourceMACField

None

port_identifier

ShortField

0

class scapy.layers.eap.MKABasicParamSet(_pkt, /, *, mka_version_id=0, key_server_priority=0, key_server=0, macsec_desired=0, macsec_capability=0, param_set_body_len=0, SCI=<MACsecSCI  |>, actor_member_id=b'', actor_message_number=0, algorithm_agility=0, cak_name=b'')[source]

Bases: Packet

Basic Parameter Set (802.1X-2010, section 11.11).

aliastypes
extract_padding(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MKA VERSION ID|KEY SERVER PRIO|K|M|MAC|   PARAM SET BODY LEN  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              SCI              |        ACTOR MEMBER ID        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                                                               +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |      ACTOR MESSAGE NUMBER     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |       ALGORITHM AGILITY       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |            CAK NAME           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. MKABasicParamSet                       
MKABasicParamSet fields

mka_version_id

ByteField

0

key_server_priority

ByteField

0

key_server

BitField (1 bit)

0

macsec_desired

BitField (1 bit)

0

macsec_capability

BitField (2 bits)

0

param_set_body_len

BitField (12 bits)

0

SCI

PacketField

<MACsecSCI  |>

actor_member_id

XStrFixedLenField

b''

actor_message_number

XIntField

0

algorithm_agility

XIntField

0

cak_name

PadField

b''

class scapy.layers.eap.MKADistributedCAKParamSet(_pkt, /, *, param_set_type=5, param_set_body_len=0, cak_aes_key_wrap=b'', cak_key_name=b'')[source]

Bases: MKAParamSet

Distributed CAK Parameter Set (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|       PARAM SET BODY LEN      |CAK AES KEY WRA|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                               +-+-+-+-+-+-+-+-+
|                                               |  CAK KEY NAME |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                  Fig. MKADistributedCAKParamSet                  
MKADistributedCAKParamSet fields

param_set_type

PadField

5

param_set_body_len

ShortField

0

cak_aes_key_wrap

XStrFixedLenField

b''

cak_key_name

XStrField

b''

class scapy.layers.eap.MKADistributedSAKParamSet(_pkt, /, *, param_set_type=4, distributed_an=0, confidentiality_offset=0, unused=0, param_set_body_len=0, key_number=b'', macsec_cipher_suite=b'', sak_aes_key_wrap=b'')[source]

Bases: MKAParamSet

Distributed SAK parameter set (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|DIS|CON| UNUSED|       PARAM SET BODY LEN      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           KEY NUMBER                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      MACSEC CIPHER SUITE                      |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        SAK AES KEY WRAP                       |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. MKADistributedSAKParamSet                  
MKADistributedSAKParamSet fields

param_set_type

ByteEnumField

4

distributed_an

BitField (2 bits)

0

confidentiality_offset

BitField (2 bits)

0

unused

BitField (4 bits)

0

param_set_body_len

ShortField

0

key_number

XStrFixedLenField

b''

macsec_cipher_suite

XStrFixedLenField (Cond)

b''

sak_aes_key_wrap

XStrFixedLenField

b''

class scapy.layers.eap.MKAICVSet(_pkt, /, *, param_set_type=255, param_set_body_len=0, icv=b'')[source]

Bases: MKAParamSet

ICV (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|       PARAM SET BODY LEN      |      ICV      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                               +-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. MKAICVSet                          
MKAICVSet fields

param_set_type

PadField

255

param_set_body_len

ShortField

0

icv

XStrFixedLenField

b''

class scapy.layers.eap.MKALivePeerListParamSet(_pkt, /, *, param_set_type=1, param_set_body_len=0, member_id_message_num=[])[source]

Bases: MKAParamSet

Live Peer List parameter sets (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|       PARAM SET BODY LEN      |MEMBER ID MESSA|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                   Fig. MKALivePeerListParamSet                   
MKALivePeerListParamSet fields

param_set_type

PadField

1

param_set_body_len

ShortField

0

member_id_message_num

PacketListField

[]

class scapy.layers.eap.MKAPDU(_pkt, /, *, basic_param_set=b'', parameter_sets=[])[source]

Bases: Packet

MACsec Key Agreement Protocol Data Unit.

aliastypes
extract_padding(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        BASIC PARAM SET        |         PARAMETER SETS        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. MKAPDU                            
MKAPDU fields

basic_param_set

PacketField

b''

parameter_sets

MKAParamSetPacketListField

[]

class scapy.layers.eap.MKAParamSet(_pkt, /)[source]

Bases: Packet

Class from which every parameter set class inherits (except MKABasicParamSet, which has no “Parameter set type” field, and must come first in the list of parameter sets).

EAPOL_MKA_DEFAULT_KEY_WRAP_LEN = 24
MACSEC_DEFAULT_ICV_LEN = 16
aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]

Returns the right parameter set class.

class scapy.layers.eap.MKAParamSetPacketListField(name: str, default: Optional[List[BasePacket]], pkt_cls: Optional[Union[Callable[[bytes], Packet], Type[Packet]]]  # noqa: E501 = None, count_from: Optional[Callable[[Packet], int]] = None, length_from: Optional[Callable[[Packet], int]] = None, next_cls_cb: Optional[Callable[[Packet, List[BasePacket], Optional[Packet], bytes], Type[Packet]]]  # noqa: E501 = None, max_count: Optional[int] = None)[source]

Bases: PacketListField

PacketListField that handles the parameter sets.

PARAM_SET_LEN_MASK = 4095
getfield(pkt, s)[source]
m2i(pkt, m)[source]
class scapy.layers.eap.MKAPeerListTuple(_pkt, /, *, member_id=b'', message_number=b'')[source]

Bases: Packet

Live / Potential Peer List parameter sets tuples (802.1X-2010, section 11.11). # noqa: E501

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           MEMBER ID                           |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         MESSAGE NUMBER                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. MKAPeerListTuple                       
MKAPeerListTuple fields

member_id

XStrFixedLenField

b''

message_number

XStrFixedLenField

b''

class scapy.layers.eap.MKAPotentialPeerListParamSet(_pkt, /, *, param_set_type=2, param_set_body_len=0, member_id_message_num=[])[source]

Bases: MKAParamSet

Potential Peer List parameter sets (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|       PARAM SET BODY LEN      |MEMBER ID MESSA|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                Fig. MKAPotentialPeerListParamSet                 
MKAPotentialPeerListParamSet fields

param_set_type

PadField

2

param_set_body_len

ShortField

0

member_id_message_num

PacketListField

[]

class scapy.layers.eap.MKASAKUseParamSet(_pkt, /, *, param_set_type=3, latest_key_an=0, latest_key_tx=0, latest_key_rx=0, old_key_an=0, old_key_tx=0, old_key_rx=0, plain_tx=0, plain_rx=0, X=0, delay_protect=0, param_set_body_len=0, latest_key_key_server_member_id=b'', latest_key_key_number=b'', latest_key_lowest_acceptable_pn=b'', old_key_key_server_member_id=b'', old_key_key_number=b'', old_key_lowest_acceptable_pn=b'')[source]

Bases: MKAParamSet

SAK Use Parameter Set (802.1X-2010, section 11.11).

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PARAM SET TYPE|LAT|L|L|OLD|O|O|P|P|X|D|   PARAM SET BODY LEN  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                LATEST KEY KEY SERVER MEMBER ID                |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     LATEST KEY KEY NUMBER                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                LATEST KEY LOWEST ACCEPTABLE PN                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  OLD KEY KEY SERVER MEMBER ID                 |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       OLD KEY KEY NUMBER                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  OLD KEY LOWEST ACCEPTABLE PN                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. MKASAKUseParamSet                      
MKASAKUseParamSet fields

param_set_type

ByteEnumField

3

latest_key_an

BitField (2 bits)

0

latest_key_tx

BitField (1 bit)

0

latest_key_rx

BitField (1 bit)

0

old_key_an

BitField (2 bits)

0

old_key_tx

BitField (1 bit)

0

old_key_rx

BitField (1 bit)

0

plain_tx

BitField (1 bit)

0

plain_rx

BitField (1 bit)

0

X

BitField (1 bit)

0

delay_protect

BitField (1 bit)

0

param_set_body_len

BitField (12 bits)

0

latest_key_key_server_member_id

XStrFixedLenField

b''

latest_key_key_number

XStrFixedLenField

b''

latest_key_lowest_acceptable_pn

XStrFixedLenField

b''

old_key_key_server_member_id

XStrFixedLenField

b''

old_key_key_number

XStrFixedLenField

b''

old_key_lowest_acceptable_pn

XStrFixedLenField

b''