when scapy tryes to decode an SNMP v2c packet the following error is thrown
File "C:\Users\User\Desktop\programmi\tryouts\snmp.py", line 122, in parse_snmp
print(SNMPresponse(bytes(packet)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\base_classes.py", line 399, in __call__
i.__init__(*args, **kargs)
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\packet.py", line 165, in __init__
self.dissect(_pkt)
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\packet.py", line 1029, in dissect
s = self.do_dissect(s)
^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1packet.py", line 55, in do_dissect
return self.ASN1_root.dissect(self, x)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1fields.py", line 496, in dissect
_, x = self.m2i(pkt, s)
^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1fields.py", line 480, in m2i
i, s, remain = codec.check_type_check_len(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1\ber.py", line 330, in check_type_check_len
l, s3 = cls.check_type_get_len(s)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1\ber.py", line 321, in check_type_get_len
s2 = cls.check_type(s)
^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\programmi\tryouts\env\Lib\site-packages\scapy\asn1\ber.py", line 312, in check_type
raise BER_BadTag_Decoding_Error(
scapy.asn1.ber.BER_BadTag_Decoding_Error: BERcodec_SNMP_PDU_RESPONSE: Got tag [4/0x4] while expecting <ASN1Tag PDU_RESPONSE[162]>
Brief description
when scapy tryes to decode an SNMP v2c packet the following error is thrown
the following is the packet bytes string:
Scapy version
2.5.0
Python version
3.12.7
Operating system
Windows 11 / Ubuntu 22.04.4 LTS
Additional environment information
No response
How to reproduce
Actual result
No response
Expected result
No response
Related resources
No response