From 885fdfbc245b3d78a94995990b357dc1afdfe5c4 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 28 Oct 2015 16:13:43 +0000 Subject: [PATCH] Handle t3 services which echo the version we send. Fixes #203 --- scripts/weblogic-t3-info.nse | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/weblogic-t3-info.nse b/scripts/weblogic-t3-info.nse index 9c07f726d..97622a127 100644 --- a/scripts/weblogic-t3-info.nse +++ b/scripts/weblogic-t3-info.nse @@ -34,9 +34,22 @@ action = function(host, port) extrainfo = extrainfo .. "; " end if weblogic_version then - port.version.version = weblogic_version + if weblogic_version == "12.1.2" then + status, result = comm.exchange(host, port, + "t3 11.1.2\nAS:2048\nHL:19\n\n") + weblogic_version = string.match(result, "^HELO:(%d+%.%d+%.%d+%.%d+)%.") + if weblogic_version == "11.1.2" then + -- Server just echoes whatever version we send. + rval = "T3 protocol in use (Unknown WebLogic version)" + else + port.version.version = weblogic_version + rval = "T3 protocol in use (WebLogic version: " .. weblogic_version .. ")" + end + else + port.version.version = weblogic_version + rval = "T3 protocol in use (WebLogic version: " .. weblogic_version .. ")" + end port.version.extrainfo = extrainfo .. "T3 enabled" - rval = "T3 protocol in use (WebLogic version: " .. weblogic_version .. ")" elseif string.match(result, "^LGIN:") then port.version.extrainfo = extrainfo .. "T3 enabled" rval = "T3 protocol in use (handshake failed)" @@ -53,6 +66,10 @@ action = function(host, port) port.version.extrainfo = extrainfo .. "T3 enabled" rval = "T3 protocol in use (No resource)" elseif string.match(result, "^VERS:") then + weblogic_version = string.match(result, "^VERS:Incompatible versions %- this server:(%d+%.%d+%.%d+%.%d+)") + if weblogic_version then + port.version.version = weblogic_version + end port.version.extrainfo = extrainfo .. "T3 enabled" rval = "T3 protocol in use (Incompatible version)" elseif string.match(result, "^CATA:") then