scapy.packet module

Packet class. Binding mechanism. fuzz() method.

class scapy.packet.NoPayload(*args, **kargs)

Bases: scapy.packet.Packet

add_payload(payload)
add_underlayer(underlayer)
aliastypes = [<class 'scapy.packet.NoPayload'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

build()

Create the current layer

Returns:string of the packet with the payload
build_done(p)
build_padding()
build_ps(internal=0)
clear_cache()

Clear the raw packet cache for the field and all its subfields

command()

Returns a string representing the command you have to type to obtain the same packet

copy()

Returns a deep copy of the instance.

delfieldval(attr)
dissection_done(pkt)

DEV: will be called after a dissection is completed

do_build()

Create the default version of the layer

Returns:a string of the packet with the payload
fragment(*args, **kargs)
getfield_and_val(attr)
getfieldval(attr)
getlayer(cls, nb=1, _track=None, **flt)

Return the nb^th layer that is an instance of cls, matching flt values.

hashret()

DEV: returns a string that has the same value for a request and its answer.

haslayer(cls)

true if self has a layer that is an instance of cls. Superseded by “cls in self” syntax.

hide_defaults()

Removes fields’ values that are the same as default values.

lastlayer(layer)

Returns the uppest layer of the packet

layers()

returns a list of layer classes (including subclasses) in this packet

remove_payload()
remove_underlayer(other)
route()
setfieldval(attr, val)
show(indent=3, lvl='', label_lvl='')

Prints or returns (when “dump” is true) a hierarchical view of the packet.

Parameters:
  • dump – determine if it prints or returns the string value
  • indent (int) – the size of indentation for each layer
  • lvl (str) – additional information about the layer lvl
  • label_lvl (str) – additional information about the layer fields
Returns:

return a hierarchical view if dump, else print it

sprintf(format[, relax=1]) → str

Where format is a string that can include directives. A directive begins and ends by % and has the following format: %[fmt[r],][cls[:nb].]field%

Parameters:fmt

is a classic printf directive, “r” can be appended for raw substitution: (ex: IP.flags=0x18 instead of SA), nb is the number of the layer (ex: for IP/IP packets, IP:2.src is the src of the upper IP layer). Special case : “%.time%” is the creation time. Ex:

p.sprintf(
  "%.time% %-15s,IP.src% -> %-15s,IP.dst% %IP.chksum% "
  "%03xr,IP.proto% %r,TCP.flags%"
)

Moreover, the format string can include conditional statements. A conditional statement looks like : {layer:string} where layer is a layer name, and string is the string to insert in place of the condition if it is true, i.e. if layer is present. If layer is preceded by a “!”, the result is inverted. Conditions can be imbricated. A valid statement can be:

p.sprintf("This is a{TCP: TCP}{UDP: UDP}{ICMP:n ICMP} packet")
p.sprintf("{IP:%IP.dst% {ICMP:%ICMP.type%}{TCP:%TCP.dport%}}")

A side effect is that, to obtain “{” and “}” characters, you must use “%(” and “%)”.

class scapy.packet.Packet

Bases: scapy.base_classes.BasePacket, scapy.base_classes._CanvasDumpExtended

add_payload(payload)
add_underlayer(underlayer)
aliastypes = [<class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

build()

Create the current layer

Returns:string of the packet with the payload
build_done(p)
build_padding()
build_ps(internal=0)
canvas_dump(layer_shift=0, rebuild=1)
class_default_fields = {<class 'scapy.layers.bluetooth.EIR_Hdr'>: {'len': None, 'type': 0}, <class 'scapy.layers.bluetooth.EIR_Flags'>: {'flags': <Flag 2 (general_disc_mode)>}, <class 'scapy.contrib.aoe.IssueATACommand'>: {'flags': <Flag 0 ()>, 'err_feature': 0, 'sector_count': 1, 'cmd_status': 236, 'lba0': 0, 'lba1': 0, 'lba2': 0, 'lba3': 0, 'lba4': 0, 'lba5': 0, 'reserved': 0, 'data': b''}, <class 'scapy.contrib.aoe.QueryConfigInformation'>: {'buffer_count': 0, 'firmware': 0, 'sector_count': 0, 'aoe': 0, 'ccmd': 0, 'config_length': None, 'config': None}, <class 'scapy.contrib.aoe.MacMaskList'>: {'reserved': 0, 'mcmd': 0, 'merror': 0, 'dir_count': None, 'directives': []}, <class 'scapy.contrib.aoe.ReserveRelease'>: {'rcmd': 0, 'nb_mac': None, 'mac_addrs': []}, <class 'scapy.contrib.automotive.uds.UDS'>: {'service': 0}, <class 'scapy.contrib.automotive.uds.UDS_TP'>: {'subFunction': 0}, <class 'scapy.contrib.automotive.gm.gmlan.GMLAN'>: {'service': 0}, <class 'scapy.contrib.automotive.someip._SOMEIP_MessageId'>: {'srv_id': 0, 'sub_id': 0, 'method_id': 0, 'event_id': 0}, <class 'scapy.contrib.automotive.someip._SOMEIP_RequestId'>: {'client_id': 0, 'session_id': 0}, <class 'scapy.layers.dot11.RSNCipherSuite'>: {'oui': 4012, 'cipher': 4}, <class 'scapy.layers.dot11.AKMSuite'>: {'oui': 4012, 'suite': 1}, <class 'scapy.layers.eap.MACsecSCI'>: {'system_identifier': None, 'port_identifier': 0}, <class 'scapy.contrib.gtp.IE_TEIDI'>: {'ietype': 16, 'TEIDI': <RandInt>}, <class 'scapy.contrib.gtp.IE_NSAPI'>: {'ietype': 20, 'sparebits': 0, 'NSAPI': <RandNum>}, <class 'scapy.contrib.gtp.IE_GSNAddress'>: {'ietype': 133, 'length': 4, 'address': <RandIP>}, <class 'scapy.contrib.gtp.IE_NotImplementedTLV'>: {'ietype': 0, 'length': None, 'data': b''}, <class 'scapy.contrib.gtp.IE_Cause'>: {'ietype': 1, 'CauseValue': None}, <class 'scapy.contrib.gtp.IE_Recovery'>: {'ietype': 14, 'restart_counter': 24}, <class 'scapy.contrib.gtp.IE_TEICP'>: {'ietype': 17, 'TEICI': <RandInt>}, <class 'scapy.contrib.gtp.IE_ChargingId'>: {'ietype': 127, 'Charging_id': <RandInt>}, <class 'scapy.contrib.gtp.IE_ProtocolConfigurationOptions'>: {'ietype': 132, 'length': 4, 'Protocol_Configuration': b''}, <class 'scapy.contrib.gtp.IE_QoS'>: {'ietype': 135, 'length': None, 'allocation_retention_prioiry': 1, 'spare': 0, 'delay_class': 0, 'reliability_class': 0, 'peak_troughput': 0, 'precedence_class': 0, 'mean_troughput': 0, 'traffic_class': 0, 'delivery_order': 0, 'delivery_of_err_sdu': 0, 'max_sdu_size': None, 'max_bitrate_up': None, 'max_bitrate_down': None, 'redidual_ber': 0, 'sdu_err_ratio': 0, 'transfer_delay': 0, 'traffic_handling_prio': 0, 'guaranteed_bit_rate_up': None, 'guaranteed_bit_rate_down': None, 'signaling_indication': 0, 'source_stats_desc': 0, 'max_bitrate_down_ext': None, 'guaranteed_bitrate_down_ext': None, 'max_bitrate_up_ext': None, 'guaranteed_bitrate_up_ext': None, 'max_bitrate_down_ext2': None, 'guaranteed_bitrate_down_ext2': None, 'max_bitrate_up_ext2': None, 'guaranteed_bitrate_up_ext2': None}, <class 'scapy.contrib.gtp.IE_CharginGatewayAddress'>: {'ietype': 251, 'length': 4, 'ipv4_address': '127.0.0.1', 'ipv6_address': '::1'}, <class 'scapy.contrib.gtp.IE_CommonFlags'>: {'ietype': 148, 'length': None, 'dual_addr_bearer_fl': 0, 'upgrade_qos_supported': 0, 'nrsn': 0, 'no_qos_nego': 0, 'mbms_cnting_info': 0, 'ran_procedure_ready': 0, 'mbms_service_type': 0, 'prohibit_payload_compression': 0}, <class 'scapy.contrib.gtp.IE_APNRestriction'>: {'ietype': 149, 'length': 1, 'restriction_type_value': 0}, <class 'scapy.contrib.gtp.IE_BearerControlMode'>: {'ietype': 184, 'length': 1, 'bearer_control_mode': 0}, <class 'scapy.contrib.gtp.IE_MSInfoChangeReportingAction'>: {'ietype': 181, 'length': 1, 'Action': 0}, <class 'scapy.contrib.gtp.IE_EvolvedAllocationRetentionPriority'>: {'ietype': 191, 'length': 1, 'Spare': 0, 'PCI': 0, 'PL': 0, 'PVI': 0}, <class 'scapy.contrib.gtp.IE_PrivateExtension'>: {'ietype': 255, 'length': 1, 'extension identifier': 0, 'extention_value': b''}, <class 'scapy.contrib.gtp.IE_IMSI'>: {'ietype': 2, 'imsi': b'377445030214754'}, <class 'scapy.contrib.gtp.IE_EndUserAddress'>: {'ietype': 128, 'length': 2, 'SPARE': 15, 'PDPTypeOrganization': 1, 'PDPTypeNumber': None, 'PDPAddress': <RandIP>, 'IPv6_PDPAddress': '::1'}, <class 'scapy.contrib.gtp.IE_AccessPointName'>: {'ietype': 131, 'length': None, 'APN': b'nternet'}, <class 'scapy.contrib.gtp.IE_ExtensionHeaderList'>: {'ietype': 141, 'length': None, 'extension_headers': [64, 192]}, <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>: {'len': None, 'classnum': 0, 'classtype': 0}, <class 'scapy.layers.x509.ECFieldID'>: {'fieldType': <ASN1_OID['prime-field']>, 'prime': 0x0 <ASN1_INTEGER[0]>}, <class 'scapy.layers.x509.ECCurve'>: {'a': <ASN1_STRING['']>, 'b': <ASN1_STRING['']>, 'seed': None}, <class 'scapy.layers.x509.X509_AttributeValue'>: {'value': <ASN1_PRINTABLE_STRING['FR']>}, <class 'scapy.layers.x509.X509_AttributeTypeAndValue'>: {'type': <ASN1_OID['countryName']>, 'value': <ASN1_PRINTABLE_STRING['FR']>}, <class 'scapy.layers.x509.X509_RDN'>: {'rdn': [<X509_AttributeTypeAndValue |>]}, <class 'scapy.layers.x509.X509_DirectoryName'>: {'directoryName': [<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Name']> |>] |>]}, <class 'scapy.layers.x509.X509_Attribute'>: {'type': <ASN1_OID['countryName']>, 'values': [<X509_AttributeValue |>]}, <class 'scapy.layers.x509.X509_GeneralName'>: {'generalName': <X509_DirectoryName directoryName=[<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Name']> |>] |>] |>}, <class 'scapy.layers.x509.X509_ExtDistributionPointName'>: {'distributionPointName': None}, <class 'scapy.layers.x509.X509_ExtPolicyInformation'>: {'policyIdentifier': <ASN1_OID['certificatePolicies.0']>, 'policyQualifiers': None}, <class 'scapy.layers.x509.X509_ExtDistributionPoint'>: {'distributionPoint': <X509_ExtDistributionPointName |>, 'reasons': None, 'cRLIssuer': None}, <class 'scapy.layers.x509.X509_AccessDescription'>: {'accessMethod': <ASN1_OID['.0']>, 'accessLocation': <X509_GeneralName generalName=<X509_DirectoryName directoryName=[<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Name']> |>] |>] |> |>}, <class 'scapy.layers.x509.X509_ExtQcStatement'>: {'statementId': <ASN1_OID['.0.4.0.1862.1.1']>, 'statementInfo': None}, <class 'scapy.layers.x509.X509_ExtBasicConstraints'>: {'cA': False <ASN1_BOOLEAN[False]>, 'pathLenConstraint': None}, <class 'scapy.layers.x509.X509_AlgorithmIdentifier'>: {'algorithm': <ASN1_OID['sha256WithRSAEncryption']>, 'parameters': <ASN1_NULL[0]>}, <class 'scapy.layers.x509.RSAPrivateKey'>: {'version': 0x0 <ASN1_INTEGER[0]>, 'modulus': 0xa <ASN1_INTEGER[10]>, 'publicExponent': 0x3 <ASN1_INTEGER[3]>, 'privateExponent': 0x3 <ASN1_INTEGER[3]>, 'prime1': 0x2 <ASN1_INTEGER[2]>, 'prime2': 0x5 <ASN1_INTEGER[5]>, 'exponent1': 0x0 <ASN1_INTEGER[0]>, 'exponent2': 0x3 <ASN1_INTEGER[3]>, 'coefficient': 0x1 <ASN1_INTEGER[1]>, 'otherPrimeInfos': None}, <class 'scapy.layers.x509.ECParameters'>: {'curve': <ASN1_OID['ansip384r1']>}, <class 'scapy.layers.x509.ECDSAPrivateKey'>: {'version': 0x1 <ASN1_INTEGER[1]>, 'privateKey': <ASN1_STRING['']>, 'parameters': None, 'publicKey': None}, <class 'scapy.layers.x509.X509_Validity'>: {'not_before': Sep 20 06:29:10 2019 GMT <ASN1_UTC_TIME['190920062910Z']>, 'not_after': Sep 21 06:39:10 2019 GMT <ASN1_UTC_TIME['190921063910Z']>}, <class 'scapy.layers.x509.X509_SubjectPublicKeyInfo'>: {'signatureAlgorithm': <X509_AlgorithmIdentifier |>, 'subjectPublicKey': None}, <class 'scapy.layers.x509.X509_Extension'>: {'extnID': <ASN1_OID['basicConstraints']>, 'critical': False <ASN1_BOOLEAN[False]>, 'extnValue': <X509_ExtBasicConstraints |>}, <class 'scapy.layers.x509.X509_TBSCertificate'>: {'version': 0x2 <ASN1_INTEGER[2]>, 'serialNumber': 0x1 <ASN1_INTEGER[1]>, 'signature': <X509_AlgorithmIdentifier |>, 'issuer': [<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>], 'validity': <X509_Validity |>, 'subject': [<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Subject']> |>] |>], 'subjectPublicKeyInfo': <X509_SubjectPublicKeyInfo signatureAlgorithm=<X509_AlgorithmIdentifier |> |>, 'issuerUniqueID': None, 'subjectUniqueID': None, 'extensions': [<X509_Extension extnValue=<X509_ExtBasicConstraints |> |>]}, <class 'scapy.layers.x509.X509_TBSCertList'>: {'version': 0x1 <ASN1_INTEGER[1]>, 'signature': <X509_AlgorithmIdentifier |>, 'issuer': [<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>], 'this_update': Sep 20 06:39:09 2019 GMT <ASN1_UTC_TIME['190920063909Z']>, 'next_update': None, 'revokedCertificates': None, 'crlExtensions': None}, <class 'scapy.layers.x509.OCSP_GoodInfo'>: {'info': <ASN1_NULL[0]>}, <class 'scapy.layers.x509.OCSP_RevokedInfo'>: {'revocationTime': [invalid _generalized_time] <ASN1_GENERALIZED_TIME['']>, 'revocationReason': None}, <class 'scapy.layers.x509.OCSP_UnknownInfo'>: {'info': <ASN1_NULL[0]>}, <class 'scapy.layers.x509.OCSP_CertID'>: {'hashAlgorithm': <X509_AlgorithmIdentifier |>, 'issuerNameHash': <ASN1_STRING['']>, 'issuerKeyHash': <ASN1_STRING['']>, 'serialNumber': 0x0 <ASN1_INTEGER[0]>}, <class 'scapy.layers.x509.OCSP_CertStatus'>: {'certStatus': None}, <class 'scapy.layers.x509.OCSP_ByName'>: {'byName': []}, <class 'scapy.layers.x509.OCSP_ByKey'>: {'byKey': <ASN1_STRING['']>}, <class 'scapy.layers.x509.OCSP_ResponderID'>: {'responderID': None}, <class 'scapy.layers.x509.OCSP_ResponseData'>: {'version': 0x0 <ASN1_INTEGER[0]>, 'responderID': <OCSP_ResponderID |>, 'producedAt': Sep 20 06:39:10 2019 GMT <ASN1_GENERALIZED_TIME['20190920063910Z']>, 'responses': [], 'responseExtensions': None}, <class 'scapy.packet.Raw'>: {'load': b''}, <class 'scapy.layers.x509.X509_Cert'>: {'tbsCertificate': <X509_TBSCertificate signature=<X509_AlgorithmIdentifier |> issuer=[<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] validity=<X509_Validity |> subject=[<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Subject']> |>] |>] subjectPublicKeyInfo=<X509_SubjectPublicKeyInfo signatureAlgorithm=<X509_AlgorithmIdentifier |> |> extensions=[<X509_Extension extnValue=<X509_ExtBasicConstraints |> |>] |>, 'signatureAlgorithm': <X509_AlgorithmIdentifier |>, 'signatureValue': <ASN1_BIT_STRING[0110010001...1001100101]=b'defaultsig...tsignature' (0 unused bit)>}, <class 'scapy.layers.x509.X509_CRL'>: {'tbsCertList': <X509_TBSCertList signature=<X509_AlgorithmIdentifier |> issuer=[<X509_RDN rdn=[<X509_AttributeTypeAndValue |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.10' value=<ASN1_PRINTABLE_STRING['Scapy, Inc.']> |>] |>, <X509_RDN rdn=[<X509_AttributeTypeAndValue type='2.5.4.3' value=<ASN1_PRINTABLE_STRING['Scapy Default Issuer']> |>] |>] |>, 'signatureAlgorithm': <X509_AlgorithmIdentifier |>, 'signatureValue': <ASN1_BIT_STRING[0110010001...1001100101]=b'defaultsig...tsignature' (0 unused bit)>}, <class 'scapy.layers.dhcp6.DHCP6'>: {'msgtype': None, 'trid': 0}, <class 'scapy.layers.dot15d4.Dot15d4AuxSecurityHeader'>: {'sec_sc_reserved': 0, 'sec_sc_keyidmode': 0, 'sec_sc_seclevel': 0, 'sec_framecounter': 0, 'sec_keyid_keysource': 0, 'sec_keyid_keyindex': 255}, <class 'scapy.layers.ntp.NTPAuthenticator'>: {'padding': b'', 'key_id': 0, 'dgst': b''}, <class 'scapy.layers.ntp.NTPPeerStatusPacket'>: {'configured': 0, 'auth_enabled': 0, 'authentic': 0, 'reachability': 0, 'reserved': 0, 'peer_sel': 0, 'peer_event_counter': 0, 'peer_event_code': 0}, <class 'scapy.layers.snmp.SNMPget'>: {'id': 0x0 <ASN1_INTEGER[0]>, 'error': 0x0 <ASN1_INTEGER[0]>, 'error_index': 0x0 <ASN1_INTEGER[0]>, 'varbindlist': []}, <class 'scapy.contrib.openflow.OFPMatch'>: {'wildcards1': None, 'nw_dst_mask': None, 'nw_src_mask': None, 'wildcards2': None, 'in_port': None, 'dl_src': None, 'dl_dst': None, 'dl_vlan': None, 'dl_vlan_pcp': None, 'pad1': None, 'dl_type': None, 'nw_tos': None, 'nw_proto': None, 'pad2': None, 'nw_src': '0', 'nw_dst': '0', 'tp_src': None, 'tp_dst': None}, <class 'scapy.contrib.openflow.OFPPhyPort'>: {'port_no': 0, 'hw_addr': '0', 'port_name': b'', 'config': <Flag 0 ()>, 'stp_state': 0, 'state': <Flag 0 ()>, 'curr': <Flag 0 ()>, 'advertised': <Flag 0 ()>, 'supported': <Flag 0 ()>, 'peer': <Flag 0 ()>}, <class 'scapy.contrib.openflow3.OFPMatch'>: {'type': 1, 'len': None, 'oxm_fields': []}, <class 'scapy.contrib.openflow3.OFPPort'>: {'port_no': 0, 'pad1': 0, 'hw_addr': '0', 'pad2': 0, 'port_name': b'', 'config': <Flag 0 ()>, 'state': <Flag 0 ()>, 'curr': <Flag 0 ()>, 'advertised': <Flag 0 ()>, 'supported': <Flag 0 ()>, 'peer': <Flag 0 ()>, 'curr_speed': 0, 'max_speed': 0}, <class 'scapy.layers.tls.keyexchange.ECTrinomialBasis'>: {'klen': None, 'k': b''}, <class 'scapy.layers.tls.keyexchange.ECCurvePkt'>: {'alen': None, 'a': b'', 'blen': None, 'b': b''}, <class 'scapy.layers.tls.record_tls13.TLSInnerPlaintext'>: {'msg': [], 'type': None, 'pad': b''}}
class_default_fields_ref = {<class 'scapy.layers.bluetooth.EIR_Hdr'>: [], <class 'scapy.layers.bluetooth.EIR_Flags'>: [], <class 'scapy.contrib.aoe.IssueATACommand'>: [], <class 'scapy.contrib.aoe.QueryConfigInformation'>: [], <class 'scapy.contrib.aoe.MacMaskList'>: ['directives'], <class 'scapy.contrib.aoe.ReserveRelease'>: ['mac_addrs'], <class 'scapy.contrib.automotive.uds.UDS'>: [], <class 'scapy.contrib.automotive.uds.UDS_TP'>: [], <class 'scapy.contrib.automotive.gm.gmlan.GMLAN'>: [], <class 'scapy.contrib.automotive.someip._SOMEIP_MessageId'>: [], <class 'scapy.contrib.automotive.someip._SOMEIP_RequestId'>: [], <class 'scapy.layers.dot11.RSNCipherSuite'>: [], <class 'scapy.layers.dot11.AKMSuite'>: [], <class 'scapy.layers.eap.MACsecSCI'>: [], <class 'scapy.contrib.gtp.IE_TEIDI'>: ['TEIDI'], <class 'scapy.contrib.gtp.IE_NSAPI'>: ['NSAPI'], <class 'scapy.contrib.gtp.IE_GSNAddress'>: ['address'], <class 'scapy.contrib.gtp.IE_NotImplementedTLV'>: [], <class 'scapy.contrib.gtp.IE_Cause'>: [], <class 'scapy.contrib.gtp.IE_Recovery'>: [], <class 'scapy.contrib.gtp.IE_TEICP'>: ['TEICI'], <class 'scapy.contrib.gtp.IE_ChargingId'>: ['Charging_id'], <class 'scapy.contrib.gtp.IE_ProtocolConfigurationOptions'>: [], <class 'scapy.contrib.gtp.IE_QoS'>: [], <class 'scapy.contrib.gtp.IE_CharginGatewayAddress'>: [], <class 'scapy.contrib.gtp.IE_CommonFlags'>: [], <class 'scapy.contrib.gtp.IE_APNRestriction'>: [], <class 'scapy.contrib.gtp.IE_BearerControlMode'>: [], <class 'scapy.contrib.gtp.IE_MSInfoChangeReportingAction'>: [], <class 'scapy.contrib.gtp.IE_EvolvedAllocationRetentionPriority'>: [], <class 'scapy.contrib.gtp.IE_PrivateExtension'>: [], <class 'scapy.contrib.gtp.IE_IMSI'>: [], <class 'scapy.contrib.gtp.IE_EndUserAddress'>: ['PDPAddress'], <class 'scapy.contrib.gtp.IE_AccessPointName'>: [], <class 'scapy.contrib.gtp.IE_ExtensionHeaderList'>: ['extension_headers'], <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>: [], <class 'scapy.layers.x509.ECFieldID'>: [], <class 'scapy.layers.x509.ECCurve'>: [], <class 'scapy.layers.x509.X509_AttributeValue'>: [], <class 'scapy.layers.x509.X509_AttributeTypeAndValue'>: [], <class 'scapy.layers.x509.X509_RDN'>: ['rdn'], <class 'scapy.layers.x509.X509_DirectoryName'>: ['directoryName'], <class 'scapy.layers.x509.X509_Attribute'>: ['values'], <class 'scapy.layers.x509.X509_GeneralName'>: ['generalName'], <class 'scapy.layers.x509.X509_ExtDistributionPointName'>: [], <class 'scapy.layers.x509.X509_ExtPolicyInformation'>: [], <class 'scapy.layers.x509.X509_ExtDistributionPoint'>: ['distributionPoint'], <class 'scapy.layers.x509.X509_AccessDescription'>: ['accessLocation'], <class 'scapy.layers.x509.X509_ExtQcStatement'>: [], <class 'scapy.layers.x509.X509_ExtBasicConstraints'>: [], <class 'scapy.layers.x509.X509_AlgorithmIdentifier'>: [], <class 'scapy.layers.x509.RSAPrivateKey'>: [], <class 'scapy.layers.x509.ECParameters'>: [], <class 'scapy.layers.x509.ECDSAPrivateKey'>: [], <class 'scapy.layers.x509.X509_Validity'>: [], <class 'scapy.layers.x509.X509_SubjectPublicKeyInfo'>: ['signatureAlgorithm'], <class 'scapy.layers.x509.X509_Extension'>: ['extnValue'], <class 'scapy.layers.x509.X509_TBSCertificate'>: ['signature', 'issuer', 'validity', 'subject', 'subjectPublicKeyInfo', 'extensions'], <class 'scapy.layers.x509.X509_TBSCertList'>: ['signature', 'issuer'], <class 'scapy.layers.x509.OCSP_GoodInfo'>: [], <class 'scapy.layers.x509.OCSP_RevokedInfo'>: [], <class 'scapy.layers.x509.OCSP_UnknownInfo'>: [], <class 'scapy.layers.x509.OCSP_CertID'>: ['hashAlgorithm'], <class 'scapy.layers.x509.OCSP_CertStatus'>: [], <class 'scapy.layers.x509.OCSP_ByName'>: ['byName'], <class 'scapy.layers.x509.OCSP_ByKey'>: [], <class 'scapy.layers.x509.OCSP_ResponderID'>: [], <class 'scapy.layers.x509.OCSP_ResponseData'>: ['responderID', 'responses'], <class 'scapy.packet.Raw'>: [], <class 'scapy.layers.x509.X509_Cert'>: ['tbsCertificate', 'signatureAlgorithm'], <class 'scapy.layers.x509.X509_CRL'>: ['tbsCertList', 'signatureAlgorithm'], <class 'scapy.layers.dhcp6.DHCP6'>: [], <class 'scapy.layers.dot15d4.Dot15d4AuxSecurityHeader'>: [], <class 'scapy.layers.ntp.NTPAuthenticator'>: [], <class 'scapy.layers.ntp.NTPPeerStatusPacket'>: [], <class 'scapy.layers.snmp.SNMPget'>: ['varbindlist'], <class 'scapy.contrib.openflow.OFPMatch'>: [], <class 'scapy.contrib.openflow.OFPPhyPort'>: [], <class 'scapy.contrib.openflow3.OFPMatch'>: ['oxm_fields'], <class 'scapy.contrib.openflow3.OFPPort'>: [], <class 'scapy.layers.tls.keyexchange.ECTrinomialBasis'>: [], <class 'scapy.layers.tls.keyexchange.ECCurvePkt'>: [], <class 'scapy.layers.tls.record_tls13.TLSInnerPlaintext'>: ['msg']}
class_dont_cache = {}
class_fieldtype = {<class 'scapy.layers.bluetooth.EIR_Hdr'>: {'len': <Field (EIR_Hdr).len>, 'type': <Field (EIR_Hdr).type>}, <class 'scapy.layers.bluetooth.EIR_Flags'>: {'flags': <Field (EIR_Flags).flags>}, <class 'scapy.contrib.aoe.IssueATACommand'>: {'flags': <Field (IssueATACommand).flags>, 'err_feature': <Field (IssueATACommand).err_feature>, 'sector_count': <Field (IssueATACommand).sector_count>, 'cmd_status': <Field (IssueATACommand).cmd_status>, 'lba0': <Field (IssueATACommand).lba0>, 'lba1': <Field (IssueATACommand).lba1>, 'lba2': <Field (IssueATACommand).lba2>, 'lba3': <Field (IssueATACommand).lba3>, 'lba4': <Field (IssueATACommand).lba4>, 'lba5': <Field (IssueATACommand).lba5>, 'reserved': <Field (IssueATACommand).reserved>, 'data': <Field (IssueATACommand).data>}, <class 'scapy.contrib.aoe.QueryConfigInformation'>: {'buffer_count': <Field (QueryConfigInformation).buffer_count>, 'firmware': <Field (QueryConfigInformation).firmware>, 'sector_count': <Field (QueryConfigInformation).sector_count>, 'aoe': <Field (QueryConfigInformation).aoe>, 'ccmd': <Field (QueryConfigInformation).ccmd>, 'config_length': <Field (QueryConfigInformation).config_length>, 'config': <Field (QueryConfigInformation).config>}, <class 'scapy.contrib.aoe.MacMaskList'>: {'reserved': <Field (MacMaskList).reserved>, 'mcmd': <Field (MacMaskList).mcmd>, 'merror': <Field (MacMaskList).merror>, 'dir_count': <Field (MacMaskList).dir_count>, 'directives': <Field (MacMaskList).directives>}, <class 'scapy.contrib.aoe.ReserveRelease'>: {'rcmd': <Field (ReserveRelease).rcmd>, 'nb_mac': <Field (ReserveRelease).nb_mac>, 'mac_addrs': <Field (ReserveRelease).mac_addrs>}, <class 'scapy.contrib.automotive.uds.UDS'>: {'service': <Field (UDS).service>}, <class 'scapy.contrib.automotive.uds.UDS_TP'>: {'subFunction': <Field (UDS_TP).subFunction>}, <class 'scapy.contrib.automotive.gm.gmlan.GMLAN'>: {'service': <Field (GMLAN).service>}, <class 'scapy.contrib.automotive.someip._SOMEIP_MessageId'>: {'srv_id': <Field (_SOMEIP_MessageId).srv_id>, 'sub_id': <Field (_SOMEIP_MessageId).sub_id>, 'method_id': <scapy.fields.ConditionalField object>, 'event_id': <scapy.fields.ConditionalField object>}, <class 'scapy.contrib.automotive.someip._SOMEIP_RequestId'>: {'client_id': <Field (_SOMEIP_RequestId).client_id>, 'session_id': <Field (_SOMEIP_RequestId).session_id>}, <class 'scapy.layers.dot11.RSNCipherSuite'>: {'oui': <Field (RSNCipherSuite).oui>, 'cipher': <Field (RSNCipherSuite).cipher>}, <class 'scapy.layers.dot11.AKMSuite'>: {'oui': <Field (AKMSuite).oui>, 'suite': <Field (AKMSuite).suite>}, <class 'scapy.layers.eap.MACsecSCI'>: {'system_identifier': <Field (MACsecSCI).system_identifier>, 'port_identifier': <Field (MACsecSCI).port_identifier>}, <class 'scapy.contrib.gtp.IE_TEIDI'>: {'ietype': <Field (IE_TEIDI).ietype>, 'TEIDI': <Field (IE_TEIDI).TEIDI>}, <class 'scapy.contrib.gtp.IE_NSAPI'>: {'ietype': <Field (IE_NSAPI).ietype>, 'sparebits': <Field (IE_NSAPI).sparebits>, 'NSAPI': <Field (IE_NSAPI).NSAPI>}, <class 'scapy.contrib.gtp.IE_GSNAddress'>: {'ietype': <Field (IE_GSNAddress).ietype>, 'length': <Field (IE_GSNAddress).length>, 'address': <Field (IE_GSNAddress).address>}, <class 'scapy.contrib.gtp.IE_NotImplementedTLV'>: {'ietype': <Field (IE_NotImplementedTLV).ietype>, 'length': <Field (IE_NotImplementedTLV).length>, 'data': <Field (IE_NotImplementedTLV).data>}, <class 'scapy.contrib.gtp.IE_Cause'>: {'ietype': <Field (IE_Cause).ietype>, 'CauseValue': <Field (IE_Cause).CauseValue>}, <class 'scapy.contrib.gtp.IE_Recovery'>: {'ietype': <Field (IE_Recovery).ietype>, 'restart_counter': <Field (IE_Recovery).restart_counter>}, <class 'scapy.contrib.gtp.IE_TEICP'>: {'ietype': <Field (IE_TEICP).ietype>, 'TEICI': <Field (IE_TEICP).TEICI>}, <class 'scapy.contrib.gtp.IE_ChargingId'>: {'ietype': <Field (IE_ChargingId).ietype>, 'Charging_id': <Field (IE_ChargingId).Charging_id>}, <class 'scapy.contrib.gtp.IE_ProtocolConfigurationOptions'>: {'ietype': <Field (IE_ProtocolConfigurationOptions).ietype>, 'length': <Field (IE_ProtocolConfigurationOptions).length>, 'Protocol_Configuration': <Field (IE_ProtocolConfigurationOptions).Protocol_Configuration>}, <class 'scapy.contrib.gtp.IE_QoS'>: {'ietype': <Field (IE_QoS).ietype>, 'length': <Field (IE_QoS).length>, 'allocation_retention_prioiry': <Field (IE_QoS).allocation_retention_prioiry>, 'spare': <scapy.fields.ConditionalField object>, 'delay_class': <scapy.fields.ConditionalField object>, 'reliability_class': <scapy.fields.ConditionalField object>, 'peak_troughput': <scapy.fields.ConditionalField object>, 'precedence_class': <scapy.fields.ConditionalField object>, 'mean_troughput': <scapy.fields.ConditionalField object>, 'traffic_class': <scapy.fields.ConditionalField object>, 'delivery_order': <scapy.fields.ConditionalField object>, 'delivery_of_err_sdu': <scapy.fields.ConditionalField object>, 'max_sdu_size': <scapy.fields.ConditionalField object>, 'max_bitrate_up': <scapy.fields.ConditionalField object>, 'max_bitrate_down': <scapy.fields.ConditionalField object>, 'redidual_ber': <scapy.fields.ConditionalField object>, 'sdu_err_ratio': <scapy.fields.ConditionalField object>, 'transfer_delay': <scapy.fields.ConditionalField object>, 'traffic_handling_prio': <scapy.fields.ConditionalField object>, 'guaranteed_bit_rate_up': <scapy.fields.ConditionalField object>, 'guaranteed_bit_rate_down': <scapy.fields.ConditionalField object>, 'signaling_indication': <scapy.fields.ConditionalField object>, 'source_stats_desc': <scapy.fields.ConditionalField object>, 'max_bitrate_down_ext': <scapy.fields.ConditionalField object>, 'guaranteed_bitrate_down_ext': <scapy.fields.ConditionalField object>, 'max_bitrate_up_ext': <scapy.fields.ConditionalField object>, 'guaranteed_bitrate_up_ext': <scapy.fields.ConditionalField object>, 'max_bitrate_down_ext2': <scapy.fields.ConditionalField object>, 'guaranteed_bitrate_down_ext2': <scapy.fields.ConditionalField object>, 'max_bitrate_up_ext2': <scapy.fields.ConditionalField object>, 'guaranteed_bitrate_up_ext2': <scapy.fields.ConditionalField object>}, <class 'scapy.contrib.gtp.IE_CharginGatewayAddress'>: {'ietype': <Field (IE_CharginGatewayAddress).ietype>, 'length': <Field (IE_CharginGatewayAddress).length>, 'ipv4_address': <scapy.fields.ConditionalField object>, 'ipv6_address': <scapy.fields.ConditionalField object>}, <class 'scapy.contrib.gtp.IE_CommonFlags'>: {'ietype': <Field (IE_CommonFlags).ietype>, 'length': <Field (IE_CommonFlags).length>, 'dual_addr_bearer_fl': <Field (IE_CommonFlags).dual_addr_bearer_fl>, 'upgrade_qos_supported': <Field (IE_CommonFlags).upgrade_qos_supported>, 'nrsn': <Field (IE_CommonFlags).nrsn>, 'no_qos_nego': <Field (IE_CommonFlags).no_qos_nego>, 'mbms_cnting_info': <Field (IE_CommonFlags).mbms_cnting_info>, 'ran_procedure_ready': <Field (IE_CommonFlags).ran_procedure_ready>, 'mbms_service_type': <Field (IE_CommonFlags).mbms_service_type>, 'prohibit_payload_compression': <Field (IE_CommonFlags).prohibit_payload_compression>}, <class 'scapy.contrib.gtp.IE_APNRestriction'>: {'ietype': <Field (IE_APNRestriction).ietype>, 'length': <Field (IE_APNRestriction).length>, 'restriction_type_value': <Field (IE_APNRestriction).restriction_type_value>}, <class 'scapy.contrib.gtp.IE_BearerControlMode'>: {'ietype': <Field (IE_BearerControlMode).ietype>, 'length': <Field (IE_BearerControlMode).length>, 'bearer_control_mode': <Field (IE_BearerControlMode).bearer_control_mode>}, <class 'scapy.contrib.gtp.IE_MSInfoChangeReportingAction'>: {'ietype': <Field (IE_MSInfoChangeReportingAction).ietype>, 'length': <Field (IE_MSInfoChangeReportingAction).length>, 'Action': <Field (IE_MSInfoChangeReportingAction).Action>}, <class 'scapy.contrib.gtp.IE_EvolvedAllocationRetentionPriority'>: {'ietype': <Field (IE_EvolvedAllocationRetentionPriority).ietype>, 'length': <Field (IE_EvolvedAllocationRetentionPriority).length>, 'Spare': <Field (IE_EvolvedAllocationRetentionPriority).Spare>, 'PCI': <Field (IE_EvolvedAllocationRetentionPriority).PCI>, 'PL': <Field (IE_EvolvedAllocationRetentionPriority).PL>, 'PVI': <Field (IE_EvolvedAllocationRetentionPriority).PVI>}, <class 'scapy.contrib.gtp.IE_PrivateExtension'>: {'ietype': <Field (IE_PrivateExtension).ietype>, 'length': <Field (IE_PrivateExtension).length>, 'extension identifier': <Field (IE_PrivateExtension).extension identifier>, 'extention_value': <Field (IE_PrivateExtension).extention_value>}, <class 'scapy.contrib.gtp.IE_IMSI'>: {'ietype': <Field (IE_IMSI).ietype>, 'imsi': <Field (IE_IMSI).imsi>}, <class 'scapy.contrib.gtp.IE_EndUserAddress'>: {'ietype': <Field (IE_EndUserAddress).ietype>, 'length': <Field (IE_EndUserAddress).length>, 'SPARE': <Field (IE_EndUserAddress).SPARE>, 'PDPTypeOrganization': <Field (IE_EndUserAddress).PDPTypeOrganization>, 'PDPTypeNumber': <Field (IE_EndUserAddress).PDPTypeNumber>, 'PDPAddress': <scapy.fields.ConditionalField object>, 'IPv6_PDPAddress': <scapy.fields.ConditionalField object>}, <class 'scapy.contrib.gtp.IE_AccessPointName'>: {'ietype': <Field (IE_AccessPointName).ietype>, 'length': <Field (IE_AccessPointName).length>, 'APN': <Field (IE_AccessPointName).APN>}, <class 'scapy.contrib.gtp.IE_ExtensionHeaderList'>: {'ietype': <Field (IE_ExtensionHeaderList).ietype>, 'length': <Field (IE_ExtensionHeaderList).length>, 'extension_headers': <Field (IE_ExtensionHeaderList).extension_headers>}, <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>: {'len': <Field (ICMPExtensionObject).len>, 'classnum': <Field (ICMPExtensionObject).classnum>, 'classtype': <Field (ICMPExtensionObject).classtype>}, <class 'scapy.layers.x509.ECFieldID'>: {'fieldType': <scapy.asn1fields.ASN1F_OID object>, 'prime': <scapy.asn1fields.ASN1F_INTEGER object>}, <class 'scapy.layers.x509.ECCurve'>: {'a': <scapy.asn1fields.ASN1F_STRING object>, 'b': <scapy.asn1fields.ASN1F_STRING object>, 'seed': <scapy.asn1fields.ASN1F_BIT_STRING object>}, <class 'scapy.layers.x509.X509_AttributeValue'>: {'value': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.X509_AttributeTypeAndValue'>: {'type': <scapy.asn1fields.ASN1F_OID object>, 'value': <scapy.layers.x509.ASN1F_X509_DirectoryString object>}, <class 'scapy.layers.x509.X509_RDN'>: {'rdn': <ASN1F_SET_OF rdn>}, <class 'scapy.layers.x509.X509_DirectoryName'>: {'directoryName': <ASN1F_SEQUENCE_OF directoryName>}, <class 'scapy.layers.x509.X509_Attribute'>: {'type': <scapy.asn1fields.ASN1F_OID object>, 'values': <ASN1F_SET_OF values>}, <class 'scapy.layers.x509.X509_GeneralName'>: {'generalName': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.X509_ExtDistributionPointName'>: {'distributionPointName': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.X509_ExtPolicyInformation'>: {'policyIdentifier': <scapy.asn1fields.ASN1F_OID object>, 'policyQualifiers': <ASN1F_SEQUENCE_OF policyQualifiers>}, <class 'scapy.layers.x509.X509_ExtDistributionPoint'>: {'distributionPoint': <scapy.asn1fields.ASN1F_PACKET object>, 'reasons': <scapy.asn1fields.ASN1F_FLAGS object>, 'cRLIssuer': <ASN1F_SEQUENCE_OF cRLIssuer>}, <class 'scapy.layers.x509.X509_AccessDescription'>: {'accessMethod': <scapy.asn1fields.ASN1F_OID object>, 'accessLocation': <scapy.asn1fields.ASN1F_PACKET object>}, <class 'scapy.layers.x509.X509_ExtQcStatement'>: {'statementId': <scapy.asn1fields.ASN1F_OID object>, 'statementInfo': <scapy.asn1fields.ASN1F_field object>}, <class 'scapy.layers.x509.X509_ExtBasicConstraints'>: {'cA': <scapy.asn1fields.ASN1F_BOOLEAN object>, 'pathLenConstraint': <scapy.asn1fields.ASN1F_INTEGER object>}, <class 'scapy.layers.x509.X509_AlgorithmIdentifier'>: {'algorithm': <scapy.asn1fields.ASN1F_OID object>, 'parameters': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.RSAPrivateKey'>: {'version': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'modulus': <scapy.asn1fields.ASN1F_INTEGER object>, 'publicExponent': <scapy.asn1fields.ASN1F_INTEGER object>, 'privateExponent': <scapy.asn1fields.ASN1F_INTEGER object>, 'prime1': <scapy.asn1fields.ASN1F_INTEGER object>, 'prime2': <scapy.asn1fields.ASN1F_INTEGER object>, 'exponent1': <scapy.asn1fields.ASN1F_INTEGER object>, 'exponent2': <scapy.asn1fields.ASN1F_INTEGER object>, 'coefficient': <scapy.asn1fields.ASN1F_INTEGER object>, 'otherPrimeInfos': <ASN1F_SEQUENCE_OF otherPrimeInfos>}, <class 'scapy.layers.x509.ECParameters'>: {'curve': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.ECDSAPrivateKey'>: {'version': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'privateKey': <scapy.asn1fields.ASN1F_STRING object>, 'parameters': <scapy.asn1fields.ASN1F_PACKET object>, 'publicKey': <scapy.asn1fields.ASN1F_PACKET object>}, <class 'scapy.layers.x509.X509_Validity'>: {'not_before': <scapy.asn1fields.ASN1F_CHOICE object>, 'not_after': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.X509_SubjectPublicKeyInfo'>: {'signatureAlgorithm': <scapy.asn1fields.ASN1F_PACKET object>, 'subjectPublicKey': <scapy.asn1fields.ASN1F_BIT_STRING object>}, <class 'scapy.layers.x509.X509_Extension'>: {'extnID': <scapy.asn1fields.ASN1F_OID object>, 'critical': <scapy.asn1fields.ASN1F_BOOLEAN object>, 'extnValue': <scapy.asn1fields.ASN1F_PACKET object>}, <class 'scapy.layers.x509.X509_TBSCertificate'>: {'version': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'serialNumber': <scapy.asn1fields.ASN1F_INTEGER object>, 'signature': <scapy.asn1fields.ASN1F_PACKET object>, 'issuer': <ASN1F_SEQUENCE_OF issuer>, 'validity': <scapy.asn1fields.ASN1F_PACKET object>, 'subject': <ASN1F_SEQUENCE_OF subject>, 'subjectPublicKeyInfo': <scapy.asn1fields.ASN1F_PACKET object>, 'issuerUniqueID': <scapy.asn1fields.ASN1F_BIT_STRING object>, 'subjectUniqueID': <scapy.asn1fields.ASN1F_BIT_STRING object>, 'extensions': <ASN1F_SEQUENCE_OF extensions>}, <class 'scapy.layers.x509.X509_TBSCertList'>: {'version': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'signature': <scapy.asn1fields.ASN1F_PACKET object>, 'issuer': <ASN1F_SEQUENCE_OF issuer>, 'this_update': <scapy.asn1fields.ASN1F_UTC_TIME object>, 'next_update': <scapy.asn1fields.ASN1F_UTC_TIME object>, 'revokedCertificates': <ASN1F_SEQUENCE_OF revokedCertificates>, 'crlExtensions': <ASN1F_SEQUENCE_OF crlExtensions>}, <class 'scapy.layers.x509.OCSP_GoodInfo'>: {'info': <scapy.asn1fields.ASN1F_NULL object>}, <class 'scapy.layers.x509.OCSP_RevokedInfo'>: {'revocationTime': <scapy.asn1fields.ASN1F_GENERALIZED_TIME object>, 'revocationReason': <scapy.asn1fields.ASN1F_PACKET object>}, <class 'scapy.layers.x509.OCSP_UnknownInfo'>: {'info': <scapy.asn1fields.ASN1F_NULL object>}, <class 'scapy.layers.x509.OCSP_CertID'>: {'hashAlgorithm': <scapy.asn1fields.ASN1F_PACKET object>, 'issuerNameHash': <scapy.asn1fields.ASN1F_STRING object>, 'issuerKeyHash': <scapy.asn1fields.ASN1F_STRING object>, 'serialNumber': <scapy.asn1fields.ASN1F_INTEGER object>}, <class 'scapy.layers.x509.OCSP_CertStatus'>: {'certStatus': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.OCSP_ByName'>: {'byName': <ASN1F_SEQUENCE_OF byName>}, <class 'scapy.layers.x509.OCSP_ByKey'>: {'byKey': <scapy.asn1fields.ASN1F_STRING object>}, <class 'scapy.layers.x509.OCSP_ResponderID'>: {'responderID': <scapy.asn1fields.ASN1F_CHOICE object>}, <class 'scapy.layers.x509.OCSP_ResponseData'>: {'version': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'responderID': <scapy.asn1fields.ASN1F_PACKET object>, 'producedAt': <scapy.asn1fields.ASN1F_GENERALIZED_TIME object>, 'responses': <ASN1F_SEQUENCE_OF responses>, 'responseExtensions': <ASN1F_SEQUENCE_OF responseExtensions>}, <class 'scapy.packet.Raw'>: {'load': <Field (Raw,Padding,LoWPAN_HC1,_UnknownOpenFlow,_UnEncryptedPreMasterSecret,_TLSEncryptedContent).load>}, <class 'scapy.layers.x509.X509_Cert'>: {'tbsCertificate': <scapy.asn1fields.ASN1F_PACKET object>, 'signatureAlgorithm': <scapy.asn1fields.ASN1F_PACKET object>, 'signatureValue': <scapy.asn1fields.ASN1F_BIT_STRING object>}, <class 'scapy.layers.x509.X509_CRL'>: {'tbsCertList': <scapy.asn1fields.ASN1F_PACKET object>, 'signatureAlgorithm': <scapy.asn1fields.ASN1F_PACKET object>, 'signatureValue': <scapy.asn1fields.ASN1F_BIT_STRING object>}, <class 'scapy.layers.dhcp6.DHCP6'>: {'msgtype': <Field (DHCP6).msgtype>, 'trid': <Field (DHCP6,DHCP6_Solicit,DHCP6_Advertise,DHCP6_Request,DHCP6_Confirm,DHCP6_Renew,DHCP6_Rebind,DHCP6_Reply,DHCP6_Release,DHCP6_Decline,DHCP6_Reconf,DHCP6_InfoRequest).trid>}, <class 'scapy.layers.dot15d4.Dot15d4AuxSecurityHeader'>: {'sec_sc_reserved': <Field (Dot15d4AuxSecurityHeader).sec_sc_reserved>, 'sec_sc_keyidmode': <Field (Dot15d4AuxSecurityHeader).sec_sc_keyidmode>, 'sec_sc_seclevel': <Field (Dot15d4AuxSecurityHeader).sec_sc_seclevel>, 'sec_framecounter': <Field (Dot15d4AuxSecurityHeader).sec_framecounter>, 'sec_keyid_keysource': <scapy.fields.ConditionalField object>, 'sec_keyid_keyindex': <scapy.fields.ConditionalField object>}, <class 'scapy.layers.ntp.NTPAuthenticator'>: {'padding': <Field (NTPAuthenticator).padding>, 'key_id': <Field (NTPAuthenticator).key_id>, 'dgst': <Field (NTPAuthenticator).dgst>}, <class 'scapy.layers.ntp.NTPPeerStatusPacket'>: {'configured': <Field (NTPPeerStatusPacket).configured>, 'auth_enabled': <Field (NTPPeerStatusPacket).auth_enabled>, 'authentic': <Field (NTPPeerStatusPacket).authentic>, 'reachability': <Field (NTPPeerStatusPacket).reachability>, 'reserved': <Field (NTPPeerStatusPacket).reserved>, 'peer_sel': <Field (NTPPeerStatusPacket).peer_sel>, 'peer_event_counter': <Field (NTPPeerStatusPacket).peer_event_counter>, 'peer_event_code': <Field (NTPPeerStatusPacket).peer_event_code>}, <class 'scapy.layers.snmp.SNMPget'>: {'id': <scapy.asn1fields.ASN1F_INTEGER object>, 'error': <scapy.asn1fields.ASN1F_enum_INTEGER object>, 'error_index': <scapy.asn1fields.ASN1F_INTEGER object>, 'varbindlist': <ASN1F_SEQUENCE_OF varbindlist>}, <class 'scapy.contrib.openflow.OFPMatch'>: {'wildcards1': <Field (OFPMatch).wildcards1>, 'nw_dst_mask': <Field (OFPMatch).nw_dst_mask>, 'nw_src_mask': <Field (OFPMatch).nw_src_mask>, 'wildcards2': <Field (OFPMatch).wildcards2>, 'in_port': <Field (OFPMatch).in_port>, 'dl_src': <Field (OFPMatch).dl_src>, 'dl_dst': <Field (OFPMatch).dl_dst>, 'dl_vlan': <Field (OFPMatch).dl_vlan>, 'dl_vlan_pcp': <Field (OFPMatch).dl_vlan_pcp>, 'pad1': <Field (OFPMatch).pad1>, 'dl_type': <Field (OFPMatch).dl_type>, 'nw_tos': <Field (OFPMatch).nw_tos>, 'nw_proto': <Field (OFPMatch).nw_proto>, 'pad2': <Field (OFPMatch).pad2>, 'nw_src': <Field (OFPMatch).nw_src>, 'nw_dst': <Field (OFPMatch).nw_dst>, 'tp_src': <Field (OFPMatch).tp_src>, 'tp_dst': <Field (OFPMatch).tp_dst>}, <class 'scapy.contrib.openflow.OFPPhyPort'>: {'port_no': <Field (OFPPhyPort).port_no>, 'hw_addr': <Field (OFPPhyPort).hw_addr>, 'port_name': <Field (OFPPhyPort).port_name>, 'config': <Field (OFPPhyPort).config>, 'stp_state': <Field (OFPPhyPort).stp_state>, 'state': <Field (OFPPhyPort).state>, 'curr': <Field (OFPPhyPort).curr>, 'advertised': <Field (OFPPhyPort).advertised>, 'supported': <Field (OFPPhyPort).supported>, 'peer': <Field (OFPPhyPort).peer>}, <class 'scapy.contrib.openflow3.OFPMatch'>: {'type': <Field (OFPMatch).type>, 'len': <Field (OFPMatch).len>, 'oxm_fields': <Field (OFPMatch).oxm_fields>}, <class 'scapy.contrib.openflow3.OFPPort'>: {'port_no': <Field (OFPPort).port_no>, 'pad1': <Field (OFPPort).pad1>, 'hw_addr': <Field (OFPPort).hw_addr>, 'pad2': <Field (OFPPort).pad2>, 'port_name': <Field (OFPPort).port_name>, 'config': <Field (OFPPort).config>, 'state': <Field (OFPPort).state>, 'curr': <Field (OFPPort).curr>, 'advertised': <Field (OFPPort).advertised>, 'supported': <Field (OFPPort).supported>, 'peer': <Field (OFPPort).peer>, 'curr_speed': <Field (OFPPort).curr_speed>, 'max_speed': <Field (OFPPort).max_speed>}, <class 'scapy.layers.tls.keyexchange.ECTrinomialBasis'>: {'klen': <Field (ECTrinomialBasis).klen>, 'k': <Field (ECTrinomialBasis).k>}, <class 'scapy.layers.tls.keyexchange.ECCurvePkt'>: {'alen': <Field (ECCurvePkt).alen>, 'a': <Field (ECCurvePkt).a>, 'blen': <Field (ECCurvePkt).blen>, 'b': <Field (ECCurvePkt).b>}, <class 'scapy.layers.tls.record_tls13.TLSInnerPlaintext'>: {'msg': <Field (TLSInnerPlaintext).msg>, 'type': <Field (TLSInnerPlaintext).type>, 'pad': <Field (TLSInnerPlaintext).pad>}}
class_packetfields = {<class 'scapy.layers.bluetooth.EIR_Hdr'>: [], <class 'scapy.layers.bluetooth.EIR_Flags'>: [], <class 'scapy.contrib.aoe.IssueATACommand'>: [], <class 'scapy.contrib.aoe.QueryConfigInformation'>: [], <class 'scapy.contrib.aoe.MacMaskList'>: [<Field (MacMaskList).directives>], <class 'scapy.contrib.aoe.ReserveRelease'>: [], <class 'scapy.contrib.automotive.uds.UDS'>: [], <class 'scapy.contrib.automotive.uds.UDS_TP'>: [], <class 'scapy.contrib.automotive.gm.gmlan.GMLAN'>: [], <class 'scapy.contrib.automotive.someip._SOMEIP_MessageId'>: [], <class 'scapy.contrib.automotive.someip._SOMEIP_RequestId'>: [], <class 'scapy.layers.dot11.RSNCipherSuite'>: [], <class 'scapy.layers.dot11.AKMSuite'>: [], <class 'scapy.layers.eap.MACsecSCI'>: [], <class 'scapy.contrib.gtp.IE_TEIDI'>: [], <class 'scapy.contrib.gtp.IE_NSAPI'>: [], <class 'scapy.contrib.gtp.IE_GSNAddress'>: [], <class 'scapy.contrib.gtp.IE_NotImplementedTLV'>: [], <class 'scapy.contrib.gtp.IE_Cause'>: [], <class 'scapy.contrib.gtp.IE_Recovery'>: [], <class 'scapy.contrib.gtp.IE_TEICP'>: [], <class 'scapy.contrib.gtp.IE_ChargingId'>: [], <class 'scapy.contrib.gtp.IE_ProtocolConfigurationOptions'>: [], <class 'scapy.contrib.gtp.IE_QoS'>: [], <class 'scapy.contrib.gtp.IE_CharginGatewayAddress'>: [], <class 'scapy.contrib.gtp.IE_CommonFlags'>: [], <class 'scapy.contrib.gtp.IE_APNRestriction'>: [], <class 'scapy.contrib.gtp.IE_BearerControlMode'>: [], <class 'scapy.contrib.gtp.IE_MSInfoChangeReportingAction'>: [], <class 'scapy.contrib.gtp.IE_EvolvedAllocationRetentionPriority'>: [], <class 'scapy.contrib.gtp.IE_PrivateExtension'>: [], <class 'scapy.contrib.gtp.IE_IMSI'>: [], <class 'scapy.contrib.gtp.IE_EndUserAddress'>: [], <class 'scapy.contrib.gtp.IE_AccessPointName'>: [], <class 'scapy.contrib.gtp.IE_ExtensionHeaderList'>: [], <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>: [], <class 'scapy.layers.x509.ECFieldID'>: [], <class 'scapy.layers.x509.ECCurve'>: [], <class 'scapy.layers.x509.X509_AttributeValue'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.X509_AttributeTypeAndValue'>: [<scapy.layers.x509.ASN1F_X509_DirectoryString object>], <class 'scapy.layers.x509.X509_RDN'>: [<ASN1F_SET_OF rdn>], <class 'scapy.layers.x509.X509_DirectoryName'>: [<ASN1F_SEQUENCE_OF directoryName>], <class 'scapy.layers.x509.X509_Attribute'>: [<ASN1F_SET_OF values>], <class 'scapy.layers.x509.X509_GeneralName'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.X509_ExtDistributionPointName'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.X509_ExtPolicyInformation'>: [<ASN1F_SEQUENCE_OF policyQualifiers>], <class 'scapy.layers.x509.X509_ExtDistributionPoint'>: [<scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF cRLIssuer>], <class 'scapy.layers.x509.X509_AccessDescription'>: [<scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.X509_ExtQcStatement'>: [], <class 'scapy.layers.x509.X509_ExtBasicConstraints'>: [], <class 'scapy.layers.x509.X509_AlgorithmIdentifier'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.RSAPrivateKey'>: [<ASN1F_SEQUENCE_OF otherPrimeInfos>], <class 'scapy.layers.x509.ECParameters'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.ECDSAPrivateKey'>: [<scapy.asn1fields.ASN1F_PACKET object>, <scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.X509_Validity'>: [<scapy.asn1fields.ASN1F_CHOICE object>, <scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.X509_SubjectPublicKeyInfo'>: [<scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.X509_Extension'>: [<scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.X509_TBSCertificate'>: [<scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF issuer>, <scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF subject>, <scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF extensions>], <class 'scapy.layers.x509.X509_TBSCertList'>: [<scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF issuer>, <ASN1F_SEQUENCE_OF revokedCertificates>, <ASN1F_SEQUENCE_OF crlExtensions>], <class 'scapy.layers.x509.OCSP_GoodInfo'>: [], <class 'scapy.layers.x509.OCSP_RevokedInfo'>: [<scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.OCSP_UnknownInfo'>: [], <class 'scapy.layers.x509.OCSP_CertID'>: [<scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.OCSP_CertStatus'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.OCSP_ByName'>: [<ASN1F_SEQUENCE_OF byName>], <class 'scapy.layers.x509.OCSP_ByKey'>: [], <class 'scapy.layers.x509.OCSP_ResponderID'>: [<scapy.asn1fields.ASN1F_CHOICE object>], <class 'scapy.layers.x509.OCSP_ResponseData'>: [<scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF responses>, <ASN1F_SEQUENCE_OF responseExtensions>], <class 'scapy.packet.Raw'>: [], <class 'scapy.layers.x509.X509_Cert'>: [<scapy.asn1fields.ASN1F_PACKET object>, <scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.x509.X509_CRL'>: [<scapy.asn1fields.ASN1F_PACKET object>, <scapy.asn1fields.ASN1F_PACKET object>], <class 'scapy.layers.dhcp6.DHCP6'>: [], <class 'scapy.layers.dot15d4.Dot15d4AuxSecurityHeader'>: [], <class 'scapy.layers.ntp.NTPAuthenticator'>: [], <class 'scapy.layers.ntp.NTPPeerStatusPacket'>: [], <class 'scapy.layers.snmp.SNMPget'>: [<ASN1F_SEQUENCE_OF varbindlist>], <class 'scapy.contrib.openflow.OFPMatch'>: [], <class 'scapy.contrib.openflow.OFPPhyPort'>: [], <class 'scapy.contrib.openflow3.OFPMatch'>: [<Field (OFPMatch).oxm_fields>], <class 'scapy.contrib.openflow3.OFPPort'>: [], <class 'scapy.layers.tls.keyexchange.ECTrinomialBasis'>: [], <class 'scapy.layers.tls.keyexchange.ECCurvePkt'>: [], <class 'scapy.layers.tls.record_tls13.TLSInnerPlaintext'>: [<Field (TLSInnerPlaintext).msg>]}
clear_cache()

Clear the raw packet cache for the field and all its subfields

clone_with(payload=None, share_time=False, **kargs)
command()

Returns a string representing the command you have to type to obtain the same packet

classmethod convert_packet(pkt, **kwargs)

Converts another packet to be this type.

This is not guaranteed to be a lossless process.

Parameters:pkt (scapy.packet.Packet) – The packet to convert.
Returns:Converted form of the packet.
Return type:cls
Raises:TypeError – When conversion is not possible
classmethod convert_packets(pkts, **kwargs)

Converts many packets to this type.

This is implemented as a generator.

See Packet.convert_packet.

convert_to(other_cls, **kwargs)

Converts this Packet to another type.

This is not guaranteed to be a lossless process.

By default, this only implements conversion to Raw.

Parameters:other_cls (Type[scapy.packet.Packet]) – Reference to a Packet class to convert to.
Returns:Converted form of the packet.
Return type:other_cls
Raises:TypeError – When conversion is not possible
copy()

Returns a deep copy of the instance.

copy_field_value(fieldname, value)
copy_fields_dict(fields)
decode_payload_as(cls)

Reassembles the payload and decode it using another packet class

default_fields
default_payload_class(payload)

DEV: Returns the default payload class if nothing has been found by the guess_payload_class() method.

Parameters:payload (str) – the layer’s payload
Returns:the default payload class define inside the configuration file
delfieldval(attr)
deprecated_fields = {}
direction
display(*args, **kargs)

Deprecated. Use show() method.

dissect(s)
dissection_done(pkt)

DEV: will be called after a dissection is completed

do_build()

Create the default version of the layer

Returns:a string of the packet with the payload
do_build_payload()

Create the default version of the payload layer

Returns:a string of payload layer
do_build_ps()
do_dissect(s)
do_dissect_payload(s)

Perform the dissection of the layer’s payload

Parameters:s (str) – the raw layer
do_init_cached_fields()

Initialize each fields of the fields_desc dict, or use the cached fields information

do_init_fields(flist)

Initialize each fields of the fields_desc dict

explicit
extract_padding(s)

DEV: to be overloaded to extract current layer’s padding.

Parameters:s (str) – the current layer
Returns:a couple of strings (actual layer, padding)
fields
fields_desc = []
fieldtype
firstlayer()
fragment(*args, **kargs)
classmethod from_hexcap()
get_field(fld)

DEV: returns the field instance from the name of the field

getfield_and_val(attr)
getfieldval(attr)
getlayer(cls, nb=1, _track=None, _subclass=None, **flt)

Return the nb^th layer that is an instance of cls, matching flt values.

guess_payload_class(payload)

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
hashret()

DEV: returns a string that has the same value for a request and its answer.

haslayer(cls)

true if self has a layer that is an instance of cls. Superseded by “cls in self” syntax.

hide_defaults()

Removes fields’ values that are the same as default values.

init_fields()

Initialize each fields of the fields_desc dict

iterpayloads()

Used to iter through the paylods of a Packet. Useful for DNS or 802.11 for instance.

lastlayer(layer=None)

Returns the uppest layer of the packet

layers()

returns a list of layer classes (including subclasses) in this packet

classmethod lower_bonds()
match_subclass = False
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

name
original
overload_fields
overloaded_fields
packetfields
payload
payload_guess = []
post_build(pkt, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

post_dissect(s)

DEV: is called right after the current layer has been dissected

post_dissection(pkt)

DEV: is called after the dissection of the whole packet

post_transforms
pre_dissect(s)

DEV: is called right before the current layer is dissected

prepare_cached_fields(flist)

Prepare the cached fields of the fields_desc dict

raw_packet_cache
raw_packet_cache_fields
remove_payload()
remove_underlayer(other)
route()
self_build(field_pos_list=None)

Create the default layer regarding fields_desc dict

Parameters:field_pos_list
sent_time
setfieldval(attr, val)
show(dump=False, indent=3, lvl='', label_lvl='')

Prints or returns (when “dump” is true) a hierarchical view of the packet.

Parameters:
  • dump – determine if it prints or returns the string value
  • indent (int) – the size of indentation for each layer
  • lvl (str) – additional information about the layer lvl
  • label_lvl (str) – additional information about the layer fields
Returns:

return a hierarchical view if dump, else print it

show2(dump=False, indent=3, lvl='', label_lvl='')

Prints or returns (when “dump” is true) a hierarchical view of an assembled version of the packet, so that automatic fields are calculated (checksums, etc.)

Parameters:
  • dump – determine if it prints or returns the string value
  • indent (int) – the size of indentation for each layer
  • lvl (str) – additional information about the layer lvl
  • label_lvl (str) – additional information about the layer fields
Returns:

return a hierarchical view if dump, else print it

show_indent = 1
show_summary = True
sniffed_on
sprintf(format[, relax=1]) → str

Where format is a string that can include directives. A directive begins and ends by % and has the following format: %[fmt[r],][cls[:nb].]field%

Parameters:fmt

is a classic printf directive, “r” can be appended for raw substitution: (ex: IP.flags=0x18 instead of SA), nb is the number of the layer (ex: for IP/IP packets, IP:2.src is the src of the upper IP layer). Special case : “%.time%” is the creation time. Ex:

p.sprintf(
  "%.time% %-15s,IP.src% -> %-15s,IP.dst% %IP.chksum% "
  "%03xr,IP.proto% %r,TCP.flags%"
)

Moreover, the format string can include conditional statements. A conditional statement looks like : {layer:string} where layer is a layer name, and string is the string to insert in place of the condition if it is true, i.e. if layer is present. If layer is preceded by a “!”, the result is inverted. Conditions can be imbricated. A valid statement can be:

p.sprintf("This is a{TCP: TCP}{UDP: UDP}{ICMP:n ICMP} packet")
p.sprintf("{IP:%IP.dst% {ICMP:%ICMP.type%}{TCP:%TCP.dport%}}")

A side effect is that, to obtain “{” and “}” characters, you must use “%(” and “%)”.

summary(intern=0)

Prints a one line summary of a packet.

time
underlayer
update_sent_time(time)

Use by clone_with to share the sent_time value

classmethod upper_bonds()
wirelen
class scapy.packet.Padding

Bases: scapy.packet.Raw

aliastypes = [<class 'scapy.packet.Padding'>, <class 'scapy.packet.Raw'>, <class 'scapy.packet.Packet'>]
build_padding()
fields_desc = [<Field (Raw,Padding,LoWPAN_HC1,_UnknownOpenFlow,_UnEncryptedPreMasterSecret,_TLSEncryptedContent).load>]
self_build()

Create the default layer regarding fields_desc dict

Parameters:field_pos_list
class scapy.packet.Raw

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.packet.Raw'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

classmethod convert_packet(pkt, **kwargs)

Converts another packet to be this type.

This is not guaranteed to be a lossless process.

Parameters:pkt (scapy.packet.Packet) – The packet to convert.
Returns:Converted form of the packet.
Return type:cls
Raises:TypeError – When conversion is not possible
fields_desc = [<Field (Raw,Padding,LoWPAN_HC1,_UnknownOpenFlow,_UnEncryptedPreMasterSecret,_TLSEncryptedContent).load>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.packet.RawVal(val='')

Bases: object

scapy.packet.bind_bottom_up(lower, upper, __fval=None, **fval)

Bind 2 layers for dissection. The upper layer will be chosen for dissection on top of the lower layer, if ALL the passed arguments are validated. If multiple calls are made with the same # noqa: E501 layers, the last one will be used as default.

ex:
>>> bind_bottom_up(Ether, SNAP, type=0x1234)
>>> Ether(b'ÿÿÿÿÿÿÐP™VÝù4')  # noqa: E501
<Ether  dst=ff:ff:ff:ff:ff:ff src=d0:50:99:56:dd:f9 type=0x1234 |<SNAP  OUI=0x0 code=0x0 |>>  # noqa: E501
scapy.packet.bind_layers(lower, upper, __fval=None, **fval)

Bind 2 layers on some specific fields’ values.

It makes the packet being built and dissected when the arguments are present.

This function calls both bind_bottom_up and bind_top_down, with all passed arguments.

Please have a look at their docs:
  • help(bind_bottom_up)
  • help(bind_top_down)
scapy.packet.bind_top_down(lower, upper, __fval=None, **fval)

Bind 2 layers for building. When the upper layer is added as a payload of the lower layer, all the arguments # noqa: E501 will be applied to them.

ex:
>>> bind_top_down(Ether, SNAP, type=0x1234)
>>> Ether()/SNAP()
<Ether  type=0x1234 |<SNAP  |>>
scapy.packet.explore(layer=None)

Function used to discover the Scapy layers and protocols. It helps to see which packets exists in contrib or layer files.

params:
  • layer: If specified, the function will explore the layer. If not,
    the GUI mode will be activated, to browse the available layers

Examples

>>> explore()  # Launches the GUI
>>> explore("dns")  # Explore scapy.layers.dns
>>> explore("http2")  # Explore scapy.contrib.http2
>>> explore(scapy.layers.bluetooth4LE)

Note: to search a packet by name, use ls(“name”) rather than explore.

scapy.packet.fuzz(p, _inplace=0)

Transform a layer into a fuzzy layer by replacing some default values by random objects.

Parameters:p – the Packet instance to fuzz
Returns:the fuzzed packet.
scapy.packet.ls(obj=None, case_sensitive=False, verbose=False)

List available layers, or infos on a given layer class or name.

Parameters:
  • obj – Packet / packet name to use
  • case_sensitive – if obj is a string, is it case sensitive?
  • verbose
scapy.packet.split_bottom_up(lower, upper, __fval=None, **fval)

This call un-links an association that was made using bind_bottom_up. Have a look at help(bind_bottom_up)

scapy.packet.split_layers(lower, upper, __fval=None, **fval)

Split 2 layers previously bound. This call un-links calls bind_top_down and bind_bottom_up. It is the opposite of # noqa: E501 bind_layers.

Please have a look at their docs:
  • help(split_bottom_up)
  • help(split_top_down)
scapy.packet.split_top_down(lower, upper, __fval=None, **fval)

This call un-links an association that was made using bind_top_down. Have a look at help(bind_top_down)