mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 17:59:04 +00:00
o [NSE] Changed http-brute so that it works against the root path
("/") by default rather than always requiring the http-brute.path
script argument.
I also upgraded it to use get_script_args function rather than access registry.args directly
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [NSE] Changed http-brute so that it works against the root path
|
||||||
|
("/") by default rather than always requiring the http-brute.path
|
||||||
|
script argument. [Fyodor]
|
||||||
|
|
||||||
o [NSE] Applied patch from Daniel Miller that fixes bug in several scripts and
|
o [NSE] Applied patch from Daniel Miller that fixes bug in several scripts and
|
||||||
libraries http://seclists.org/nmap-dev/2012/q2/593 [Daniel Miller]
|
libraries http://seclists.org/nmap-dev/2012/q2/593 [Daniel Miller]
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ local nmap = require "nmap"
|
|||||||
local shortport = require "shortport"
|
local shortport = require "shortport"
|
||||||
local string = require "string"
|
local string = require "string"
|
||||||
local table = require "table"
|
local table = require "table"
|
||||||
|
local stdnse = require "stdnse"
|
||||||
|
|
||||||
description = [[
|
description = [[
|
||||||
Performs brute force password auditing against http basic authentication.
|
Performs brute force password auditing against http basic authentication.
|
||||||
@@ -32,7 +33,7 @@ Performs brute force password auditing against http basic authentication.
|
|||||||
-- x The Driver class contains the driver implementation used by the brute
|
-- x The Driver class contains the driver implementation used by the brute
|
||||||
-- library
|
-- library
|
||||||
--
|
--
|
||||||
-- @args http-brute.path points to the path protected by authentication
|
-- @args http-brute.path points to the path protected by authentication (default: <code>/</code>.
|
||||||
-- @args http-brute.hostname sets the host header in case of virtual hosting
|
-- @args http-brute.hostname sets the host header in case of virtual hosting
|
||||||
-- @args http-brute.method sets the HTTP method to use (default <code>GET</code>)
|
-- @args http-brute.method sets the HTTP method to use (default <code>GET</code>)
|
||||||
|
|
||||||
@@ -54,9 +55,9 @@ Driver = {
|
|||||||
local o = {}
|
local o = {}
|
||||||
setmetatable(o, self)
|
setmetatable(o, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
o.host = nmap.registry.args['http-brute.hostname'] or host
|
o.host = stdnse.get_script_args("http-brute.hostname") or host
|
||||||
o.port = port
|
o.port = port
|
||||||
o.path = nmap.registry.args['http-brute.path']
|
o.path = stdnse.get_script_args("http-brute.path") or "/"
|
||||||
o.method = method
|
o.method = method
|
||||||
return o
|
return o
|
||||||
end,
|
end,
|
||||||
@@ -107,8 +108,8 @@ Driver = {
|
|||||||
|
|
||||||
action = function( host, port )
|
action = function( host, port )
|
||||||
local status, result
|
local status, result
|
||||||
local path = nmap.registry.args['http-brute.path']
|
local path = stdnse.get_script_args("http-brute.path") or "/"
|
||||||
local method = string.upper(nmap.registry.args['http-brute.method'] or "GET")
|
local method = string.upper(stdnse.get_script_args("http-brute.method") or "GET")
|
||||||
local engine = brute.Engine:new(Driver, host, port, method )
|
local engine = brute.Engine:new(Driver, host, port, method )
|
||||||
engine.options.script_name = SCRIPT_NAME
|
engine.options.script_name = SCRIPT_NAME
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user