Nmap Development mailing list archives

Re: [NSE] Need testers for improved SNMP library


From: Daniel Miller <bonsaiviking () gmail com>
Date: Mon, 3 Mar 2014 07:13:03 -0600

On Sun, Mar 2, 2014 at 7:47 AM, Daniel Miller <bonsaiviking () gmail com> wrote:
List,

It's been bugging me for a while how poorly the SNMP NSE library
handled community strings. Essentially, there is a single place in the
registry to store a community string, regardless of whether different
hosts have different communities. The snmp-brute script overwrites
this single place (nmap.registry.snmpcommunity) every time it finishes
a host, so the scripts that rely on it to set the community could be
using the wrong one.

The attached patch adds a Helper class to handle choosing the
community and all the socket communication. Now the discovered
communities are stored in host.registry.snmpcommunity, so each host
can be handled separately. Moving all the socket communication into
the library means this patch actually reduces the number of lines of
code in NSE.

I need testers. I haven't tested this at all myself, though I will be
doing so on Monday, but I am confident that it should work as
expected. Thanks!

Dan

I found and corrected a bug: When invoking an object's methods, I
should have used : instead of . to join the method name to the object.
Please test with the attached cumulative patch.

Dan

Attachment: snmp-helper.diff
Description:

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: