What are some ports that are essentially "never" used (super rare port ranges) [closed]
You should take a look at nmap's nmap-services
file (contained in the sources). A line will be like this:
# Service name, portnum/protocol, open-frequency, optional comments
tcpmux 1/tcp 0.001995 # TCP Port Service Multiplexer [rfc-1078]
This way, you can look at ports non-dedicated to well-known services, which are specified as 'Service name = unknown'. The list is quite extensive:
petrus:~/nmap-6.25$ grep unknown nmap-services | wc -l
15411
Also, another very interesting field in the nmap-services
is the open-frequency number. Pick the port which has the lowest number for your needs.
This has nothing to do with the operating system, as the file is just plaintext. You can grab the file in the sources or on nmap's web svn.
Here are the 10 least-used ports according to the nmap-services
file:
petrus:~/nmap-6.25$ grep unknown nmap-services | awk -F" " '{print $3 " " $2}' | sort | head
0.000013 226/tcp
0.000013 228/tcp
0.000013 229/tcp
0.000013 234/tcp
0.000013 238/tcp
0.000013 270/tcp
0.000013 271/tcp
0.000013 277/tcp
0.000013 288/tcp
0.000013 289/tcp
There's a sister question to this on Security.SE: Are some uncommon TCP ports scanned less than others?
Among other things in my answer, you'll find from the registered port list there (or in SpacemanSpiff's answer) that... the range 49152–65535 - above the registered ports - contains dynamic or private ports that cannot be registered with IANA
There are only ~65k ports available. The first thousand or so are considered "well known". Usage over this is fairly random. Just pick something you can remember with 5 digits. You are STILL going to get port scanned, so be sure whatever you forward to is locked down.
EDIT: This will help you http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers