Shell脚本中有没有什么原生的方法开个tcp端口?

rt
nc之类的不是原生的

雾之受 蜗牛来回答:
google bind shell

https://www.exploit-db.com/exploits/39718/

$ gcc -o bind_shell bind_shell.c
$ execstack -s bind_shell
$ ./bind_shell

蜗受 :heart_eyes:

后来发现shell有原生的方法开网络服务的 http://xmodulo.com/tcp-udp-socket-bash-shell.html
具体语法是

 exec {file-descriptor}<>/dev/{protocol}/{host}/{port} 
1 个赞

必须要说一声,这个功能只有 bash 能用,zsh 没试过,其它 shell 更不用说了。