mirror of
https://github.com/nmap/nmap.git
synced 2025-12-16 20:59:02 +00:00
Use creds username as SNMP community if no ':' indicates password. Fixes #862
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE][GH#862] SNMP scripts will now take a community string provided like
|
||||
`--script-args creds.snmp=private`, which previously did not work because it
|
||||
was interpreted as a username. [Daniel Miller]
|
||||
|
||||
o [NSE] Resolved several issues in the default HTTP redirect rules:
|
||||
- [GH#826] A redirect is now cancelled if the original URL contains
|
||||
embedded credentials
|
||||
|
||||
@@ -447,9 +447,14 @@ Helper = {
|
||||
local creds_store = creds.Credentials:new(creds.ALL_DATA, host, port)
|
||||
for _,cs in ipairs({creds.State.PARAM, creds.State.VALID}) do
|
||||
local account = creds_store:getCredentials(cs)()
|
||||
if (account and account.pass) then
|
||||
o.community = account.pass == "<empty>" and "" or account.pass
|
||||
if account then
|
||||
if account.pass and account.pass ~= "<empty>" and account.pass ~= "" then
|
||||
o.community = account.pass
|
||||
break
|
||||
elseif account.user then
|
||||
o.community = account.user
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user