diff --git a/CHANGELOG b/CHANGELOG index 036d895a7..89bb70026 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ [NOT YET RELEASED] +o [NSE] Changed and documented the name of the maxfiles argument used + to limit output in the nfs-dirlist script. + o Fixed reading of the interface table on NetBSD. Running nmap --iflist would report "INTERFACES: NONE FOUND(!)" and any scan done as root would fail with "WARNING: Unable to find appropriate diff --git a/scripts/nfs-dirlist.nse b/scripts/nfs-dirlist.nse index 79d222158..6575c1409 100644 --- a/scripts/nfs-dirlist.nse +++ b/scripts/nfs-dirlist.nse @@ -16,13 +16,17 @@ Does a directory listing of a remote NFS share -- | storage -- |_ web -- +-- @args nfs-dirlist.maxfiles If set limits the amount of files returned by the +-- script for each export. If set to zero or less all files are shown. +-- (default 10) + -- Version 0.3 -- -- Created 01/25/2010 - v0.1 - created by Patrik Karlsson -- Revised 02/22/2010 - v0.2 - adapted to support new RPC library -- Revised 03/13/2010 - v0.3 - converted host to port rule - +-- Revised 03/28/2010 - v0.4 - changed and documented maxfiles argument author = "Patrik Karlsson" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" @@ -51,10 +55,11 @@ action = function(host, port) local status, dirlist = rpc.Helper.Dir(host, port, v.name) if status and dirlist then - local max_files = tonumber(nmap.registry.args.nfs_max_files) or 10 + local max_files = tonumber(nmap.registry.args['nfs-dirlist.maxfiles']) or 10 + hasmore = false for _, v in ipairs( dirlist.entries ) do - if #files >= max_files then + if ( ( 0 < max_files ) and ( #files >= max_files ) ) then hasmore = true break end