mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 17:09:02 +00:00
o [NSE] Added the Internet Storage Name Service (iSNS) library and the
isns-info script that lists information about portals and iSCSI devices. [Patrik Karlsson]
This commit is contained in:
70
scripts/isns-info.nse
Normal file
70
scripts/isns-info.nse
Normal file
@@ -0,0 +1,70 @@
|
||||
local stdnse = require "stdnse"
|
||||
local shortport = require "shortport"
|
||||
local isns = require "isns"
|
||||
local tab = require "tab"
|
||||
|
||||
description = [[
|
||||
Lists portals and iSCSI nodes registered with the Internet Storage Name
|
||||
Service (iSNS).
|
||||
]]
|
||||
|
||||
---
|
||||
-- @usage
|
||||
-- nmap -p 3205 <ip> --script isns-info
|
||||
--
|
||||
-- @output
|
||||
-- PORT STATE SERVICE
|
||||
-- 3205/tcp open unknown
|
||||
-- | isns-info:
|
||||
-- | Portal
|
||||
-- | ip port
|
||||
-- | 192.168.0.1 3260/tcp
|
||||
-- | 192.168.0.2 3260/tcp
|
||||
-- | iSCSI Nodes
|
||||
-- | node type
|
||||
-- | iqn.2001-04.com.example:storage.disk2.sys1.xyz Target
|
||||
-- | iqn.2001-05.com.example:storage.disk2.sys1.xyz Target
|
||||
-- |_ iqn.2001-04.a.com.example:storage.disk3.sys2.abc Target
|
||||
--
|
||||
|
||||
portrule = shortport.port_or_service(3205, 'isns')
|
||||
|
||||
author = "Patrik Karlsson"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"safe", "discovery"}
|
||||
|
||||
local function fail(err) return ("\n ERROR: %s"):format(err or "") end
|
||||
|
||||
action = function(host, port)
|
||||
local helper = isns.Helper:new(host, port)
|
||||
if ( not(helper:connect()) ) then
|
||||
return fail("Failed to connect to server")
|
||||
end
|
||||
|
||||
local status, portals = helper:listPortals()
|
||||
if ( not(status) ) then
|
||||
return
|
||||
end
|
||||
|
||||
local results = {}
|
||||
local restab = tab.new(2)
|
||||
tab.addrow(restab, "ip", "port")
|
||||
for _, portal in ipairs(portals) do
|
||||
tab.addrow(restab, portal.addr, ("%d/%s"):format(portal.port, portal.proto))
|
||||
end
|
||||
table.insert(results, { name = "Portal", tab.dump(restab) })
|
||||
|
||||
local status, nodes = helper:listISCINodes()
|
||||
if ( not(status) ) then
|
||||
return
|
||||
end
|
||||
|
||||
restab = tab.new(2)
|
||||
tab.addrow(restab, "node", "type")
|
||||
for _, portal in ipairs(nodes) do
|
||||
tab.addrow(restab, portal.name, portal.type)
|
||||
end
|
||||
table.insert(results, { name = "iSCSI Nodes", tab.dump(restab) })
|
||||
|
||||
return stdnse.format_output(true, results)
|
||||
end
|
||||
@@ -166,7 +166,7 @@ Entry { filename = "http-robtex-reverse-ip.nse", categories = { "discovery", "ex
|
||||
Entry { filename = "http-robtex-shared-ns.nse", categories = { "discovery", "external", "safe", } }
|
||||
Entry { filename = "http-title.nse", categories = { "default", "discovery", "safe", } }
|
||||
Entry { filename = "http-trace.nse", categories = { "discovery", "safe", "vuln", } }
|
||||
Entry { filename = "http-traceroute.nse", categories = {"discovery", "safe", } }
|
||||
Entry { filename = "http-traceroute.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "http-unsafe-output-escaping.nse", categories = { "discovery", "intrusive", } }
|
||||
Entry { filename = "http-userdir-enum.nse", categories = { "auth", "intrusive", } }
|
||||
Entry { filename = "http-vhosts.nse", categories = { "discovery", "intrusive", } }
|
||||
@@ -203,6 +203,7 @@ Entry { filename = "irc-info.nse", categories = { "default", "discovery", "safe"
|
||||
Entry { filename = "irc-unrealircd-backdoor.nse", categories = { "exploit", "intrusive", "malware", "vuln", } }
|
||||
Entry { filename = "iscsi-brute.nse", categories = { "brute", "intrusive", } }
|
||||
Entry { filename = "iscsi-info.nse", categories = { "default", "discovery", "safe", } }
|
||||
Entry { filename = "isns-info.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "jdwp-version.nse", categories = { "version", } }
|
||||
Entry { filename = "krb5-enum-users.nse", categories = { "auth", "intrusive", } }
|
||||
Entry { filename = "ldap-brute.nse", categories = { "brute", "intrusive", } }
|
||||
@@ -289,6 +290,7 @@ Entry { filename = "rexec-brute.nse", categories = { "brute", "intrusive", } }
|
||||
Entry { filename = "riak-http-info.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "rlogin-brute.nse", categories = { "brute", "intrusive", } }
|
||||
Entry { filename = "rmi-dumpregistry.nse", categories = { "default", "discovery", "safe", } }
|
||||
Entry { filename = "rmi-vuln-classloader.nse", categories = { "intrusive", "vuln", } }
|
||||
Entry { filename = "rpcap-brute.nse", categories = { "brute", "intrusive", } }
|
||||
Entry { filename = "rpcap-info.nse", categories = { "discovery", "safe", } }
|
||||
Entry { filename = "rpcinfo.nse", categories = { "default", "discovery", "safe", } }
|
||||
|
||||
Reference in New Issue
Block a user