-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support per-host snmp community strings #122
Comments
Just finished rebasing the patch on top of current nmap |
I have ported snmp lib and snmp-brute to creds library but it seems creds are not persistent accross scripts in particular in snmp-brute, I do add discovered communities to credentials https://gitlab.com/g10h4ck/nmap-gsoc2015/blob/hotfix/122/scripts/snmp-brute.nse#L202 but then if for example i use snmp-interfaces.nse it use "public" as fallback community like creds storage was empty https://gitlab.com/g10h4ck/nmap-gsoc2015/blob/hotfix/122/nselib/snmp.lua#L465 Any hint ? |
Two things are necessary:
On Wed, Jun 10, 2015 at 6:48 AM, Gioacchino notifications@github.com
|
snmp-interfaces already depends on snmp-brute Isn't it ok to use creds library directly inside Helper class in snmp.lua ? |
After further investigation I can see that the community is correctly stored inside nmap.registry.creds by dumping that table to stduot, dumptable(nmap.registry.creds) while local c = creds.Credentials:new("snmp.lua", host, port) prints nothing |
Finally I figured out what is the problem, seems the first argument to Credentials:new(...) is not just for debug but it's some kind of name for the credential storage, so it's not a good idea to use SCRIPT_NAME, or at least in our case break stuff, and definitely break credential sharing between scripts, documentation doesn't explain this clearly |
Now it is working and ready for comment, if it is ok for you I can commit it to SVN too |
From http://seclists.org/nmap-dev/2014/q1/224:
This patch should probably be modified to use the
creds
library to store and retrieve these credentials. This would allow storing multiple per-service community strings (e.g. read and write both).The text was updated successfully, but these errors were encountered: