mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
o [NSE] Applied patch to add additional version information to Mongodb scripts
[Martin Swende]
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Applied patch to add additional version information to Mongodb scripts
|
||||
[Martin Swende]
|
||||
|
||||
o [NSE] Added path argument to the http-auth script and changed so that script
|
||||
output was returned using stdnse.format_output [Duarte Silva, Patrik]
|
||||
|
||||
|
||||
@@ -65,6 +65,10 @@ function action(host,port)
|
||||
status, result = mongodb.query(socket, packet)
|
||||
if not status then return result end-- Error message
|
||||
|
||||
port.version.name ='mongodb'
|
||||
port.version.product='MongoDB'
|
||||
nmap.set_port_version(host,port,'hardmatched')
|
||||
|
||||
local output = mongodb.queryResultToTable(result)
|
||||
if err ~= nil then
|
||||
stdnse.log_error(err)
|
||||
|
||||
@@ -75,7 +75,12 @@ function action(host,port)
|
||||
|
||||
status,statQResult = mongodb.query(socket, packet)
|
||||
|
||||
if not status then return statResult end
|
||||
if not status then return statQResult end
|
||||
|
||||
port.version.name ='mongodb'
|
||||
port.version.product='MongoDB'
|
||||
port.version.name_confidence = 100
|
||||
nmap.set_port_version(host,port,'hardmatched')
|
||||
|
||||
status, packet = mongodb.buildInfoQuery()
|
||||
if not status then return packet end
|
||||
@@ -87,6 +92,10 @@ function action(host,port)
|
||||
return buildQResult
|
||||
end
|
||||
|
||||
local versionNumber = buildQResult['version']
|
||||
port.version.product='MongoDB '..versionNumber
|
||||
nmap.set_port_version(host,port,'hardmatched')
|
||||
|
||||
local stat_out = mongodb.queryResultToTable(statQResult)
|
||||
local build_out = mongodb.queryResultToTable(buildQResult)
|
||||
local output = {"MongoDB Build info",build_out,"Server status",stat_out}
|
||||
|
||||
Reference in New Issue
Block a user