<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                Metasploit框架提供了可讓你用于開發瀏覽器exploit的不同mixin,主要有[Msf::Exploit::Remote::HttpServer](https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-browser-exploit-using-HttpServer), Msf::Exploit::Remote::HttpServer::HTML and [Msf::Exploit::Remote::BrowserExploitServer](https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-browser-exploit-using-BrowserExploitServer). 這篇文章主要涵蓋HttpServer mixin. HttpServer mixin是所有HTTP服務器 mixin的母親(像 BrowserExploitServer 和 HttpServer::HTML).要使用它,你的模塊需要有一個“on_request_uri”方法,這個方法是HTTP服務器收到來自瀏覽器的HTTP請求時觸發的回調。設置“on_request_uri”的例子: ```ruby # # Listens for a HTTP request. # cli is the socket object, and request is a Rex::Proto::Http::Request object # def on_request_uri(cli, request) print_status("Client requests URI: #{request.uri}") end ``` “on_request_uri”方法也是您可以創建HTTP響應的地方。這里有幾個選擇可以用來做這一點: * **send_not_found(cli)** - 發送404到客戶端。確保傳遞cli(套接字)對象。 * **send_redirect(cli, location='/', body='', headers={})** - 將客戶端重定向到一個新的位置。 * **send_response(cli, body, headers={})** - 向客戶端發送響應。這種方法可能是你大部分時間使用的方法。 如果你看過我們的一些exploit模塊,你也可以使用Exploit::Remote::HttpServer::HTML 代替 Exploit::Remote::HttpServer.用法大多相同,區別在于Exploit::Remote::HttpServer::HTML mixin可以讓你訪問一些Javascript函數,如Base64,heap spraying,OS detection,等。 以下是發送HTTP響應的示例: ```ruby # # Sends a "Hello, world!" to the client # def on_request_uri(cli, request) html = "Hello, world!" send_response(cli, html) end ``` 另請注意,為了處理HTTP請求,它必須包含基本的URIPATH,默認情況下是隨機的。這意味著如果你想處理多個URI(如果你需要處理重定向或鏈接的話可能),你還需要確保它們具有基本的URIPATH。要檢索基本的URIPATH,可以使用“get_resource”方法,下面是一個例子: ```ruby def serve_page_1(cli) html = "This is page 1" send_response(cli, html) end def serve_page_2(cli) html = "This is page 2" send_response(cli, html) end def serve_default_page(cli) html = %Q| <html> <a href="#{get_resource.chomp('/')}/page_1.html">Go to page 1</a><br> <a href="#{get_resource.chomp('/')}/page_2.html">Go to page 2</a> </html> | send_response(cli, html) end def on_request_uri(cli, request) case request.uri when /page_1\.html$/ serve_page_1(cli) when /page_2\.html$/ serve_page_2(cli) else serve_default_page(cli) end end ``` 當然,當你編寫Metasploit瀏覽器漏洞的時候,還有很多需要考慮的東西。例如,您的模塊可能需要執行瀏覽器檢測,因為允許Chrome瀏覽器接收IE漏洞是沒有意義的。您可能還需要構建特定于目標的負載,這意味著您的模塊需要知道它的目標是什么,并且必須構建一個方法來相應地定制漏洞利用等。HttpServer和HttpServer::HTML mixin提供各種方法讓你完成所有這些。確保查看API文檔(可以通過運行msf / documentation / gendocs.sh,或者只是在msf目錄中運行“yard”)或者檢查現有的代碼示例(特別是最近的代碼示例)。 為了使事情開始,您可以始終使用以下模板開始開發瀏覽器利用: ```ruby ## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking include Msf::Exploit::Remote::HttpServer def initialize(info={}) super(update_info(info, 'Name' => "HttpServer mixin example", 'Description' => %q{ Here's an example of using the HttpServer mixin }, 'License' => MSF_LICENSE, 'Author' => [ 'sinn3r' ], 'References' => [ [ 'URL', 'http://metasploit.com' ] ], 'Platform' => 'win', 'Targets' => [ [ 'Generic', {} ], ], 'DisclosureDate' => "Apr 1 2013", 'DefaultTarget' => 0)) end def on_request_uri(cli, request) html = "hello" send_response(cli, html) end end ``` 如果你想仔細看看mixin可以做什么,請看 https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/exploit/http/server.rb
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看