centos下什么是nc

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

centos下什么是nc

本文操作环境: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帮助说明

Layx是一款网页弹窗Javript插件 Layx是一款网页弹窗Javript插件

Layx 是一款网页弹窗Javript插件,她将助力于互联网Web开发,提供优质的弹窗体验

Layx是一款网页弹窗Javript插件 32 查看详情 Layx是一款网页弹窗Javript插件

# 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-exec     Executes 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          Wait between read/writes  -o, --output     Dump session data to a file  -x, --hex-dump   Dump session data as hex to a file  -i, --idle-timeout   Idle read/write timeout  -p, --source-port port     Specify source port to use  -s, --source addr          Specify source address to use (doesn't affect -l)  -l, --listen               Bind and listen for incoming connections  -k, --keep-open            Accept multiple connections in listen mode  -n, --nodns                Do not resolve hostnames via DNS  -t, --telnet               Answer Telnet negotiations  -u, --udp                  Use UDP instead of default TCP      --sctp                 Use SCTP instead of default TCP  -v, --verbose              Set verbosity level (can be used several times)  -w, --wait           Connect timeout  -z                         Zero-I/O mode, report connection status only      --append-output        Append rather than clobber specified output files      --send-only            Only send data, ignoring received; quit on EOF      --recv-only            Only receive data, never send anything      --allow                Allow only given hosts to connect to Ncat      --allowfile            A file of hosts allowed to connect to Ncat      --deny                 Deny given hosts from connecting to Ncat      --denyfile             A file of hosts denied from connecting to Ncat      --broker               Enable Ncat's connection brokering mode      --chat                 Start a simple Ncat chat server      --proxy   Specify address of host to proxy through      --proxy-type     Specify proxy type ("http" or "socks4" or "socks5")      --proxy-auth     Authenticate with HTTP or SOCKS proxy server      --ssl                  Connect or listen with SSL      --ssl-cert             Specify SSL certificate file (PEM) for listening      --ssl-key              Specify SSL private key (PEM) for listening      --ssl-verify           Verify trust and domain name of certificates      --ssl-trustfile        PEM file containing trusted SSL certificates      --ssl-ciphers          Cipherlist containing SSL ciphers to use      --version              Display Ncat's version information and exit

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 -tunlpActive 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教程》

以上就是centos下什么是nc的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/375011.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年11月6日 09:18:58
下一篇 2025年11月6日 09:22:54

相关推荐

发表回复

登录后才能评论
关注微信