diff --git a/scripts/nfs-ls.nse b/scripts/nfs-ls.nse index 0dec40f6a..1e102b173 100644 --- a/scripts/nfs-ls.nse +++ b/scripts/nfs-ls.nse @@ -167,7 +167,13 @@ hostrule = function(host) end if mountport and nfsport then break end end - if nfsport == nil then return false end + -- Run when nfs and mount ports were scanned and their versions numbers known + if not (nfsport and (host.registry.nfs.nfsver or nfsport.version.version)) then + return false + end + if not (mountport and (host.registry.nfs.mountver or mountport.version.version)) then + return false + end if host.registry.nfs.nfsver == nil then local low, high = string.match(nfsport.version.version, "(%d)%-(%d)") if high == nil then @@ -185,7 +191,6 @@ hostrule = function(host) end end end - if mountport == nil then return false end if host.registry.nfs.mountver == nil then local low, high = string.match(mountport.version.version, "(%d)%-(%d)") if high == nil then diff --git a/scripts/nfs-statfs.nse b/scripts/nfs-statfs.nse index 8c7ffd6b6..a4477f966 100644 --- a/scripts/nfs-statfs.nse +++ b/scripts/nfs-statfs.nse @@ -68,7 +68,13 @@ hostrule = function(host) end if mountport and nfsport then break end end - if nfsport == nil then return false end + -- Run when nfs and mount ports were scanned and their versions numbers known + if not (nfsport and (host.registry.nfs.nfsver or nfsport.version.version)) then + return false + end + if not (mountport and (host.registry.nfs.mountver or mountport.version.version)) then + return false + end if host.registry.nfs.nfsver == nil then local low, high = string.match(nfsport.version.version, "(%d)%-(%d)") if high == nil then @@ -86,7 +92,6 @@ hostrule = function(host) end end end - if mountport == nil then return false end if host.registry.nfs.mountver == nil then local low, high = string.match(mountport.version.version, "(%d)%-(%d)") if high == nil then