From 2c8d24b5576711106a2ecbb1b3f89ade7ef746b6 Mon Sep 17 00:00:00 2001 From: tomsellers Date: Sun, 11 Sep 2011 11:49:28 +0000 Subject: [PATCH] Added error handling to catch and gracefully handle error when script was called via category instead of explicitly. The error was due to the backorifice-brute.ports script arg not being specified and the script trying to concat the value (nil). --- scripts/backorifice-brute.nse | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/backorifice-brute.nse b/scripts/backorifice-brute.nse index 486d45954..36f21608e 100644 --- a/scripts/backorifice-brute.nse +++ b/scripts/backorifice-brute.nse @@ -20,7 +20,7 @@ the script against). -- 31337/udp open BackOrifice -- | backorifice-brute: -- | Accounts: --- | michael => Login correct +-- | michael => Valid credentials -- | Statistics -- |_ Perfomed 60023 guesses in 467 seconds, average tps: 138 -- @@ -47,7 +47,13 @@ require("creds") -- This portrule succeeds only when the open|filtered port is in the port range -- which is specified by the ports script argument portrule = function(host, port) + if not stdnse.get_script_args(SCRIPT_NAME .. ".ports") then + stdnse.print_debug(3,"Skipping '%s' %s, 'ports' argument is missing.",SCRIPT_NAME, SCRIPT_TYPE) + return false + end + local ports = stdnse.get_script_args(SCRIPT_NAME .. ".ports") + --print out a debug message if port 31337/udp is open if port.number==31337 and port.protocol == "udp" and not(ports) then stdnse.print_debug("Port 31337/udp is open. Possibility of version detection and password bruteforcing using the backorifice-brute script")