mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 05:09:00 +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-*-
|
# 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:
|
o [NSE] Resolved several issues in the default HTTP redirect rules:
|
||||||
- [GH#826] A redirect is now cancelled if the original URL contains
|
- [GH#826] A redirect is now cancelled if the original URL contains
|
||||||
embedded credentials
|
embedded credentials
|
||||||
|
|||||||
@@ -447,9 +447,14 @@ Helper = {
|
|||||||
local creds_store = creds.Credentials:new(creds.ALL_DATA, host, port)
|
local creds_store = creds.Credentials:new(creds.ALL_DATA, host, port)
|
||||||
for _,cs in ipairs({creds.State.PARAM, creds.State.VALID}) do
|
for _,cs in ipairs({creds.State.PARAM, creds.State.VALID}) do
|
||||||
local account = creds_store:getCredentials(cs)()
|
local account = creds_store:getCredentials(cs)()
|
||||||
if (account and account.pass) then
|
if account then
|
||||||
o.community = account.pass == "<empty>" and "" or account.pass
|
if account.pass and account.pass ~= "<empty>" and account.pass ~= "" then
|
||||||
break
|
o.community = account.pass
|
||||||
|
break
|
||||||
|
elseif account.user then
|
||||||
|
o.community = account.user
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user