local smb = require "smb" local smb2 = require "smb2" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ SMB2 test script ]] author = "Paulino Calderon" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"default", "discovery", "safe"} dependencies = {"smb-brute"} hostrule = function(host) return smb.get_port(host) ~= nil end local function init_conn(host) local state local status, smbstate local response = {} status, smbstate = smb2.start_ex(host, true, true, "\\\\192.168.0.5\\IPC$", nil, true) if(status == false) then return false, smbstate end end action = function(host) local response = stdnse.output_table() local status, result = init_conn(host) if(status == false) then return stdnse.format_output(false, result) end end