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
相关推荐
源远流长jerry6 小时前
curl、ping、iptables、iperf、tcpdump解析
网络·网络协议·测试工具·ip·tcpdump
米羊1216 小时前
OA 系统防护与渗透测试(上)
网络·安全
林疏safe6 小时前
应急演练剧本
网络
manuel_897578 小时前
六 系统安全
网络·数据库·系统安全
无忧智库9 小时前
深度解读《某低空经济试验区“十五五”通用航空机场与无人机物流网络初步设计方案》:构建未来低空经济数字底座的全景蓝图
网络·无人机
Arwen3039 小时前
SSL 加密证书助力企业构建安全的网络环境
网络·网络协议·tcp/ip·安全·php·ssl
乾元9 小时前
ISP 级别的异常洪泛检测与防护——大流量事件的 AI 自动识别与响应工程
运维·网络·人工智能·安全·web安全·架构
水力魔方10 小时前
SWMM深度二次开发专题7:网络分析-获取网络
网络·经验分享·swmm
木鱼布11 小时前
聊聊防火墙技术
网络·网络协议·tcp/ip
liulilittle12 小时前
XDP VNP虚拟以太网关(章节:一)
linux·服务器·开发语言·网络·c++·通信·xdp