centos下的nc是“netcat”的简称,是一个网络工具,可以用于端口扫描、文件传输等,nc也可以实现任意TCP和UDP端口的侦听,可以利用“yum install nc -y”命令进行安装。

本文操作环境:centos 7系统、Dell G3电脑。
centos下什么是nc
nc是netcat工具的简称,一个网络工具,可以用来端口扫描、文件传输等功能。
centos上面安装也很简单:
yum install nc -y
nc常用功能
实现任意TCP/UDP端口的侦听,nc可以作为server以TCP或UDP方式侦听指定端口
端口的扫描,nc可以作为client发起TCP或UDP连接
机器之间传输文件
机器之间网络测速
一般nc只用来做TCP/UDP协议的端口测试,其它功能少用!
nc帮助说明
大高朋团购系统是一套Groupon模式的开源团购程序,开发的一套网团购程序,系统采用ASP+ACCESS开发的团购程序,安装超简,功能超全面,在保留大高朋团购系统版权的前提下,允许所有用户免费使用。大高朋团购系统内置多种主流在线支付接口,所有网银用户均可无障碍支付;短信发送团购券和实物团购快递发货等。 二、为什么选择大高朋团购程序系统? 1.功能强大、细节完善 除了拥有主流团购网站功能,更特别支
# nc --help Ncat 7.50 ( https://nmap.org/ncat ) Usage: ncat [options] [hostname] [port] Options taking a time assume seconds. Append 'ms' for milliseconds, 's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms). -4 Use IPv4 only -6 Use IPv6 only -U, --unixsock Use Unix domain sockets only -C, --crlf Use CRLF for EOL sequence -c, --sh-execExecutes the given command via /bin/sh -e, --exec Executes the given command --lua-exec Executes the given Lua script -g hop1[,hop2,...] Loose source routing hop points (8 max) -G Loose source routing hop pointer (4, 8, 12, ...) -m, --max-conns Maximum simultaneous connections -h, --help Display this help screen -d, --delay
nc常用案例
TCP监听测试
nc可作为server端192.168.10.11启动一个tcp的监听
nc -l 80
客户端测试方法:直接telnet该机器ip+端口
telnet 192.168.10.11 80
或:nmap 192.168.10.11 -p 80
UDP监听测试
nc作为server端启动一个udp的监听
nc -lu 80
通过netstat可以看到udp协议已经监听:
> # netstat -tunlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name udp 0 0 0.0.0.0:80 0.0.0.0:* 15401/nc
推荐教程:《centos教程》









