From 1961eed908c13f47bfefa8ff728bee553358c8f8 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 15 Jul 2009 14:54:03 +0000 Subject: [PATCH] Use CRLF, not just LF, in auth-owners.nse. Send CRLF in the request and strip it from the response. Previously only LF was stripped from the response so each user name had a CR at the end of it (invisible in the terminal). --- scripts/auth-owners.nse | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/auth-owners.nse b/scripts/auth-owners.nse index 5ff85d213..8082bb0b4 100644 --- a/scripts/auth-owners.nse +++ b/scripts/auth-owners.nse @@ -19,6 +19,7 @@ Attempts to find the owner of an open TCP port by querying an auth -- 5666/tcp open unknown -- |_ auth-owners: root +-- The protocol is documented in RFC 1413. author = "Diman Todorov " @@ -55,7 +56,7 @@ action = function(host, port) local localip, localport, remoteip, remoteport = try(client_service:get_info()) - local request = port.number .. ", " .. localport .. "\n" + local request = port.number .. ", " .. localport .. "\r\n" try(client_ident:send(request)) @@ -64,7 +65,7 @@ action = function(host, port) if string.match(owner, "ERROR") then owner = nil else - owner = string.match(owner, "USERID : .+ : (.+)\n", 1) + owner = string.match(owner, "USERID : .+ : (.-)\r?\n", 1) end try(client_ident:close())