好消息!最新Metasploit加入硬件測試功能
Metasploit測試框架現在加入了新功能,讓用戶更容易地進行硬件設備的分析測試。
Metasploit中已經包含了超過1600個exp和3300個模塊,還有一個超大的社區專門研究模塊和腳本。
現在,Metasploit能夠讓用戶創建自己的腳本用來對硬件進行測試,更新后的Metasploit中加入了“硬件橋API”,用戶可以測試各種硬件,甚至包括汽車里的CAN總線。
如何使用硬件模式?
有兩種方式使用Metasploit的硬件測試功能:
將支持直接編譯進固件中,使得設備能夠兼容Metasploit
建立中繼服務
如果設備不能使用以太網進行通信,則必須建立中繼服務。很多硬件工具諸如軟件無線電(SDR)都只能通過USB來控制。為了要將這種SDR設備與Metasploit連接,就得運行中繼服務。使用到的是REST API。
如何進行硬件測試?
新發布的版本支持 SocketCAN。如果你有Linux系統和支持 SocketCAN的 CAN總線 嗅探器就可以進行測試了。 local_hwbridge 模塊就是個簡易中繼服務的示例,你可以在本地或者遠程服務器運行。
msf > use auxiliary/server/local_hwbridge msf auxiliary(local_hwbridge) > run [*] Auxiliary module execution completed [*] Using URL: http://0.0.0.0:8080/6xOv7GqFs3YTeIE [*] Local IP: http://10.1.10.21:8080/6xOv7GqFs3YTeIE [*] Server started. msf auxiliary(local_hwbridge) >
local_hwbridge模塊默認會檢測任何SocketCAN數據,不需要輸入任何選項。中繼服務無需在Metasploit中運行。如果硬件本身支持REST API的話就可以跳過這步。
msf > use auxiliary/client/hwbridge/connect msf auxiliary(connect) > set rhost 10.1.10.21 rhost => 10.1.10.21 msf auxiliary(connect) > set targeturi 6xOv7GqFs3YTeIE targeturi => 6xOv7GqFs3YTeIE msf auxiliary(connect) > run [*] Attempting to connect to 10.1.10.21... [*] Hardware bridge interface session 1 opened (127.0.0.1 -> 127.0.0.1) at 2017-01-17 11:02:34 -0800 [+] HWBridge session established [*] HW Specialty: {"automotive"=>true} Capabilities: {"can"=>true, "custom_methods"=>true} [!] NOTICE: You are about to leave the matrix. All actions performed on this hardware bridge [!] could have real world consequences. Use this module in a controlled testing [!] environment and with equipment you are authorized to perform testing on. [*] Auxiliary module execution completed msf auxiliary(connect) > sessions Active sessions =============== Id Type Information Connection -- ---- ----------- ---------- 1 hwbridge cmd/hardware automotive 127.0.0.1 -> 127.0.0.1 (10.1.10.21)
設備連接后,就會建立一個HWBridge會話。如果你比較熟悉meterpreter的話,你就會習慣使用hwbridge。你可以輸入help獲取命令列表,或者運行指定模塊如getvinfo(獲取汽車信息)。
msf auxiliary(connect) > sess 1 [*] Starting interaction with 1... hwbridge > supported_buses Available buses can0, can1, can2 hwbridge > run post/hardware/automotive/getvinfo CANBUS=can2 [*] Available PIDS for pulling realtime data: 46 pids [*] [1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 24, 25, 28, 31, 32, 32, 33, 44, 45, 46, 47, 48, 49, 50, 51, 60, 61, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 76] [*] MIL (Engine Light) : OFF [*] Number of DTCs: 0 [*] Engine Temp: 48 °C / 118 °F [*] RPMS: 0 [*] Speed: 0 km/h / 0.0 mph [*] Supported OBD Standards: OBD and OBD-II [*] Mode $09 Vehicle Info Supported PIDS: [2, 4, 6, 8] [*] VIN: 1G1ZT53826F109149 [*] Calibration ID: UDS ERR: {"RCRRP"=>"Request Correctly Received, but Response is Pending"} [*] PID 6 Response: ["00", "00", "C4", "E9", "00", "00", "17", "33", "00", "00", "00", "00"] [*] PID 8 Response: ["00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00", "00"]
即將加入更多硬件模式
首個更新的“硬件橋API”專門針對汽車系統的測試,管理Metasploit工具的Rapid7公司表示,之后還會加入其他功能。
Metasploit想要成為大家進行硬件測試的首選工具,包括SCADA和工控系統(ICS)測試、物聯網設備測試、軟件無線電(SDR)。
“Metasploit將一批軟件exp和工具集成到了一個框架中,現在我們希望在硬件方面也能這么做。”
“聯網設備的每一次浪潮,無論是汽車還是冰箱,都模糊了軟硬件的界限。我們喜歡說,這個‘硬件橋’能夠讓你退出數字矩陣直接影響到現實、物理的設備。”Rapid7運輸研究主任Craig Smith解釋道。“我們嘗試給安全專家們他們所需的資源,讓他們對產品進行測試以保證產品安全。”
來自: http://www.freebuf.com/sectool/126207.html