Library unpwdb
Username/password database library.
The usernames and passwords functions return
multiple values for use with exception handling via
nmap.new_try. The first value is the Boolean success
indicator, the second value is the closure.
The closures can take an argument of "reset" to rewind the list
to the beginning.
You can select your own username and/or password database to read from with
the script arguments userdb and passdb,
respectively. Comments are allowed in these files, prefixed with
"#!comment:". Comments cannot be on the same line as a
username or password because this leaves too much ambiguity, e.g. does the
password in "mypass #!comment: blah" contain a space, two
spaces, or do they just separate the password from the comment?
Author:
| Kris Katterjohn 06/2008 |
Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html
Source: http://nmap.org/svn/nselib/unpwdb.lua
Script Arguments
userdb
The filename of an alternate username database.
passdb
The filename of an alternate password database.
Functions
| passwords () |
Returns a function closure which returns a new password with every call
until the password list is exhausted (in which case it returns
|
| timelimit () |
Returns the suggested number of seconds to attempt a brute force attack,
based on Nmap's timing values ( |
| usernames () |
Returns a function closure which returns a new username with every call
until the username list is exhausted (in which case it returns
|
Functions
- passwords ()
-
Returns a function closure which returns a new password with every call until the password list is exhausted (in which case it returns
nil).Return values:
- boolean Status.
- function The passwords iterator.
- timelimit ()
-
Returns the suggested number of seconds to attempt a brute force attack, based on Nmap's timing values (
-T4etc.) and whether or not a user-defined list is used.You can use the script argument
notimelimitto make this function returnnil, which means the brute-force should run until the list is empty. Ifnotimelimitis not used, be sure to still check fornilreturn values on the above two functions in case you finish before the time limit is up. - usernames ()
-
Returns a function closure which returns a new username with every call until the username list is exhausted (in which case it returns
nil).Return values:
- boolean Status.
- function The usernames iterator.




