How to Determine all Ports Opened by a Program in Windows

Motivation:

You want to ensure that your server is not compromised by a program.

Solution:

1. Open cmd.exe and execute commands below. Note the program file name and one of its ports that you want to investigate further.

netstat -a -b

2. Execute the command below. Note the PID associated with the port that you are interested in.

netstat -ano -p tcp

3. Execute commands below. “1544” is the PID that you are interested in.

netstat -ano -p tcp |find "1544"

4. Open https://mxtoolbox.com/TCPLookup.aspx, and enter [your external IP:port], and click TCP Lookup button to check if a port is open from your server.

5. Go to your Firewall and block the port if it should not be open to the Internet.