mailing list archives
Re: brute.lua, unpwdb.lua, custom iterators and flexibility
From: David Fifield <david () bamsoftware com>
Date: Wed, 27 Jun 2012 08:47:41 -0700
On Wed, Jun 27, 2012 at 05:11:16PM +0200, Aleksandar Nikolic wrote:
I say "could be" because the current code for account_iterator has
if ( 'table' == type(users) and 'table' == type(pass) ) then
elseif ( 'function' == type(users) and 'function' == type(pass) ) then
This looks like it should be written more clearly anyway:
if 'table' == type(users) then
users = table_iterator(users)
if 'table' == type(pass) then
pass = table_iterator(pass)
unpwdb.closure is local but it shouldn't be. It should also have a
better name like, say, table_iterator.
This means that we can only specify an iterator with either both
usernames and passwords as tables or functions
and not , for example, table of usernames and iterator for passwords.
This could easily be expanded for more flexibility by adding two more
elseif blocks for remaining combinations.
Don't add two more cases; coerce everything to an iterator and then you
have just one case.
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/