From 562ee68df0aea6e308e9b2cb234aa086f4176884 Mon Sep 17 00:00:00 2001 From: patrik Date: Sun, 20 Feb 2011 20:49:58 +0000 Subject: [PATCH] Applied patch recieved from Josh Amishav-Zlatin that addresses the problem with the 550 User Unkown message being handled incorrectly as described here: http://seclists.org/nmap-dev/2011/q1/585 http://seclists.org/nmap-dev/2011/q1/511 [Patrik] --- scripts/smtp-enum-users.nse | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/smtp-enum-users.nse b/scripts/smtp-enum-users.nse index 21ff13f0d..c1dda6d2c 100644 --- a/scripts/smtp-enum-users.nse +++ b/scripts/smtp-enum-users.nse @@ -58,7 +58,8 @@ STATUS_CODES = { ERROR = 1, NOTPERMITTED = 2, VALID = 3, - INVALID = 4 + INVALID = 4, + UNKNOWN = 5 } ---Counts the number of occurrences in a table. Helper function from LUA documentation @@ -288,6 +289,9 @@ function do_rcpt(socket, username, domain) if not status then return STATUS_CODES.ERROR, string.format("Failed to issue RCPT TO:<%s@%s> command (%s)", username, domain, response) + elseif string.match(response, "^550") then + -- 550 User Unknown + return STATUS_CODES.UNKNOWN elseif string.match(response, "^553") then -- 553 Relaying Denied return STATUS_CODES.NOTPERMITTED @@ -393,7 +397,7 @@ function go(host, port) elseif status == STATUS_CODES.AUTHENTICATION then quit(socket) return false, "Couldn't perform user enumeration, authentication needed" - else -- STATUS_CODES.INVALID + elseif status == STATUS_CODES.INVALID then table.insert(result, string.format("Method %s returned a unhandled status code.", method)) break end