4 ms·
You can even use it under Linux if you wish btw, you just can't bind to it, but you can have your firewall redirect port 0 to something else.
by Avamander 2y ago
You can even use it under Linux if you wish btw, you just can't bind to it, but you can have your firewall redirect port 0 to something else.
- rockskon 2y agoYou can bind to it on some versions of Linux. I've scanned a bunch of Linux systems that host stuff on port 0.
- BitPirate 2y agoYour observation doesn't contradict the use of firewall rules to accomplish this.
- rockskon 2y agoIt's not some ufw rule that normally prevents hosting a service on port 0.
- arghwhat 2y agoThat's not what was said. They said that a firewall rule can redirect traffic coming in on port 0 to a running service even when a service cannot bind directly to port 0. Binding with port 0 as argument for AF_INET binds a random available port, not port 0. This is documented behavior of Linux and likely every other OS implementing a BSD-style socket interface. Also note that ufw is just a tiny, non-standard wrapper for the much more powerful nftables/iptables interfaces