最近项目需要扫描光猫的某些端口是否关闭,用到了netcat这个工具,记录一下,免得以后忘啦。
1.安装
wget https://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz
下载之后看了看README及INSTALL,直接 ./configure、 make、 make install三连…
安装很顺利,基本没什么问题。
看看帮助:
$ nc --help
GNU netcat 0.7.1, a rewrite of the famous networking tool.
Basic usages:
connect to somewhere: nc [options] hostname port [port] ...
listen for inbound: nc -l -p port [options] [hostname]