When considering network port numbers, the numbers are divided into three ranges: the Well Known ports, the Registered ports and the Dynamic (Private) ports. The Internet Assigned Numbers Authority (IANA) is responsible for the global coordination of the port assignments. The Well Known port range is from 0 – 1023, Registered ports run from 1024 – 49151, and the Dynamic ports run from 49152 – 65535.
So how do we determine the port that a service is using? Without using Network Monitor, Wireshark or a similar utility, there are a couple of very handy utilities provided with the operating system that we can use – NETSTAT.EXE and TASKLIST.EXE. Most administrators are familiar with NETSTAT.EXE already, but for those who are not, you can use NETSTAT.EXE to identify what ports are being used by a particular process. The syntax that we will be using for NETSTAT.EXE is as follows: netstat.exe –a –n –o. The switches we are using provide the following:
- IANA Port Assignments
- Microsoft KB Article 832017: Service Overview and Network Port Requirements for the Windows Server system
- Microsoft KB Article 319553: How to restrict FRS (File Replication Service) replication traffic to a specific static port
- Microsoft KB Article 224196: Restricting Active Directory replication traffic and client RPC traffic to a specific port