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
相关推荐
迎仔37 分钟前
A-算力中心网络隔离总览:数字世界的“酒店房间“
网络
宝塔面板1 小时前
AllinSSL 一站式搞定 SSL 自动续期:永久免费,开源可自托管
网络·网络协议·ssl
csdn今天倒闭了吗1 小时前
飞牛lucky配置ipv6 ddns+ssl+反向代理
网络·网络协议·ssl
JavinLu1 小时前
ios 配置了代理且使用 chls.pro/ssl 下载不了证书,无法弹出下载证书的提示问题
网络协议·ios·ssl
强风7941 小时前
Linux-网络层
网络
独行soc1 小时前
2026年渗透测试面试题总结-19(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
_Johnny_1 小时前
ETCD 配额/空间告警模拟方案
网络·数据库·etcd
CHENKONG_CK1 小时前
晨控CK-LR08-E00与汇川H5U系列PLC配置MODBUSTCP通讯连接手册
linux·服务器·网络
菜鸟特工0071 小时前
javax.net.ssl.SSLPeerUnverifiedException 异常如何处理
网络协议·.net·ssl
天荒地老笑话么1 小时前
静态 IP 规划:掩码/网关/DNS 的正确组合
网络·网络协议·tcp/ip·网络安全