mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 19:09:01 +00:00
o [NSE] Applied patch to add additional version information to Mongodb scripts
[Martin Swende]
This commit is contained in:
@@ -75,8 +75,13 @@ 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