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

Brute and unpwdb lib improvements that allow more flexible iterator specifications. Merge from my dev branch.

This commit is contained in:
aca
2012-07-10 16:35:48 +00:00
parent 6dd99f410b
commit c6ed7023c4
5 changed files with 114 additions and 58 deletions

View File

@@ -31,8 +31,10 @@ With knowledge of the correct repository name, usernames and passwords can be gu
-- @args cvs-brute-repository.repofile a file containing a list of repositories
-- to guess
-- Version 0.1
-- Version 0.2
-- Created 07/13/2010 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
-- Revised 08/07/2012 - v0.2 - revised to suit the changes in brute
-- library [Aleksandar Nikolic]
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
@@ -102,7 +104,7 @@ action = function(host, port)
end
end
local repository_iterator = function()
repository_iterator = function()
local function next_repo()
for line in f:lines() do
if ( not(line:match("#!comment")) ) then
@@ -119,8 +121,8 @@ action = function(host, port)
engine.options.passonly = true
engine.options.firstonly = false
engine.options.nostore = true
engine:addIterator(brute.Iterators.account_iterator({""}, repos, "user"))
if ( repofile ) then engine:addIterator(repository_iterator()) end
engine.iterator = brute.Iterators.account_iterator({""}, repos, "user")
if ( repofile ) then engine.iterator = unpwdb.concat_iterators(engine.iterator,repository_iterator()) end
status, result = engine:start()
return result

View File

@@ -57,6 +57,8 @@ result in a large number of accounts being locked out on the database server.
-- changed code to use ConnectionPool
-- Revised 03/13/2012 - v0.4 - revised by László Tóth
-- added support for SYSDBA accounts
-- Revised 08/07/2012 - v0.5 - revised to suit the changes in brute
-- library [Aleksandar Nikolic]
--
-- Summary
@@ -213,7 +215,7 @@ action = function(host, port)
return ("\n ERROR: Failed to open %s"):format(DEFAULT_ACCOUNTS)
end
engine:addIterator(brute.Iterators.credential_iterator(f))
engine.iterator = brute.Iterators.credential_iterator(f)
end
engine.options.script_name = SCRIPT_NAME