boofuzz icon indicating copy to clipboard operation
boofuzz copied to clipboard

Is it possible to fuzz SNMP with boofuzz?

Open yasong opened this issue 6 years ago • 7 comments

I have some doubts in how to fuzz the protocol. I am trying to fuzz the SNMP protocol, but I don't know how to start to do it. Is it possible to fuzz SNMP with boofuzz? Thank you.

yasong avatar Nov 04 '18 13:11 yasong

Surely, boofuzz can be used to fuzz SNMP, although I haven't tried it yet. I have used it to fuzz protocols like HTTP, RTSP, FTP and so on.

Just like fuzzing any other protocol, the general steps are:

  • capture the packets with tools like Wireshark
  • define the protocol format using s_***()
  • connect the protocol message definitions into a graph using Session
  • start fuzzing

You can refer to the examples in this repository.

cq674350529 avatar Nov 05 '18 02:11 cq674350529

It is indeed possible. Fuzzing a server would be easier. See the quickstart guide for an example with FTP: https://boofuzz.readthedocs.io/en/latest/user/quickstart.html

Happy fuzzing!

jtpereyda avatar Nov 05 '18 03:11 jtpereyda

@cq674350529 @jtpereyda Thank you. I have tried it. As the MIB and OID in the SNMP protocol and the encode ASN.1( Basic Encoding Rules), the effect of Fuzz is not good. Is it necessary to load the OID library in the program? Thank you again.

yasong avatar Nov 06 '18 01:11 yasong

@yasong What doesn't work about ASN.1? What are you using for it?

jtpereyda avatar Nov 06 '18 02:11 jtpereyda

@jtpereyda Sorry for not explaining it clearly. SNMP protocol builds the PDU with ASN.1(Basic Encoding Rules). I use the boofuzz to fuzz the SNMP, the most packets are rejected. The format of SNMP is here. SNMP. The data in the PDU is nested. Thank you again.

yasong avatar Nov 06 '18 08:11 yasong

If you are looking for input on your format, it might help to share what you have so far...

jtpereyda avatar Nov 10 '18 21:11 jtpereyda

@jtpereyda Thank you. I have reversed snmp agent of a router and tried to fuzz the SNMP agent of this router. As far as I know, because the SNMP protocol uses BER encoding, when the SNMP agent parses the packet, it will first check the type, and then parse it step by step (nested data). When the current parsing is in error, the latter will not be parsed. Therefore, when the fuzzing test is directly performed, the code of the test is not deep enough (the code coverage is low) image

image

image

image

yasong avatar Nov 11 '18 12:11 yasong