diff --git a/nselib/brute.lua b/nselib/brute.lua index d2c52e819..527c99af6 100644 --- a/nselib/brute.lua +++ b/nselib/brute.lua @@ -651,6 +651,13 @@ Engine = local usernames = self.usernames local passwords = self.passwords + if ( "function" ~= type(usernames) ) then + return false, "Invalid usernames iterator" + end + if ( "function" ~= type(passwords) ) then + return false, "Invalid passwords iterator" + end + 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