簡單的metasploit程序

本程序是在《Metasoloit pentration tester user guide》p31的程序做來一定的修改,原書程序在BT5下無法運行。報“metasploit_the_pentration_tester_guide”,經過與

/opt/framework3/msf3/modules/auxiliary/scanner/http/open_proxy.rb 的程序進行對比後修改而成。
 

 

#Metasploit
require 'msf/core'

class Metasploit3 < Msf::Auxiliary

        include Msf::Exploit::Remote::Tcp
        include Msf::Auxiliary::Scanner

        def initialize(info = {})
                super(update_info(info,
                        'Name'          => 'My custom TCP scan',
                        'Version'       => '$Revision:1 $',
                        'Description'   => 'My quick scanner',
                        'Author'        => 'Metazhou',
                        'License'       => MSF_LICENSE
                ))

                register_options(
                        [
                                Opt::RPORT(12345)
                        ],self.class)
        end

        def run_host(ip)
                        connect()
                        sock.puts('HELLO SERVER')
                        data = sock.recv(1024)
                        print_status("Received: #{data} from #{ip}")
                        disconnect()
        end
end

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章