<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                Metasploit框架提供了可讓你用于開發瀏覽器exploit的不同mixin,主要有: * **[Msf::Exploit::Remote::HttpServer](https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-browser-exploit-using-HttpServer)** - 一個最基本的http服務器 * **Msf::Exploit::Remote::HttpServer::HTML** - 這個模塊提供JavaScript函數在制作不同的html內容時能使用 * **[Msf::Exploit::Remote::BrowserExploitServer](https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-browser-exploit-using-BrowserExploitServer)** - 包括來自HttpServer和HttpServer :: HTML的功能,但還有更多的好東西。這篇文章涵蓋了 [BrowserExploitServer](https://rapid7.github.io/metasploit-framework/Msf/Exploit/Remote/BrowserExploitServer.html) mixin. ### 自動開發程序 BrowserExploitServer mixin是唯一專門為瀏覽器開發的mixin。在使用這個mixin之前,你應該明白它在背后的作用: 1.它會自動收集瀏覽器信息,包括:操作系統名稱,版本,瀏覽器名稱,瀏覽器版本,是否使用代理,Java插件版本,Microsoft Office版本等。如果瀏覽器沒有啟用Javascript,那么它對目標知道的很少。收集的所有信息將存儲在由mixin管理的配置文件中。 2.然后mixin會標記瀏覽器來跟蹤會話。它也將使用相同的標簽來檢索需要的配置文件。 3.在mixin決定是否應該向瀏覽器使用exploit之前,它會檢查模塊是否有任何可exploit的條件。如果不符合條件,則會向瀏覽器發送一個404,放棄操作 4.如果滿足要求,mixin會將該配置文件(在檢測階段收集的瀏覽器信息)傳遞給模塊,然后讓其接管其余部分。 提示:在模塊中,您可以檢查配置文件中的`:source`鍵以確定是否啟用Javascript:如果:source是“script”,則意味著啟用了Javascript。如果是“headers”(如HTTP標頭),那么瀏覽器禁用Javascript。 ### 設置可exploit要求 能夠設置瀏覽器的要求是mixin的一個重要特性。它可以讓你的攻擊更聰明,更有針對性,并防止事故發生。這里有一個場景:假設你有一個針對Internet Explorer的漏洞,它只影響特定范圍的MSHTML構建,你可以設置:os_name, :ua_name, :ua_ver, and :mshtml_build 來確保它不會盲目的exploit其他東西.:mshtml_build要求可以在MSHTML文件屬性下的“產品版本”中找到。 可利用的瀏覽器要求在模塊元數據的“BrowserRequirements”下定義。以下是定義運行某個ActiveX控件的易受攻擊目標的示例: ```ruby 'BrowserRequirements' => { source: /script/i, activex: [ { clsid: '{D27CDB6E-AE6D-11cf-96B8-444553540000}', method: 'LoadMovie' } ], os_name: /win/i } ``` 您也可以定義目標特定的要求。這也是mixin能夠自動選擇一個目標的方式,你可以用“get_target”方法得到它。下面是一個例子,說明如何定義目標特定的要求,在Win XP上的IE8,在Win 7上的IE 9 : ```ruby 'BrowserRequirements' => { :source => /script|headers/i, 'ua_name' => HttpClients::IE, }, 'Targets' => [ [ 'Automatic', {} ], [ 'Windows XP with IE 8', { :os_name => 'Windows XP', 'ua_ver' => '8.0', 'Rop' => true, 'Offset' => 0x100 } ], [ 'Windows 7 with IE 9', { 'os_name' => 'Windows 7', 'ua_ver' => '9.0', 'Rop' => true, 'Offset' => 0x200 } ] ] ``` 你可以使用這些 **:os_name**: | Constant | Purpose | | -------- | ----- | | OperatingSystems::Match::WINDOWS | Match all versions of Windows | | OperatingSystems::Match::WINDOWS_95 | Match Windows 95 | | OperatingSystems::Match::WINDOWS_98 | Match Windows 98 | | OperatingSystems::Match::WINDOWS_ME | Match Windows ME | | OperatingSystems::Match::WINDOWS_NT3 | Match Windows NT 3 | | OperatingSystems::Match::WINDOWS_NT4 | Match Windows NT 4 | | OperatingSystems::Match::WINDOWS_2000 | Match Windows 2000 | | OperatingSystems::Match::WINDOWS_XP | Match Windows XP | | OperatingSystems::Match::WINDOWS_2003 | Match Windows Server 2003 | | OperatingSystems::Match::WINDOWS_VISTA | Match Windows Vista | | OperatingSystems::Match::WINDOWS_2008 | Match Windows Server 2008 | | OperatingSystems::Match::WINDOWS_7 | Match Windows 7 | | OperatingSystems::Match::WINDOWS_2012 | Match Windows 2012 | | OperatingSystems::Match::WINDOWS_8 | Match Windows 8 | | OperatingSystems::Match::WINDOWS_81 | Match Windows 8.1 | | OperatingSystems::Match::LINUX | Match a Linux distro | | OperatingSystems::Match::MAC_OSX | Match Mac OSX | | OperatingSystems::Match::FREEBSD | Match FreeBSD | | OperatingSystems::Match::NETBSD | Match NetBSD | | OperatingSystems::Match::OPENBSD | Match OpenBSD | | OperatingSystems::Match::VMWARE | Match VMWare | | OperatingSystems::Match::ANDROID | Match Android | | OperatingSystems::Match::APPLE_IOS | Match Apple IOS | 你能使用這些 **:ua_name**: | Constant | Value | | -------- | ----- | | HttpClients::IE | "MSIE" | | HttpClients::FF | "Firefox" | | HttpClients::SAFARI | "Safari" | | HttpClients::OPERA | "Opera" | | HttpClients::CHROME | "Chrome" | 更多這些常量可以在這里找到:https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/constants.rb 全部現在mixin支持的要求可以在這找到(查看 REQUIREMENT_KEY_SET)) https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/exploit/remote/browser_exploit_server.rb#L46 ### 設置一個監聽器 在檢測階段和需求檢查之后,mixin將觸發“on_request_exploit”回調方法,這就是您處理HTTP請求,制作HTML并返回漏洞響應的地方。這里是一個如何設置“on_request_exploit”的例子: ```ruby # # Listens for the HTTP request # cli is the socket # request is the Rex::Proto::Http::Request object # target_info is a hash that contains all the browser info (aka the profile) # def on_request_exploit(cli, request, target_info) print_status("Here's what I know about the target: #{target_info.inspect}") end ``` ### 使用BrowserExploitServer構建HTML BrowserExploitServer mixin支持兩種編碼風格:好的舊的HTML或[ERB](http://ruby-doc.org/stdlib-2.1.3/libdoc/erb/rdoc/ERB.html)模板。首先是不言自明的: ```ruby def on_request_exploit(cli, request, target_info) html = %Q| <html> Hello, world! </html> | send_exploit_html(cli, html) end ``` [ERB](http://ruby-doc.org/stdlib-2.1.3/libdoc/erb/rdoc/ERB.html) 是一種編寫Metasploit瀏覽器漏洞的新方法。如果你已經寫了一個或兩個Web應用程序,這對你來說并不陌生。當您使用BrowserExploitServer mixin編寫漏洞利用程序時,真正發生的是您正在編寫一個rails模板。以下是使用此功能的示例: ```ruby def on_request_exploit(cli, request, target_info) html = %Q| <html> Do you feel lucky, punk?<br> <% if [true, false].sample %> Lucky!<br> <% else %> Bad luck, bro!<Br> <% end %> </html> | send_exploit_html(cli, html) end ``` 如果要訪問局部變量或參數,請確保將綁定對象傳遞給send_exploit_html: ```ruby def exploit_template1(target_info, txt) txt2 = "I can use local vars!" template = %Q| <% msg = "This page is generated by an exploit" %> <%=msg%><br> <%=txt%><br> <%=txt2%><br> <p></p> Data gathered from source: #{target_info[:source]}<br> OS name: #{target_info[:os_name]}<br> UA name: #{target_info[:ua_name]}<br> UA version: #{target_info[:ua_ver]}<br> Java version: #{target_info[:java]}<br> Office version: #{target_info[:office]} | return template, binding() end def on_request_exploit(cli, request, target_info) send_exploit_html(cli, exploit_template(target_info, txt)) end ``` BrowserExploitServer mixin在制作exploit的同時還提供了許多其他有用的東西。例如:當您調用“get_payload”方法時,它可以生成特定于目標的有效內容。它還使您可以訪問RopDb mixin,其中包含一組ROP以繞過DEP(數據執行保護)。請務必查看API文檔以獲取更多信息。 為了得到一個開始,下面是一個可以使用的代碼示例,開始開發瀏覽器漏洞: ```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::BrowserExploitServer def initialize(info={}) super(update_info(info, 'Name' => "BrowserExploitServer Example", 'Description' => %q{ This is an example of building a browser exploit using the BrowserExploitServer mixin }, 'License' => MSF_LICENSE, 'Author' => [ 'sinn3r' ], 'References' => [ [ 'URL', 'http://metasploit.com' ] ], 'Platform' => 'win', 'BrowserRequirements' => { :source => /script|headers/i, }, 'Targets' => [ [ 'Automatic', {} ], [ 'Windows XP with IE 8', { 'os_name' => 'Windows XP', 'ua_name' => 'MSIE', 'ua_ver' => '8.0' } ], [ 'Windows 7 with IE 9', { 'os_name' => 'Windows 7', 'ua_name' => 'MSIE', 'ua_ver' => '9.0' } ] ], 'Payload' => { 'BadChars' => "\x00" }, 'DisclosureDate' => "Apr 1 2013", 'DefaultTarget' => 0)) end def exploit_template(target_info) template = %Q| Data source: <%=target_info[:source]%><br> OS name: <%=target_info[:os_name]%><br> UA name: <%=target_info[:ua_name]%><br> UA version: <%=target_info[:ua_ver]%><br> Java version: <%=target_info[:java]%><br> Office version: <%=target_info[:office]%> | return template, binding() end def on_request_exploit(cli, request, target_info) send_exploit_html(cli, exploit_template(target_info)) end end ``` ### JavaScript 混淆 BrowserExploitServer依靠JSObfu mixin來支持JavaScript混淆。在編寫JavaScript時,應該總是這樣寫: ```ruby js = js_obfuscate(your_code) ``` 該#js_obfuscate會返回一個Rex::Exploitation::JSObfu對象。要獲得混淆的JavaScript,請調用以下#to_s方法: ```ruby js.to_s ``` 如果您需要訪問混淆的符號名稱,則可以使用#sym方法 ```ruby # Get the obfuscated version of function name test() var_name = js.sym('test') ``` 請注意,即使您的模塊正在調用#js_obfuscate方法,默認情況下,除非用戶設置JsObfuscate數據存儲選項,否則混淆不會啟動。此選項是一個OptInt,它允許您設置混淆次數(默認值為0)。 ```ruby deregister_options('JsObfuscate') ``` 如果您的基于BES的攻擊根本不需要混淆,請務必調用#deregister_options并移除JsObfuscate選項。像這樣: ```ruby deregister_options('JsObfuscate') ``` 要了解有關Metasploit的JavaScript混淆功能的更多信息,請閱讀[How to obfuscate JavaScript in Metasploit](https://github.com/rapid7/metasploit-framework/wiki/How-to-obfuscate-JavaScript-in-Metasploit). ### 相關文章 * https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-browser-exploit-using-HttpServer * https://github.com/rapid7/metasploit-framework/wiki/Information-About-Unmet-Browser-Exploit-Requirements
                  <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>

                              哎呀哎呀视频在线观看