Lucene search

K

versant-info NSE Script

🗓️ 08 Mar 2012 17:48:51Reported by Patrik KarlssonType 
nmap
 nmap
🔗 nmap.org👁 99 Views

Extracts information from Versant object database including file paths, version, and database name

Show more
Related
Code
ReporterTitlePublishedViews
Family
Nmap
iscsi-brute NSE Script
10 Dec 201023:20
nmap
Nmap
snmp-win32-software NSE Script
16 Feb 201009:15
nmap
Nmap
stun-info NSE Script
16 Mar 201211:36
nmap
Nmap
socks-open-proxy NSE Script
12 Jun 200923:23
nmap
Nmap
sip-brute NSE Script
9 May 201118:00
nmap
Nmap
snmp-sysdescr NSE Script
6 Nov 200802:52
nmap
Nmap
smb-vuln-cve-2017-7494 NSE Script
10 Jun 201703:29
nmap
Nmap
pop3-ntlm-info NSE Script
8 Jan 201616:06
nmap
Nmap
servicetags NSE Script
22 Feb 201104:32
nmap
Nmap
sip-enum-users NSE Script
9 May 201118:00
nmap
Rows per page
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local table = require "table"
local versant = require "versant"

description = [[
Extracts information, including file paths, version and database names from
a Versant object database.
]]

---
-- @usage
-- nmap -p 5019 <ip> --script versant-info
--
-- @output
-- PORT     STATE SERVICE REASON
-- 5019/tcp open  versant syn-ack
-- | versant-info:
-- |   Hostname: WIN-S6HA7RJFAAR
-- |   Root path: C:\Versant\8
-- |   Database path: C:\Versant\db
-- |   Library path: C:\Versant\8
-- |   Version: 8.0.2
-- |   Databases
-- |     FirstDB@WIN-S6HA7RJFAAR:5019
-- |       Created: Sat Mar 03 12:00:02 2012
-- |       Owner: Administrator
-- |       Version: 8.0.2
-- |     SecondDB@WIN-S6HA7RJFAAR:5019
-- |       Created: Sat Mar 03 03:44:10 2012
-- |       Owner: Administrator
-- |       Version: 8.0.2
-- |     ThirdDB@WIN-S6HA7RJFAAR:5019
-- |       Created: Sun Mar 04 02:20:21 2012
-- |       Owner: Administrator
-- |_      Version: 8.0.2
--


author = "Patrik Karlsson"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"discovery", "safe"}

portrule = shortport.port_or_service(5019, "versant", "tcp")

local function fail(err) return stdnse.format_output(false, err) end

action = function(host, port)

  local v = versant.Versant:new(host, port)
  local status = v:connect()
  if ( not(status) ) then
    return fail("Failed to connect to server")
  end

  local status, newport = v:getObePort()
  if ( not(status) ) then
    return fail("Failed to retrieve OBE port")
  end
  v:close()

  v = versant.Versant.OBE:new(host, newport)
  status = v:connect()
  if ( not(status) ) then
    return fail("Failed to connect to server")
  end

  local result
  status, result = v:getVODInfo()
  if ( not(status) ) then
    return fail("Failed to get VOD information")
  end
  v:close()

  local output = {}

  table.insert(output, ("Hostname: %s"):format(result.hostname))
  table.insert(output, ("Root path: %s"):format(result.root_path))
  table.insert(output, ("Database path: %s"):format(result.db_path))
  table.insert(output, ("Library path: %s"):format(result.lib_path))
  table.insert(output, ("Version: %s"):format(result.version))

  port.version.product = "Versant Database"
  port.version.name = "versant"
  nmap.set_port_version(host, port)

  -- the script may fail after this part, but we want to report at least
  -- the above information if that's the case.

  v = versant.Versant:new(host, port)
  status = v:connect()
  if ( not(status) ) then
    return stdnse.format_output(true, output)
  end

  status, result = v:getNodeInfo()
  if ( not(status) ) then
    return stdnse.format_output(true, output)
  end
  v:close()

  local databases = { name = "Databases" }

  for _, db in ipairs(result) do
    local db_tbl = { name = db.name }
    table.insert(db_tbl, ("Created: %s"):format(db.created))
    table.insert(db_tbl, ("Owner: %s"):format(db.owner))
    table.insert(db_tbl, ("Version: %s"):format(db.version))
    table.insert(databases, db_tbl)
  end

  table.insert(output, databases)
  return stdnse.format_output(true, output)
end

Transform Your Security Services

Elevate your offerings with Vulners' advanced Vulnerability Intelligence. Contact us for a demo and discover the difference comprehensive, actionable intelligence can make in your security strategy.

Book a live demo
08 Mar 2012 17:51Current
9.4High risk
Vulners AI Score9.4
EPSS0.973
99
.json
Report