Telnet 测试 UDP 端口?

Telnet 并不支持 UDP 端口的测试,可以使用 nc 命令来进行测试。nc 命令两种都支持:

TCP

bash 复制代码
# nc -z -v -u [hostname/IP address] [port number] 

 

# nc -z -v 192.168.10.12 22 

Connection to 192.118.20.95 22 port [tcp/ssh] succeeded!

UDP

bash 复制代码
# nc -z -v [hostname/IP address] [port number] 

 

# nc -z -v -u 192.168.10.12 123 

Connection to 192.118.20.95 123 port [udp/ntp] succeeded!

下面是一些 nc 的简单用例:

bash 复制代码
  - Start a listener on the specified TCP port and send a file into it:
    nc -l -p port < filename

  - Connect to a target listener on the specified port and receive a file from it:
    nc host port > received_filename

  - Scan the open TCP ports of a specified host:
    nc -v -z -w timeout_in_seconds host start_port-end_port

  - Start a listener on the specified TCP port and provide your local shell access to the connected party (this is dangerous and can be abused):
    nc -l -p port -e shell_executable

  - Connect to a target listener and provide your local shell access to the remote party (this is dangerous and can be abused):
    nc host port -e shell_executable

  - Act as a proxy and forward data from a local TCP port to the given remote host:
    nc -l -p local_port | nc host remote_port

  - Send an HTTP GET request:
    echo -e "GET / HTTP/1.1\nHost: host\n\n" | nc host 80
相关推荐
IpdataCloud1 小时前
IP查询能够帮助企业进行数字化转型
网络·网络协议·tcp/ip
QING6182 小时前
Retrofit 与 Ktor 的简介和对比分析 !!!!
网络协议·kotlin·app
ssr——ssss2 小时前
组播网络构建:IGMP、PIM 原理及应用实践
网络·智能路由器
Stringzhua3 小时前
Linux多网卡组Bond0Bond1Bond4
运维·服务器·网络
王伯爵4 小时前
接入网和核心网之间的承载网详细介绍
服务器·网络·数据库
qq_543248524 小时前
Linux网络配置与测试
linux·运维·网络
kfhj5 小时前
什么是RPC通信
网络·网络协议·rpc
白山云北诗5 小时前
网络安全小知识课堂(六)
网络·安全·web安全
老六ip加速器5 小时前
抖音直播位置与IP属地不同?如何实现
网络·网络协议·tcp/ip
XYN616 小时前
【嵌入式学习3】UDP发送端、接收端
网络·笔记·python·网络协议·学习·udp