scapy.layers.snmp

SNMP (Simple Network Management Protocol).

class scapy.layers.snmp.ASN1F_SNMP_PDU_BULK(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_BULK[165]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_GET(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_GET[160]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_INFORM(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_INFORM[166]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_NEXT(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_NEXT[161]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_RESPONSE(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_RESPONSE[162]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_SET(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_SET[163]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_TRAPv1(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_TRAPv1[164]>
class scapy.layers.snmp.ASN1F_SNMP_PDU_TRAPv2(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag PDU_TRAPv2[167]>
class scapy.layers.snmp.ASN1_Class_SNMP[source]

Bases: ASN1_Class_UNIVERSAL

ANY = <ASN1Tag ANY[0]>
BIT_STRING = <ASN1Tag BIT_STRING[3]>
BMP_STRING = <ASN1Tag BMP_STRING[30]>
BOOLEAN = <ASN1Tag BOOLEAN[1]>
CHAR_STRING = <ASN1Tag CHAR_STRING[29]>
COUNTER32 = <ASN1Tag COUNTER32[65]>
COUNTER64 = <ASN1Tag COUNTER64[70]>
EMBEDDED_PDF = <ASN1Tag EMBEDDED_PDF[11]>
ENUMERATED = <ASN1Tag ENUMERATED[10]>
ERROR = <ASN1Tag ERROR[-3]>
EXTERNAL = <ASN1Tag EXTERNAL[8]>
GAUGE32 = <ASN1Tag GAUGE32[66]>
GENERALIZED_TIME = <ASN1Tag GENERALIZED_TIME[24]>
GENERAL_STRING = <ASN1Tag GENERAL_STRING[27]>
GRAPHIC_STRING = <ASN1Tag GRAPHIC_STRING[25]>
IA5_STRING = <ASN1Tag IA5_STRING[22]>
INTEGER = <ASN1Tag INTEGER[2]>
IPADDRESS = <ASN1Tag IPADDRESS[64]>
ISO646_STRING = <ASN1Tag ISO646_STRING[26]>
NONE = <ASN1Tag NONE[-1]>
NULL = <ASN1Tag NULL[5]>
NUMERIC_STRING = <ASN1Tag NUMERIC_STRING[18]>
OBJECT_DESCRIPTOR = <ASN1Tag OBJECT_DESCRIPTOR[7]>
OID = <ASN1Tag OID[6]>
PDU_BULK = <ASN1Tag PDU_BULK[165]>
PDU_GET = <ASN1Tag PDU_GET[160]>
PDU_INFORM = <ASN1Tag PDU_INFORM[166]>
PDU_NEXT = <ASN1Tag PDU_NEXT[161]>
PDU_RESPONSE = <ASN1Tag PDU_RESPONSE[162]>
PDU_SET = <ASN1Tag PDU_SET[163]>
PDU_TRAPv1 = <ASN1Tag PDU_TRAPv1[164]>
PDU_TRAPv2 = <ASN1Tag PDU_TRAPv2[167]>
PRINTABLE_STRING = <ASN1Tag PRINTABLE_STRING[19]>
RAW = <ASN1Tag RAW[-2]>
REAL = <ASN1Tag REAL[9]>
RELATIVE_OID = <ASN1Tag RELATIVE_OID[13]>
SEQUENCE = <ASN1Tag SEQUENCE[48]>
SET = <ASN1Tag SET[49]>
STRING = <ASN1Tag STRING[4]>
T61_STRING = <ASN1Tag T61_STRING[20]>
TIME_TICKS = <ASN1Tag TIME_TICKS[67]>
UNIVERSAL_STRING = <ASN1Tag UNIVERSAL_STRING[28]>
UTC_TIME = <ASN1Tag UTC_TIME[23]>
UTF8_STRING = <ASN1Tag UTF8_STRING[12]>
VIDEOTEX_STRING = <ASN1Tag VIDEOTEX_STRING[21]>
name = 'SNMP'
class scapy.layers.snmp.ASN1_SNMP_PDU_BULK(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_BULK[165]>
class scapy.layers.snmp.ASN1_SNMP_PDU_GET(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_GET[160]>
class scapy.layers.snmp.ASN1_SNMP_PDU_INFORM(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_INFORM[166]>
class scapy.layers.snmp.ASN1_SNMP_PDU_NEXT(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_NEXT[161]>
class scapy.layers.snmp.ASN1_SNMP_PDU_RESPONSE(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_RESPONSE[162]>
class scapy.layers.snmp.ASN1_SNMP_PDU_SET(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_SET[163]>
class scapy.layers.snmp.ASN1_SNMP_PDU_TRAPv1(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_TRAPv1[164]>
class scapy.layers.snmp.ASN1_SNMP_PDU_TRAPv2(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag PDU_TRAPv2[167]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_BULK[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_BULK[165]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_GET[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_GET[160]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_INFORM[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_INFORM[166]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_NEXT[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_NEXT[161]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_RESPONSE[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_RESPONSE[162]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_SET[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_SET[163]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_TRAPv1[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_TRAPv1[164]>
class scapy.layers.snmp.BERcodec_SNMP_PDU_TRAPv2[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag PDU_TRAPv2[167]>
class scapy.layers.snmp.SNMP(_pkt, /, *, version=0x1 <ASN1_INTEGER[1]>, community=<ASN1_STRING['public']>, PDU=<SNMPget  |>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_CHOICE object>)>
aliastypes
answers(other)[source]
fields_desc
SNMP fields

version

ASN1F_enum_INTEGER

0x1 <ASN1_INTEGER[1]>

community

ASN1F_STRING

<ASN1_STRING['public']>

PDU

ASN1F_CHOICE

<SNMPget  |>

class scapy.layers.snmp.SNMPbulk(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, non_repeaters=0x0 <ASN1_INTEGER[0]>, max_repetitions=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_BULK(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPbulk fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

non_repeaters

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

max_repetitions

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPget(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_GET(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPget fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPinform(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_INFORM(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPinform fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPnext(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_NEXT(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPnext fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPresponse(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_RESPONSE(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPresponse fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPset(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_SET(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPset fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPtrapv1(_pkt, /, *, enterprise=<ASN1_OID['.1.3']>, agent_addr=<ASN1_IPADDRESS['0.0.0.0']>, generic_trap=0x0 <ASN1_INTEGER[0]>, specific_trap=0x0 <ASN1_INTEGER[0]>, time_stamp=0x6727b45a <ASN1_TIME_TICKS[<IntAutoTime>]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_TRAPv1(<scapy.asn1fields.ASN1F_OID object>, <scapy.asn1fields.ASN1F_IPADDRESS object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_TIME_TICKS object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPtrapv1 fields

enterprise

ASN1F_OID

<ASN1_OID['.1.3']>

agent_addr

ASN1F_IPADDRESS

<ASN1_IPADDRESS['0.0.0.0']>

generic_trap

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

specific_trap

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

time_stamp

ASN1F_TIME_TICKS

0x6727b45a <ASN1_TIME_TICKS[<IntAutoTime>]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPtrapv2(_pkt, /, *, id=0x0 <ASN1_INTEGER[0]>, error=0x0 <ASN1_INTEGER[0]>, error_index=0x0 <ASN1_INTEGER[0]>, varbindlist=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SNMP_PDU_TRAPv2(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_enum_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <ASN1F_SEQUENCE_OF varbindlist>)>
aliastypes
fields_desc
SNMPtrapv2 fields

id

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

error

ASN1F_enum_INTEGER

0x0 <ASN1_INTEGER[0]>

error_index

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

varbindlist

ASN1F_SEQUENCE_OF

[]

class scapy.layers.snmp.SNMPvarbind(_pkt, /, *, oid=<ASN1_OID['.1.3']>, value=<ASN1_NULL[0]>, noSuchObject=None, noSuchInstance=None, endOfMibView=None)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_OID object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_optional object>)>
aliastypes
fields_desc
SNMPvarbind fields

oid

ASN1F_OID

<ASN1_OID['.1.3']>

value

ASN1F_field

<ASN1_NULL[0]>

noSuchObject

ASN1F_NULL

None

noSuchInstance

ASN1F_NULL

None

endOfMibView

ASN1F_NULL

None

scapy.layers.snmp.snmpwalk(dst, oid='1', community='public')[source]