PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` local bin = require "bin" local nmap = require "nmap" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Connects to Erlang Port Mapper Daemon (epmd) and retrieves a list of nodes with their respective port numbers. ]] --- -- @usage -- nmap -p 4369 --script epmd-info -- -- @output -- PORT STATE SERVICE -- 4369/tcp open epmd -- | epmd-info.nse: -- | epmd running on port 4369 -- | name rabbit at port 36804 -- |_ name ejabberd at port 46540 author = "Toni Ruottu" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = {"default", "discovery", "safe"} portrule = shortport.port_or_service (4369, "epmd") local NAMESREQ = 110 action = function(host, port) local socket = nmap.new_socket() local status, err = socket:connect(host.ip, port.number) if not status then return {} end local payload = bin.pack("C", NAMESREQ) local probe = bin.pack(">SA", #payload, payload) socket:send(probe) local status = true local data = "" local tmp = "" while status do data = data .. tmp status, tmp = socket:receive() end local pos, realport = bin.unpack(">I", data) local nodestring = string.sub(data, pos, -2) local nodes = stdnse.strsplit("\n", nodestring) local response = {} table.insert(response, 'epmd running on port ' .. realport) for _, node in ipairs(nodes) do table.insert(response, node) end return stdnse.format_output(true, response) end