From c7e8e225a9d16a3e3e332f5770a3e848bd43b581 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 11 Aug 2007 03:30:17 +0000 Subject: [PATCH] merge soc07 r4798 - Attempts to connect to a hosts finger service and extracts a list of usernames --- scripts/finger.nse | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/finger.nse diff --git a/scripts/finger.nse b/scripts/finger.nse new file mode 100644 index 000000000..0db1a8efd --- /dev/null +++ b/scripts/finger.nse @@ -0,0 +1,44 @@ +id="Finger Results" + +description="attempts to get a list of usernames via the finger service" + +author = "Eddie Bell " + +license = "See nmaps COPYING for licence" + +categories = {"discovery"} + +portrule = function(host, port) + if (port.number == 79 + or port.service == "finger") + and port.protocol == "tcp" + and port.state == "open" + then + return true + else + return false + end +end + +action = function(host, port) + local socket = nmap.new_socket() + local results = "" + local status = true + + local err_catch = function() + socket:close() + end + + local try = nmap.new_try(err_catch()) + + socket:set_timeout(5000) + try(socket:connect(host.ip, port.number, port.protocol)) + try(socket:send("\n\r")) + + status, results = socket:receive_lines(100) + socket:close() + + if status then + return results + end +end