smb-shares-size in port script

This commit is contained in:
2023-05-12 02:40:34 +02:00
parent 1e26473930
commit bc04ce19a7
3 changed files with 25 additions and 18 deletions

View File

@ -20,7 +20,6 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
portrule = shortport.service({"http", "https", "ssl"})
local http = require "http"
local stdnse = require "stdnse"

View File

@ -1,7 +1,8 @@
local stdnse = require "stdnse"
local smb = require "smb"
local msrpc = require "msrpc"
local bin = require "bin"
local stdnse = require "stdnse"
local smb = require "smb"
local msrpc = require "msrpc"
local bin = require "bin"
local shortport = require "shortport"
description = [[
Return free and total size in octets of each SMB shares
@ -25,9 +26,8 @@ categories = {"discovery", "intrusive"}
author = "Adrien Malingrey"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
hostrule = function(host)
return smb.get_port(host) ~= nil
end
portrule = shortport.service({"microsoft-ds", "netbios-ssn", "smb"})
action = function(host)
local status, shares, extra