Resolving OID from a MIB
About OID objects
OID objects are created with an ASN1_OID class:
>>> o1=ASN1_OID("2.5.29.10")
>>> o2=ASN1_OID("1.2.840.113549.1.1.1")
>>> o1,o2
(<ASN1_OID['.2.5.29.10']>, <ASN1_OID['.1.2.840.113549.1.1.1']>)
Loading a MIB
Scapy can parse MIB files and become aware of a mapping between an OID and its name:
>>> load_mib("mib/*")
>>> o1,o2
(<ASN1_OID['basicConstraints']>, <ASN1_OID['rsaEncryption']>)
The MIB files I've used are attached to this page.
Scapy's MIB database
All MIB information is stored into the conf.mib object. This object can be used to find the OID of a name:
>>> conf.mib.sha1_with_rsa_signature '1.2.840.113549.1.1.5'
or to resolve an OID:
>>> conf.mib._oidname("1.2.3.6.1.4.1.5")
'enterprises.5'
It is even possible to graph it:
>>> conf.mib._make_graph()
Attachments
- bootstrap.mib (3.3 kB) -
Contains the beginning of the tree, that most other MIB suppose already knwon
, added by pbi on 07/26/07 20:02:15. - rsa.mib (4.5 kB) -
OID from RSA Data Security Inc
, added by pbi on 07/26/07 20:04:11. - x509-obj.mib (22.7 kB) -
Some objects for x509 certificates
, added by pbi on 07/26/07 20:05:03. - pkix.mib (1.0 kB) -
Some objects from PKIX drafts
, added by pbi on 07/26/07 20:05:34.