From 6c864bd9f86498f69e9a9789a7535f8c6073adb4 Mon Sep 17 00:00:00 2001 From: patrik Date: Fri, 2 Sep 2011 06:12:39 +0000 Subject: [PATCH] Changed command line processing to assume cred mode if credfile was supplied and no mode was explicitly given [Patrik] --- nselib/brute.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nselib/brute.lua b/nselib/brute.lua index 9a7f22495..ce498667f 100644 --- a/nselib/brute.lua +++ b/nselib/brute.lua @@ -621,6 +621,15 @@ Engine = local mode = self.options.mode or stdnse.get_script_args("brute.mode") + -- if no mode was given, but a credfile is present, assume creds mode + if ( not(mode) and stdnse.get_script_args("brute.credfile") ) then + if ( stdnse.get_script_args("userdb") or + stdnse.get_script_args("passdb") ) then + return false, "\n ERROR: brute.credfile can't be used in combination with userdb/passdb" + end + mode = 'creds' + end + -- Are we guessing against a service that has no username (eg. VNC) if ( self.options.passonly ) then local function single_user_iter(next)