scapy.contrib.ikev2

Internet Key Exchange Protocol Version 2 (IKEv2), RFC 7296

class scapy.contrib.ikev2.ConfigurationAttribute(_pkt, /, *, type=1, length=None, value=None)[source]

Bases: Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. ConfigurationAttribute                    
ConfigurationAttribute fields

type

ShortEnumField

1

length

FieldLenField

None

value

MultipleTypeField (IPField, IP6Field, StrLenField)

b''

class scapy.contrib.ikev2.EncryptedTrafficSelector(_pkt, /, *, TS_type=9, IP_protocol_ID=None, length=16, res=0, starting_address_FC=0, res2=0, ending_address_FC=0, starting_R_CTL=0, ending_R_CTL=0, starting_type=0, ending_type=0)[source]

Bases: TrafficSelector

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TS TYPE    | IP PROTOCOL ID|             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      RES      |              STARTING ADDRESS FC              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |      RES2     |       ENDING ADDRESS FC       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               | STARTING R CTL|  ENDING R CTL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| STARTING TYPE |  ENDING TYPE  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. EncryptedTrafficSelector                   
EncryptedTrafficSelector fields

TS_type

ByteEnumField

9

IP_protocol_ID

ByteEnumField

None

length

ShortField

16

res

ByteField

0

starting_address_FC

X3BytesField

0

res2

ByteField

0

ending_address_FC

X3BytesField

0

starting_R_CTL

ByteField

0

ending_R_CTL

ByteField

0

starting_type

ByteField

0

ending_type

ByteField

0

class scapy.contrib.ikev2.IKEv2(_pkt, /, *, init_SPI=b'', resp_SPI=b'', next_payload=0, version=32, exch_type=0, flags=<Flag 0 ()>, id=0, length=None)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            INIT SPI                           |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            RESP SPI                           |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |    VERSION    |   EXCH TYPE   |     FLAGS     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               ID                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             LENGTH                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. IKEv2                            
IKEv2 fields

init_SPI

StrFixedLenField

b''

resp_SPI

StrFixedLenField

b''

next_payload

ByteEnumField

0

version

XByteField

32

exch_type

ByteEnumField

0

flags

FlagsField

<Flag 0 ()>

id

IntField

0

length

IntField

None

guess_payload_class(payload)[source]
post_build(p, pay)[source]
class scapy.contrib.ikev2.IKEv2_Key_Length_Attribute(name)[source]

Bases: IntField

h2i(pkt, x)[source]
i2h(pkt, x)[source]
class scapy.contrib.ikev2.IKEv2_class(_pkt, /)[source]

Bases: Packet

