Subscribe to Windows IT Pro
February 22, 2007 12:00 AM

Using Netstat to Get a List of Open Ports

Windows IT Pro
InstantDoc ID #94752
Rating: (0)

Q: How can I get a list of all the open ports on my system and the programs that have them open?

A: The easiest way is to run Netstat, which is available on every Windows computer. Netstat displays all TCP and UDP connections and their respective states by default if you don’t supply any parameters. Note that this excludes ports in listening mode. Ports in listening mode are ports that a program has open but that don't necessarily have clients connected to them. To also see listening ports, run Netstat with the -a switch. By default, Netstat translates common port numbers into the protocol typically associated with them (e.g., port 25 is translated to smtp) and IP addresses are converted to their DNS names.

If you’d rather see the port and IP address numbers, use the -n switch. By default, Netstat doesn't identify the executable or process identifier (PID) associated with each port. The -b switch tells Netstat to display the specific service within the executable that opened the port. To get the PID of the process associated with each port, use the -o switch, which shows the same PID for a process as Task Manager does.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.