diff --git a/CHANGELOG b/CHANGELOG index 22077f531..3bd7b4e68 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE] Added nfs-ls.nse, which lists NFS exported files with their + attributes. The nfs-acls and nfs-dirlist scripts were deleted + because all their features are supported by this script. [Djalal] + o Fixed the assignment of interface aliases to directly connected routes on Linux, which was broken in 5.30BETA1 (it always assigned the base interface instead of the alias). This was visible in the diff --git a/Makefile.in b/Makefile.in index d368c07fb..f5d046b46 100644 --- a/Makefile.in +++ b/Makefile.in @@ -382,9 +382,9 @@ anonFTP ASN brutePOP3 bruteTelnet chargenTest daytimeTest \ dns-safe-recursion-port dns-safe-recursion-txid dns-test-open-recursion \ echoTest ftpbounce HTTPAuth HTTP_open_proxy HTTPpasswd HTTPtrace \ iax2Detect ircServerInfo ircZombieTest MSSQLm MySQLinfo \ -netbios-smb-os-discovery popcapa PPTPversion promiscuous \ -RealVNC_auth_bypass ripeQuery robots showHTMLTitle showHTTPVersion \ -showOwner showSMTPVersion showSSHVersion skype_v2-version \ +netbios-smb-os-discovery nfs-acls nfs-dirlist popcapa PPTPversion \ +promiscuous RealVNC_auth_bypass ripeQuery robots showHTMLTitle \ +showHTTPVersion showOwner showSMTPVersion showSSHVersion skype_v2-version \ smb-enumdomains smb-enumsessions smb-enumshares smb-enumusers \ smb-serverstats smb-systeminfo SMTPcommands SMTP_openrelay_test \ SNMPcommunitybrute SNMPsysdescr SQLInject SSH-hostkey SSHv1-support \ diff --git a/scripts/nfs-acls.nse b/scripts/nfs-acls.nse deleted file mode 100644 index 486544bc5..000000000 --- a/scripts/nfs-acls.nse +++ /dev/null @@ -1,65 +0,0 @@ -description = [[ -Shows NFS exports and access controls. -]] - ---- --- @output --- PORT STATE SERVICE --- 111/tcp open rpcbind --- | nfs-acls: --- | /tmp --- | uid: 0; gid: 0; mode: drwxrwxrwx (1777) --- | /home/storage/backup --- | uid: 0; gid: 0; mode: drwxr-xr-x (755) --- | /home --- |_ uid: 0; gid: 0; mode: drwxr-xr-x (755) --- - --- Version 0.6 - --- Created 11/23/2009 - v0.1 - created by Patrik Karlsson --- Revised 11/24/2009 - v0.2 - added RPC query to find mountd ports --- Revised 11/24/2009 - v0.3 - added a hostrule instead of portrule --- Revised 11/26/2009 - v0.4 - reduced packet sizes and documented them --- Revised 01/24/2009 - v0.5 - complete rewrite, moved all NFS related code into nselib/nfs.lua --- Revised 02/22/2009 - v0.6 - adapted to support new RPC library - - -author = "Patrik Karlsson" -license = "Same as Nmap--See http://nmap.org/book/man-legal.html" -categories = {"discovery", "safe"} - -require("shortport") -require("rpc") - -portrule = shortport.port_or_service(111, "rpcbind", {"tcp", "udp"} ) - -action = function(host, port) - - local status, mounts, attribs - local result = {} - - status, mounts = rpc.Helper.ShowMounts( host, port ) - - if ( not(status) or mounts == nil ) then - return stdnse.format_output(false, mounts) - end - - for _, mount in ipairs( mounts ) do - local item = {} - status, attribs = rpc.Helper.GetAttributes( host, port, mount.name ) - - item.name = mount.name - - if ( status ) then - table.insert(item, ("uid: %d; gid: %d; mode: %s (%d)"):format(attribs.uid, attribs.gid, rpc.Util.ToAclText( attribs.mode ), rpc.Util.ToAclMode( attribs.mode )) ) - else - table.insert(item, string.format("ERROR: %s", attribs)) - end - - table.insert(result, item) - end - - return stdnse.format_output( true, result ) - -end diff --git a/scripts/nfs-dirlist.nse b/scripts/nfs-dirlist.nse deleted file mode 100644 index ee5577537..000000000 --- a/scripts/nfs-dirlist.nse +++ /dev/null @@ -1,91 +0,0 @@ -description = [[ -Does a directory listing of a remote NFS share -]] - ---- --- @output --- PORT STATE SERVICE --- 111/tcp open rpcbind --- | nfs-dirlist: --- | /home/storage/backup --- | www.cqure.net --- | /home --- | admin --- | lost+found --- | patrik --- | 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" -categories = {"discovery", "safe"} - -require("shortport") -require("rpc") - -portrule = shortport.port_or_service(111, "rpcbind", {"tcp", "udp"} ) - -action = function(host, port) - - local status, mounts - local result, files = {}, {} - local hasmore = false - local proto - - status, mounts = rpc.Helper.ShowMounts( host, port ) - - if ( not(status) ) then - return stdnse.format_output(false, mounts) - end - - for _, v in ipairs( mounts ) do - local files = {} - local status, dirlist = rpc.Helper.Dir(host, port, v.name) - - if status and dirlist then - local max_files = tonumber(nmap.registry.args['nfs-dirlist.maxfiles']) or 10 - - hasmore = false - for _, v in ipairs( dirlist.entries ) do - if ( ( 0 < max_files ) and ( #files >= max_files ) ) then - hasmore = true - break - end - - if v.name ~= ".." and v.name ~= "." then - table.insert(files, v.name) - end - end - - table.sort(files) - - if hasmore then - files.name = v.name .. string.format(" (Output limited to %d files, see nfs-dirlist.maxfiles)", max_files ) - else - files.name = v.name - end - - table.insert( result, files ) - else - files.name = v.name - table.insert(files, string.format("ERROR: %s",dirlist)) - table.insert( result, files ) - end - - end - - return stdnse.format_output( true, result ) - -end diff --git a/scripts/script.db b/scripts/script.db index 12f5e3c8e..3e70ad88c 100644 --- a/scripts/script.db +++ b/scripts/script.db @@ -72,8 +72,6 @@ Entry { filename = "mysql-info.nse", categories = { "default", "discovery", "saf Entry { filename = "mysql-users.nse", categories = { "discovery", "intrusive", } } Entry { filename = "mysql-variables.nse", categories = { "discovery", "intrusive", } } Entry { filename = "nbstat.nse", categories = { "default", "discovery", "safe", } } -Entry { filename = "nfs-acls.nse", categories = { "discovery", "safe", } } -Entry { filename = "nfs-dirlist.nse", categories = { "discovery", "safe", } } Entry { filename = "nfs-ls.nse", categories = { "discovery", "safe", } } Entry { filename = "nfs-showmount.nse", categories = { "discovery", "safe", } } Entry { filename = "nfs-statfs.nse", categories = { "discovery", "safe", } }