aliastypes
guess_payload_class(payload)[source]
class scapy.contrib.ikev2.IKEv2_payload(_pkt, /, *, next_payload=None, flags=<Flag 0 ()>, length=None, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |     FLAGS     |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                        Fig. IKEv2_payload                        
IKEv2_payload fields

next_payload

ByteEnumField

None

flags

FlagsField

<Flag 0 ()>

length

FieldLenField

None

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_AUTH(_pkt, /, *, next_payload=None, res=0, length=None, auth_type=None, res2=0, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   AUTH TYPE   |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. IKEv2_payload_AUTH                      
IKEv2_payload_AUTH fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

auth_type

ByteEnumField

None

res2

X3BytesField

0

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_CERT(_pkt, /)[source]

Bases: IKEv2_class

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
class scapy.contrib.ikev2.IKEv2_payload_CERTREQ(_pkt, /, *, next_payload=None, res=0, length=None, cert_type=0, cert_data=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   CERT TYPE   |           CERT DATA           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. IKEv2_payload_CERTREQ                    
IKEv2_payload_CERTREQ fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

cert_type

ByteEnumField

0

cert_data

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_CERT_CRL(_pkt, /, *, next_payload=None, res=0, length=None, cert_type=7, x509CRL=<X509_CRL  tbsCertList=<X509_TBSCertList  signature=<X509_AlgorithmIdentifier  |> issuer=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] |> signatureAlgorithm=<X509_AlgorithmIdentifier  |> |>)[source]

Bases: IKEv2_payload_CERT

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   CERT TYPE   |            X509CRL            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_CERT_CRL                    
IKEv2_payload_CERT_CRL fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

cert_type

ByteEnumField

7

x509CRL

PacketLenField

<X509_CRL  tbsCertList=<X509_TBSCertList  signature=<X509_AlgorithmIdentifier  |> issuer=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] |> signatureAlgorithm=<X509_AlgorithmIdentifier  |> |>

class scapy.contrib.ikev2.IKEv2_payload_CERT_CRT(_pkt, /, *, next_payload=None, res=0, length=None, cert_type=4, x509Cert=<X509_Cert  tbsCertificate=<X509_TBSCertificate  signature=<X509_AlgorithmIdentifier  |> issuer=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] validity=<X509_Validity  |> subject=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Subject']> |>] |>] subjectPublicKeyInfo=<X509_SubjectPublicKeyInfo  signatureAlgorithm=<X509_AlgorithmIdentifier  |> |> extensions=[<X509_Extension  extnValue=<X509_ExtBasicConstraints  |> |>] |> signatureAlgorithm=<X509_AlgorithmIdentifier  |> |>)[source]

Bases: IKEv2_payload_CERT

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   CERT TYPE   |            X509CERT           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_CERT_CRT                    
IKEv2_payload_CERT_CRT fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

cert_type

ByteEnumField

4

x509Cert

PacketLenField

<X509_Cert  tbsCertificate=<X509_TBSCertificate  signature=<X509_AlgorithmIdentifier  |> issuer=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] validity=<X509_Validity  |> subject=[<X509_RDN  rdn=[<X509_AttributeTypeAndValue  |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['organizationName']> value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN  rdn=[<X509_AttributeTypeAndValue  type=<ASN1_OID['commonName']> value=<ASN1_PRINTABLE_STRING['Scapy Default Subject']> |>] |>] subjectPublicKeyInfo=<X509_SubjectPublicKeyInfo  signatureAlgorithm=<X509_AlgorithmIdentifier  |> |> extensions=[<X509_Extension  extnValue=<X509_ExtBasicConstraints  |> |>] |> signatureAlgorithm=<X509_AlgorithmIdentifier  |> |>

class scapy.contrib.ikev2.IKEv2_payload_CERT_STR(_pkt, /, *, next_payload=None, res=0, length=None, cert_type=0, cert_data=b'')[source]

Bases: IKEv2_payload_CERT

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   CERT TYPE   |           CERT DATA           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_CERT_STR                    
IKEv2_payload_CERT_STR fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

cert_type

ByteEnumField

0

cert_data

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_CP(_pkt, /, *, next_payload=None, res=0, length=None, CFGType=1, res2=0, attributes=[])[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    CFGTYPE    |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |           ATTRIBUTES          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_CP                       
IKEv2_payload_CP fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

CFGType

ByteEnumField

1

res2

X3BytesField

0

attributes

PacketListField

[]

class scapy.contrib.ikev2.IKEv2_payload_Delete(_pkt, /, *, next_payload=None, res=0, length=None, vendorID=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            VENDORID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. IKEv2_payload_Delete                     
IKEv2_payload_Delete fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

vendorID

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_Encrypted(_pkt, /, *, next_payload=None, res=0, length=None, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_Encrypted                   
IKEv2_payload_Encrypted fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_Encrypted_Fragment(_pkt, /, *, next_payload=None, res=0, length=None, frag_number=1, frag_total=1, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          FRAG NUMBER          |           FRAG TOTAL          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              Fig. IKEv2_payload_Encrypted_Fragment               
IKEv2_payload_Encrypted_Fragment fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

frag_number

ShortField

1

frag_total

ShortField

1

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_IDi(_pkt, /, *, next_payload=None, res=0, length=None, IDtype=1, res2=0, ID=None)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     IDTYPE    |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |               ID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_IDi                      
IKEv2_payload_IDi fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

IDtype

ByteEnumField

1

res2

X3BytesField

0

ID

MultipleTypeField (IPField, IP6Field, StrLenField)

b''

class scapy.contrib.ikev2.IKEv2_payload_IDr(_pkt, /, *, next_payload=None, res=0, length=None, IDtype=1, res2=0, ID=None)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     IDTYPE    |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |               ID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_IDr                      
IKEv2_payload_IDr fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

IDtype

ByteEnumField

1

res2

X3BytesField

0

ID

MultipleTypeField (IPField, IP6Field, StrLenField)

b''

class scapy.contrib.ikev2.IKEv2_payload_KE(_pkt, /, *, next_payload=None, res=0, length=None, group=0, res2=0, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             GROUP             |              RES2             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_KE                       
IKEv2_payload_KE fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

group

ShortEnumField

0

res2

ShortField

0

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_Nonce(_pkt, /, *, next_payload=None, res=0, length=None, load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. IKEv2_payload_Nonce                     
IKEv2_payload_Nonce fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_Notify(_pkt, /, *, next_payload=None, res=0, length=None, proto=None, SPIsize=None, type=0, SPI=b'', load=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     PROTO     |    SPISIZE    |              TYPE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              SPI              |              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. IKEv2_payload_Notify                     
IKEv2_payload_Notify fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

proto

ByteEnumField

None

SPIsize

FieldLenField

None

type

ShortEnumField

0

SPI

StrLenField

b''

load

StrLenField

b''

class scapy.contrib.ikev2.IKEv2_payload_Proposal(_pkt, /, *, next_payload=None, res=0, length=None, proposal=1, proto=1, SPIsize=None, trans_nb=None, SPI=b'', trans=<Raw  |>)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    PROPOSAL   |     PROTO     |    SPISIZE    |    TRANS NB   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              SPI              |             TRANS             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_Proposal                    
IKEv2_payload_Proposal fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

proposal

ByteField

1

proto

ByteEnumField

1

SPIsize

FieldLenField

None

trans_nb

ByteField

None

SPI

StrLenField

b''

trans

PacketLenField

<Raw  |>

class scapy.contrib.ikev2.IKEv2_payload_SA(_pkt, /, *, next_payload=None, res=0, length=None, prop=<Raw  |>)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              PROP             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_SA                       
IKEv2_payload_SA fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

prop

PacketLenField

<Raw  |>

class scapy.contrib.ikev2.IKEv2_payload_TSi(_pkt, /, *, next_payload=None, res=0, length=None, number_of_TSs=None, res2=0, traffic_selector=[])[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NUMBER OF TSS |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |        TRAFFIC SELECTOR       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_TSi                      
IKEv2_payload_TSi fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

number_of_TSs

FieldLenField

None

res2

X3BytesField

0

traffic_selector

PacketListField

[]

class scapy.contrib.ikev2.IKEv2_payload_TSr(_pkt, /, *, next_payload=None, res=0, length=None, number_of_TSs=None, res2=0, traffic_selector=[])[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NUMBER OF TSS |                      RES2                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |        TRAFFIC SELECTOR       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. IKEv2_payload_TSr                      
IKEv2_payload_TSr fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

number_of_TSs

FieldLenField

None

res2

X3BytesField

0

traffic_selector

PacketListField

[]

class scapy.contrib.ikev2.IKEv2_payload_Transform(_pkt, /, *, next_payload=None, res=0, length=8, transform_type=None, res2=0, transform_id=None, key_length=2148401152)[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TRANSFORM TYPE|      RES2     |          TRANSFORM ID         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           KEY LENGTH                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_Transform                   
IKEv2_payload_Transform fields

next_payload

ByteEnumField

None

res

ByteField

0

length

ShortField

8

transform_type

ByteEnumField

None

res2

ByteField

0

transform_id

MultiEnumField (Depends on None)

None

key_length

IKEv2_Key_Length_Attribute (Cond)

2148401152

class scapy.contrib.ikev2.IKEv2_payload_VendorID(_pkt, /, *, next_payload=None, res=0, length=None, vendorID=b'')[source]

Bases: IKEv2_class

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  NEXT PAYLOAD |      RES      |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            VENDORID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. IKEv2_payload_VendorID                    
IKEv2_payload_VendorID fields

next_payload

ByteEnumField

None

res

ByteField

0

length

FieldLenField

None

vendorID

StrLenField

b''

class scapy.contrib.ikev2.IPv4TrafficSelector(_pkt, /, *, TS_type=7, IP_protocol_ID=None, length=16, start_port=0, end_port=65535, starting_address_v4='192.168.0.1', ending_address_v4='192.168.0.255')[source]

Bases: TrafficSelector

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TS TYPE    | IP PROTOCOL ID|             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           START PORT          |            END PORT           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      STARTING ADDRESS V4                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       ENDING ADDRESS V4                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. IPv4TrafficSelector                     
IPv4TrafficSelector fields

TS_type

ByteEnumField

7

IP_protocol_ID

ByteEnumField

None

length

ShortField

16

start_port

ShortField

0

end_port

ShortField

65535

starting_address_v4

IPField

'192.168.0.1'

ending_address_v4

IPField

'192.168.0.255'

class scapy.contrib.ikev2.IPv6TrafficSelector(_pkt, /, *, TS_type=8, IP_protocol_ID=None, length=20, start_port=0, end_port=65535, starting_address_v6='2001::', ending_address_v6='2001::')[source]

Bases: TrafficSelector

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TS TYPE    | IP PROTOCOL ID|             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           START PORT          |            END PORT           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      STARTING ADDRESS V6                      |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       ENDING ADDRESS V6                       |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. IPv6TrafficSelector                     
IPv6TrafficSelector fields

TS_type

ByteEnumField

8

IP_protocol_ID

ByteEnumField

None

length

ShortField

20

start_port

ShortField

0

end_port

ShortField

65535

starting_address_v6

IP6Field

'2001::'

ending_address_v6

IP6Field

'2001::'

class scapy.contrib.ikev2.NAT_KEEPALIVE(_pkt, /, *, nat_keepalive=255)[source]

Bases: Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NAT KEEPALIVE |
+-+-+-+-+-+-+-+-+

                        Fig. NAT_KEEPALIVE                        
NAT_KEEPALIVE fields

nat_keepalive

XByteField

255

guess_payload_class(payload)[source]
class scapy.contrib.ikev2.NON_ESP(_pkt, /, *, non_esp=0)[source]

Bases: Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            NON ESP                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. NON_ESP                           
NON_ESP fields

non_esp

XIntField

0

guess_payload_class(payload)[source]
class scapy.contrib.ikev2.RawTrafficSelector(_pkt, /, *, TS_type=None, IP_protocol_ID=None, length=None, load=b'')[source]

Bases: TrafficSelector

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    TS TYPE    | IP PROTOCOL ID|             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LOAD             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. RawTrafficSelector                      
RawTrafficSelector fields

TS_type

ByteEnumField

None

IP_protocol_ID

ByteEnumField

None

length

FieldLenField

None

load

PacketField

b''

class scapy.contrib.ikev2.TrafficSelector(_pkt, /)[source]

Bases: Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
extract_padding(s)[source]
class scapy.contrib.ikev2.UDP_ENCAP(_pkt, /)[source]

Bases: Packet

UDP Encapsulation of IPsec ESP Packets [RFC3948] (for NAT-Traversal)

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
scapy.contrib.ikev2.ikev2scan(ip, **kwargs)[source]

Send a IKEv2 SA to an IP and wait for answers.