端口转发 kali端口转发到物理机

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33020901/article/details/81436736

工作中遇到kali只能nat,进而尝试kali端口映射到物理机获取shell

windows 实测可行,ew直接报错,linux懒得用服务器测试

记录如下:

[windows 端口转发 netsh]
端口转发的设置也可以通过命令行还进行查看
netsh interface portproxy dump
netsh interface portproxy show all

转发本地的5555端口到远程主机111.111.216.25
netsh interface portproxy add v4tov4 listenport=5555 connectport=80 connectaddress= 111.111.216.25 protocol=tcp

如果想要删掉一个特定的端口转发规则,使用如下的命令:
netsh interface portproxy delete v4tov4 listenport=3340 listenaddress=11.1.1.111

如果想要清空当前所有的配置规则,命令如下:
netsh interface portproxy reset
[linux 端口转发 ssh]
ssh -R  6666:localhost:8080 [email protected]

将本地的8080转发到10.11.22.33服务器上的6666端口上去,从而达到10.11.22.33:6666就是localhost:8080的目的

其他参数

-f 后台运行

-N 不开shell

-T 不分配tty
[ew 端口转发]
a 1080 <=> 2333
./ew_for_linux64 -s rcsocks -l 1080 -e 2333 # A侦听0.0.0.0:2333端口,并转为0.0.0.0:1080端口
   ^
   |
b 1080 <=> 2333
./ew_for_Linux32 -s rcsocks -l 1080 -e 2333 # B侦听0.0.0.0:2333端口,并转为0.0.0.0:1080端口
./ew_for_Linux32 -s lcx_slave -d hostA -e 2333 -f 127.0.0.1 -g 1080 
	    ^	
c ==========|
./ew_for_Linux32 -s rssocks -d hostB -e 2333 # C反向连接B的2333端口

e

猜你喜欢

转载自blog.csdn.net/qq_33020901/article/details/81436736
今日推荐