diff --git a/scripts/rpcinfo.nse b/scripts/rpcinfo.nse index d35ba0115..7ae110bb3 100644 --- a/scripts/rpcinfo.nse +++ b/scripts/rpcinfo.nse @@ -38,6 +38,37 @@ Connects to portmapper and fetches a list of all registered programs. It then p -- | 300598 1 32783/udp dmispd -- | 805306368 1 32782/tcp dmispd -- |_ 805306368 1 32783/udp dmispd +--@xmloutput +-- +--
+--
+-- 2049 +--
+-- 234 +--
+-- +-- +-- 2049 +--
+-- 234 +--
+-- +-- +-- +--
+-- 111 +--
+-- 234 +--
+-- +-- +-- 111 +--
+-- 234 +--
+-- +-- +-- author = "Patrik Karlsson" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" @@ -50,12 +81,14 @@ action = function(host, port) local result = {} local status, rpcinfo = rpc.Helper.RpcInfo( host, port ) + local xmlout = {} if ( not(status) ) then return stdnse.format_output(false, rpcinfo) end for progid, v in pairs(rpcinfo) do + xmlout[tostring(progid)] = v for proto, v2 in pairs(v) do table.insert( result, ("%-7d %-10s %5d/%s %s"):format(progid, stdnse.strjoin(",", v2.version), v2.port, proto, rpc.Util.ProgNumberToName(progid) or "") ) end @@ -67,6 +100,6 @@ action = function(host, port) table.insert(result, 1, "program version port/proto service") end - return stdnse.format_output( true, result ) + return xmlout, stdnse.format_output( true, result ) end