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
相关推荐
jun_bai12 小时前
python写的文件备份网盘程序
运维·服务器·网络
爱吃牛肉的大老虎12 小时前
网络传输架构之gRPC讲解
网络·架构
Warren9812 小时前
Python自动化测试全栈面试
服务器·网络·数据库·mysql·ubuntu·面试·职场和发展
云飞云共享云桌面14 小时前
无需配置传统电脑——智能装备工厂10个SolidWorks共享一台工作站
运维·服务器·前端·网络·算法·电脑
骆驼102414 小时前
手机热点和无线路由器在 IPv6 工作模式上的区别
网络·ipv6
jenchoi41315 小时前
【2025-11-23】软件供应链安全日报:最新漏洞预警与投毒预警情报汇总
网络·数据库·安全·web安全·网络安全
独行soc16 小时前
2025年渗透测试面试题总结-258(题目+回答)
网络·python·安全·web安全·渗透测试·安全狮
AI绘画小3317 小时前
网络安全(黑客技术)—2025自学手册
网络·安全·web安全·网络安全·渗透测试
s090713618 小时前
ZYNQ DMA to UDP 数据传输系统设计文档
网络协议·fpga开发·udp
恒创科技HK20 小时前
香港服务器流量有限制和带宽有限制区别在哪?
运维·服务器·网络