1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-03 03:59:02 +00:00

Convert brute threads script-args to number. Closes #627

This commit is contained in:
dmiller
2016-12-28 16:57:11 +00:00
parent 6b89782c8e
commit 3961450aad
5 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
# Nmap Changelog ($Id$); -*-text-*-
o [NSE][GH#627] Fixed script hang in several brute scripts due to the "threads"
script-arg not being converted to a number. Error message was
"nselib/brute.lua:1188: attempt to compare number with string" [Arne Beer]
Nmap 7.40 [2016-12-20]
o [Windows] Updated the bundled Npcap from 0.10r9 to 0.78r5, with an

View File

@@ -137,7 +137,7 @@ action = function( host, port )
local status, result, engine
local uservar = stdnse.get_script_args('http-joomla-brute.uservar') or DEFAULT_JOOMLA_USERVAR
local passvar = stdnse.get_script_args('http-joomla-brute.passvar') or DEFAULT_JOOMLA_PASSVAR
local thread_num = stdnse.get_script_args("http-joomla-brute.threads") or DEFAULT_THREAD_NUM
local thread_num = tonumber(stdnse.get_script_args("http-joomla-brute.threads")) or DEFAULT_THREAD_NUM
engine = brute.Engine:new( Driver, host, port, { uservar = uservar, passvar = passvar } )
engine:setMaxThreads(thread_num)

View File

@@ -131,7 +131,7 @@ action = function( host, port )
local status, result, engine
local uservar = stdnse.get_script_args('http-wordpress-brute.uservar') or DEFAULT_WP_USERVAR
local passvar = stdnse.get_script_args('http-wordpress-brute.passvar') or DEFAULT_WP_PASSVAR
local thread_num = stdnse.get_script_args("http-wordpress-brute.threads") or DEFAULT_THREAD_NUM
local thread_num = tonumber(stdnse.get_script_args("http-wordpress-brute.threads")) or DEFAULT_THREAD_NUM
engine = brute.Engine:new( Driver, host, port, { uservar = uservar, passvar = passvar } )
engine:setMaxThreads(thread_num)

View File

@@ -90,7 +90,7 @@ Driver =
}
action = function(host, port)
local thread_num = stdnse.get_script_args(SCRIPT_NAME..".threads") or 1
local thread_num = tonumber(stdnse.get_script_args(SCRIPT_NAME..".threads")) or 1
local options = {timeout = 5000}
local bengine = brute.Engine:new(Driver, host, port, options)

View File

@@ -33,7 +33,7 @@ portrule = shortport.port_or_service(8834, "ssl/http", "tcp")
local arg_timeout = stdnse.parse_timespec(stdnse.get_script_args(SCRIPT_NAME..'.timeout'))
arg_timeout = (arg_timeout or 5) * 1000
local arg_threads = stdnse.get_script_args("nessus-xmlrpc-brute.threads")
local arg_threads = tonumber(stdnse.get_script_args("nessus-xmlrpc-brute.threads"))
local function authenticate(host, port, username, password)
local post_data = ("login=%s&password=%s"):format(username, password)