Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snmp-brute.nse: Support non-standard ports, support snmp v1 and v2 #1473

wants to merge 3 commits into
base: master


Copy link

usd-markus commented Feb 14, 2019

Changes Overview

These changes for the snmp-brute.nse script consist of essentially 3 changes:

  1. Changing the script to also run & work on non-standard ports
  2. Add support for snmp v2 (before, only snmp v1 requests were sent)
  3. Fixing a thrown error when running the script (even before any changes were made)

Each change is represented by one of the commits.

More info to change 3:

After cloning the git repo and trying the snmp-brute script without making any changes to the source code, I got the following error message:

/home/markus/repos/nmap/scripts/snmp-brute.nse:155: Invalid reuse of a socket from one thread to another.
stack traceback:
    [C]: in method 'send'
    /home/markus/repos/nmap/scripts/snmp-brute.nse:155: in function </home/markus/repos/nmap/scripts/snmp-brute.nse:140>

It seems like the socket created in the action function cannot be passed to a new thread anymore. That is why I replaced the thread creation with a direct function call.

Question about changelog

Is the changelog within snmp-brute.nse still used and should it be updated?

Copy link

Lem commented Oct 2, 2019

What is the state of this merge request? I would need that,too, please.

Copy link

Reelix commented Jul 26, 2020

After having the original script fail on me (Nmap 7.80) I found this version and can confirm that this version does work whilst the original does not.

The snmp-brute.communitiesdb parameter does not seem to support relative paths in Linux (~/wordlists/bla.txt), although that is probably out of the scope of the script.

Copy link

nnposter commented Jul 27, 2020

In commit r37967, all SNMP scripts, not just snmp-brute, have been enabled to run on non-standard ports where SNMP gets detected.

The socket reuse error has been rectified in r37903 (5d281d0) back in February.

The SNMPv2 support has not been addressed.

@Reelix The tilde expansion (or the lack of) is a feature of the invoking shell and has nothing to do with Nmap per se.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.