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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 如何開始寫一個post模塊 post模塊開發對您的編程技能是一個挑戰。這不像寫一個基于內存損壞的攻擊,從技術上說,通常是制造惡意輸入 - 一個字符串。post模塊更多的是關于正確的模塊設計,Ruby和Metasploit庫的實用知識。這也是一個非常有價值的技能,因為如果在彈出一個shell之后你不知道該怎么做,滲透測試的重點是什么? 另外,如果一個模塊不工作?你是否愿意等待幾天,幾周甚至幾個月的時間讓其他人為你解決?可能不會。如果你自己知道該怎么做,那么你可以更早地修復它,繼續你的滲透,做更多的事情。所以學習post模塊開發!這對你和你的事業都有好處 ### 計劃你的模塊 就像編寫一個軟件一樣,在你開始寫代碼之前,你應該有一個清晰明確的目標,就是你的post模塊做什么。在單個模塊中具有多個功能從來就不是一個好主意。 例如:盜取網絡配置文件,竊取密碼,哈希值,shell歷史記錄等。相反,您應該將其分解為多個模塊。 您還應該考慮要支持的會話類型:meterpreter或shell。理想情況下,兩者都支持。但是如果你必須在兩者之間進行選擇,那么在Windows上你應該選擇Windows Meterpreter。在Linux上,shell會話類型比Linux Meterpreter更為強大,但希望在不久的將來會改變。對于沒有Meterpreter的平臺,顯然你唯一的選擇是一個shell。 另一個重要的事情是考慮你的模塊如何在不同的發行版/系統上執行。例如你想在linux運行一個`ifconfig`命令.在ubuntu只需要簡單的運行`ifconfig`就可以了.但是在不同的linux發行版可能不知道你在做什么.所以你必須更具體一些,而不是直接`/sbin/ifconfig`。 是`C:\WINDOWS\`還是`C:\WinNT`?這是兩個,是不是`C:\Documents and Settings\[User name]`或者`C:\Users\[User name]`.都取決與window版本.更好的解決方案是使用環境變量 總是做你的準備,,并包含你可以想到的場景。而最重要的是,讓你的虛擬機測試 ### post模塊的類別 post模塊根據其行為進行分類。例如,如果收集數據,自然會進入`gather`類別。如果它添加/更新/或刪除用戶,它屬于`manage`。這里有一個列表作為參考: | 類別 | 描述 | | --- | --- | | gather | 涉及數據收集/收集/枚舉的模塊。 | | gather/credentials | 竊取憑據的模塊。 | | gather/forensics | 涉及取證數據收集的模塊。 | | manage | 修改/操作/操作系統上的某些東西的模塊。會話管理相關的任務,如遷移,注入也在這里。 | | recon | 這些模塊將幫助您在偵察方面了解更多的系統信息,而不是關于數據竊取。了解這與`gather`類型模塊不一樣。 | | wlan | 用于WLAN相關任務的模塊。 | | escalate | 這是不贊成的,但由于受歡迎,模塊仍然在那里。這曾經是特權升級模塊的地方。所有權限升級模塊不再被視為后期模塊,它們現在是exploit。 | | capture | 涉及監控數據收集的模塊。例如:密鑰記錄。 | ### 會話對象 所以你知道魔戒怎么樣,人們完全沉迷于一環?那么,這就是會話對象,你不能沒有的一個對象.所有的post模塊和其他相關的mixin基本上都是建立在會話對象之上的,因為它知道被入侵主機的所有信息,并允許你命令它。 您可以使用該`session`方法來訪問會話對象或其別名`client`。與irb交互的最佳方式是通過`irb`命令,以下是一個例子: ~~~ msf exploit(handler) > run [*] Started reverse handler on 192.168.1.64:4444 [*] Starting the payload handler... [*] Sending stage (769536 bytes) to 192.168.1.106 [*] Meterpreter session 1 opened (192.168.1.64:4444 -> 192.168.1.106:55157) at 2014-07-31 17:59:36 -0500 meterpreter > irb [*] Starting IRB shell [*] The 'client' variable holds the meterpreter client >> session.class => Msf::Sessions::Meterpreter_x86_Win ~~~ 在這一點上,你有權力使用他們。但請注意,上面的例子是一個Msf::Sessions::Meterpreter_x86_Win對象。實際上還有幾個不同的東西:command_shell.rb,meterpreter_php.rb,meterpreter_java.rb,meterpreter_x86_linux.rb等等。每個行為都有所不同,所以實際上很難解釋它們,但是它們是在lib/msf/base/sessions/ 目錄下,所以你是可以看到它們是怎么工作的,或者你可以試一下因為你已經在irb命令行了. 在ruby有兩個方便調試對象目的的對象方法.第一個是`methods`,它將會列出對象中全部公開和受防護的方法. ~~~ session.methods ~~~ 另一個是inspect,它返回一個對象的人類可讀的字符串: ~~~ session.inspect ~~~ 您還可以查看[其他當前的post模塊](https://github.com/rapid7/metasploit-framework/tree/master/modules/post),并查看他們如何使用其會話對象。 ### Msf::Post Mixin 正如我們所解釋的,大多數post模塊mixin是建立在會話對象之上的,而且它還有很多。但是,有一個你顯然不能沒有的一個`Msf::Post `.mixin。當你用這個mixin創建一個post模塊時,很多其他的mixin也已經包含在各種場景中,更具體一些: * msf/core/post/common - post模塊使用的通用方法,例如`cmd_exec` * msf/core/post_mixin - 跟蹤會話狀態。 * msf/core/post/file - 文件系統相關的方法 * msf/core/post/webrtc - 使用WebRTC與目標機器的攝像頭進行交互 * msf/core/post/linux - 通常不是很多在這, 只是特定與linux的`get_sysinfo` 和 `is_root`? * msf/core/post/osx - `get_sysinfo`,`get_users`,`get_system_accounts`,get_groups和用于操作的目標計算機的網絡攝像頭的方法。 * msf/core/post/solaris - 非常像linux mixin。相同的方法,但是是對于Solaris。 * msf/core/post/unix - get_users get_groups enum_user_directories * msf/core/post/windows -大部分的開發時間都花在這里。Windows帳戶管理,事件日志,文件信息,Railgun,LDAP,netapi,powershell,注冊表,wmic,服務等。 ### 模板 在這里我們有一個post模塊模板 正如你所看到的,有一些需要填寫的必填字段。我們將解釋每個: ~~~ ## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Post def initialize(info={}) super(update_info(info, 'Name' => '[Platform] [Module Category] [Software] [Function]', 'Description' => %q{ Say something that the user might want to know. }, 'License' => MSF_LICENSE, 'Author' => [ 'Name' ], 'Platform' => [ 'win', 'linux', 'osx', 'unix', 'bsd' ], 'SessionTypes' => [ 'meterpreter', 'shell' ] )) end def run # Main method end end ~~~ `Name`字段應該以平臺開頭,就像Multi, Windows, Linux, OS X.接下來是模塊類別,例如Gather, Manage, Recon, Capture, Wlan..接下來是軟件的名字,最后幾個單詞描述這個模塊的功能,例子:"Multi Gather RndFTP Credential Enumeration". 在`Description`字段應該解釋模塊做什么,什么事情要留意,具體要求,多多益善。目標是讓用戶了解他所使用的內容,而不需要實際讀取模塊的源代碼并找出結果。相信我,他們中的大多數人不會。 `Author `字段是你的名字。格式應該是“名稱”。如果你想在那里有你的Twitter,留下它作為一個評論,例如:“名稱#handle” 該`Platform`字段表示所支持的平臺,例如:win, linux, osx, unix, bsd. 這個`Session type`字段應該是meterpreter或者shell,你應該嘗試支持更多 最后,這個`run`方法就像你的main方法。開始在那里寫你的代碼 ### 基本的git命令 > 和如何開始寫exploit的一樣
                  <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>

                              哎呀哎呀视频在线观看