Exploring the Rarely Used Port Zero in Networking

Port zero, specified within the TCP protocol, represents a total of 65,536 ports, yet it is rarely used. According to Acid Vegas, only about 0.25% of hosts globally utilize this port. The infrequent use of port zero is not due to technical limitations, as TCP supports it well, but rather social conventions.
When a request is made to the Linux kernel for port zero, it typically responds with a randomly allocated even port between 32,768 and 61,000. However, there are methods to bypass this limitation, such as using raw sockets or IPTables/NFTables for port mapping. For instance, plain text IRC can be bound to irc.supernets.org on port zero, while TLS operates on port one.
Attempts to connect to this IRC server using standard userland programs often fail. Tools like BSD NC and Telnet will indicate that the port is too small, while browsers based on Chromium and Firefox will warn users that the connection is unsafe. Python SSL will return an I/O error, but Python AsyncIO and socat can connect without issues. This reflects a lack of practical reasons to use port zero rather than a technical barrier.
Searching for hosts utilizing port zero reveals that they often arise from accidental configurations, typically involving network devices. Some unusual services have been identified on this port, including SSH, particularly with DropBear, which is common in IoT or networking devices like routers. Telnet has also been found on various embedded devices, and HTTP router admin pages appear on port zero. However, since browsers do not allow connections to this port, users must set up local port forwarding rules to connect.
In addition to a few other services, such as RustDesk, the most notable application on port zero is the Station Message Detail Recording (SMDR). This simple TCP protocol logs phone call outputs in plain text.
For those interested in Linux networking, further exploration into related topics, such as VPN hacks, may be worthwhile.
Source: Hackaday