id = "Service Banner" description = "Connects to all TCP services, and echos the response back." author = "Joshua D. Abraham " license = "See nmaps COPYING for licence" categories = {"jabra"} require "shortport" portrule = function(host, port) if (port.protocol == "tcp") then return true else return false end end action = function(host, port) local result, socket local catch = function() socket:close() end local try = nmap.new_try(catch) result = "" socket = nmap.new_socket() try(socket:connect(host.ip, port.number)) result = try(socket:receive_lines(1)); try(socket:close()) return "" .. string.gsub(result, "\n", "") end