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
相关推荐
忡黑梨16 分钟前
eNSP_路由策略
运维·服务器·网络·华为·智能路由器·负载均衡
_F_y25 分钟前
仿RabbitMQ实现消息队列-服务端核心模块实现(2)
网络·rabbitmq
Chengbei1132 分钟前
面向红队的 AI 赋能全场景流量分析仪 网页 / APP / 终端 / IoT 全域 HTTPS 抓包解密利器
人工智能·物联网·网络协议·web安全·网络安全·https·系统安全
Hello_Embed39 分钟前
【无标题】
网络·笔记·网络协议·tcp/ip·嵌入式
路溪非溪1 小时前
详解下DNS协议
网络·网络协议·tcp/ip·智能路由器
CHANG_THE_WORLD1 小时前
<Fluent Python > 2. 第二章:序列的数组
网络·windows·python
byoass1 小时前
企业云盘API集成指南:如何与CI/CD流水线打通
网络·安全·ci/cd·云计算
大卡片1 小时前
TCP、IP和TFTP协议
服务器·网络·tcp/ip
汽车仪器仪表相关领域1 小时前
Kvaser Memorator Professional HS/LS:高速 + 低速双通道 CAN 总线记录仪,跨系统诊断的专业级解决方案
网络·人工智能·功能测试·测试工具·安全·压力测试
用户815577828212 小时前
连上WiFi 却打不开网页?一套常用命令帮你快速定位问题
网络协议