
TCP 规定了 2^16 个端口,即 65536 个,远超通常使用的数量。事实上,0 号端口几乎从未被使用,或者确切地说,正如 [Acid Vegas] 所发现的,全球大约(上下浮动)只有 0.25% 的主机在使用它。原因并非技术层面的——事实上 TCP 对此支持得相当好——而是社会层面的。如果你请求 Linux 内核为你提供 0 号端口,它实际上会分配给你一个介于 32768 到 61000 之间随机分配的偶数端口。当然,也有办法绕过这一点:原始套接字(raw sockets),或者 [Acid] 所采用的方式——IPTables/NFTables 端口映射。通过这种方式,明文 IRC 被绑定到 irc.supernets.org 的 0 号端口,而 TLS 则绑定到 1 号端口。
但是,如果你尝试连接这个 IRC 服务器,你会发现大多数用户态程序根本拒绝接受 0 号端口。BSD NC 和 Telnet 只会告诉你端口太小。基于 Chromium 和 Firefox 的浏览器会警告你不安全。而 Python SSL 则会抛出一个 IO 错误。然而,Python AsyncIO 和 socat 却能正常工作。同样,这并非端口本身的技术限制,而是反映出确实没有理由去使用它。
如果你在互联网上搜索使用 0 号端口的主机,你会发现它们大多像是意外产生的。很可能是某个网络设备默认采用了某种奇怪的配置,而无人注意到。无论原因如何,确实有一些奇怪的服务在使用这个端口。SSH——大多是 DropBear——暗示这可能是物联网或路由器之类的网络设备。同样,Telnet 也出现在一些嵌入式设备上。HTTP 路由器管理页面同样出现在这个端口上。不过,别忘了,浏览器不允许你使用 0 号端口,所以如果你想连接,就需要设置一条本地端口转发规则。
虽然还有包括 RustDesk 在内的少数其他服务也在使用 0 号端口,但最有趣的是 Station Message Detail Recording(站点消息详细记录)。SMDR 是一种简单的 TCP 协议,以明文形式记录电话呼叫的输出信息。
本文来源:https://hackaday.com/2026/11/22/i-heard-there-was-a-secret-port/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。

TPC specifies 2^16 ports, 65536, much more than are typically used. In fact, the port zero is almost never used, or, as [Acid Vegas] found out, about 0.25% of hosts globally (give or take) to be precise. The reason is not technical, in fact TCP supports it quite well, but rather social. If one were to request the Linux kernel provide you with port 0, it would actually provide you with a randomly allocated even port between 32768 and 61000. But, there are, of course, ways around this. Raw sockets or, the route [Acid] takes, IPTables/NFTables port mapping. By this, plain text IRC is bound to irc.supernets.org on port 0, and TLS on port 1.
But, should you go try to connect to this IRC server, you will find most userland programs simply refuse to accept a port of 0. BSD NC and Telnet will simply tell you the port is too small. Chromium and Firefox derived browsers will warn you its unsafe. And Python SSL will give you an IO error. However, Python AsyncIO and socat work just fine. Once again, this is not technical limitation of the port, but rather a reflection of the fact that there really isn’t a reason to use it.
Should you go looking on the internet for hosts using port zero, you will find they mostly appear accidental. Mostly likely a network device defaulted to a strange configuration that no one noticed. Regardless the reasons, some strange services are using the port. SSH, mostly DropBear, suggesting IoT or networking devices like routers. Likewise, Telnet appeared on a number of embedded devices. HTTP router admin pages also appear on the port. But, if you remember, browsers don’t let you use port 0, so you need to set up a local port forwarding rule if you want to connect.
While a handful of other services including RustDesk are on port 0, the most interesting is Station Message Detail Recording. SMDR is a simple TCP protocol which logs the outputs of phone calls in plain text.
本文来源:https://hackaday.com/2026/11/22/i-heard-there-was-a-secret-port/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。