A Port basically serves as an interface between your computer and the internet or other computers in the network. Every communication over the web is exchanged using these ports so they are the essential part of the entire internet communication model.
Every IP address has a total of 65,535 ports and it’s either a UDP port or a TCP port. Open port in a computer refers to a port that is configured to accept the connections and a port which rejects connections is obviously a closed port.
While open ports are necessary for internet communication, they can be dangerous if the service listening on the port has bad security rules and is misconfigured. Such open ports are vulnerable to attacks.
In this post today, we will learn how to check which ports are being used in your machine, how to test if a Firewall is blocking a Port, and also learn how to check which process or service is using the open port.
Check what ports are open in Windows 10
Open Command Prompt, type the following, and hit Enter to view the Ports used along with the Process Identifiers (PIDs):
This will display the ports on your PC. It will display the details in 5 columns-
- Local Address,
- Foreign Address,
- State, and
- PID (Process Identifier).
The port numbers here are displayed under the Local Adress column, for example, if the Local Adress is 0.0.0.0:5040, 5040 here is the port number.
Under the State tab, you can check whether a port is open or not.
- LISTENING means that it just waits and it is ready to send an answer whenever a client program requests it. The connection becomes open when a client connects to that port and a conversation begins.
- ESTABLISHED means that the connection has been established.
- TIME_WAIT means it’s waiting for a reply or connection. this often happens when a port is activated and the connection has not yet. been established
- CLOSE_WAIT means that the other side of the connection has closed the connection.
This is how you check what all ports are open in your Windows 10.
You can also view the Ports used along with the Process Names by running this command:
Read: How to use Port Query Tool (PortQry.exe).
Check which process or service is using the open port
Now when we know what all ports are open in our system, we can also check which service is using which open port. To check that, go to the PID (Process ID) tab.
Let’s take the example of our first open port in the list, port 135, and its PID is 1192.
Now open the Task Manager by hitting Ctrl+Alt+Delete. Go to the Services tab and check for PID 1192.
Under the Description tab, you will see which app/program is using that port. End that particular task if you want to close that connection.
Alternatively, you can also find this using this command:
This will display the program using the selected port.
If you are looking for an easy way, you can also use some third-party software to check what all ports are open in your Windows 10. There is quite a few such freeware available on the web which tell what all websites your computer is connecting to and what all ports are open in your PC. One of such freeware is CurrPorts.
Read: How to Block or Open a Port in Windows Firewall.
How to test if Firewall is blocking a Port
CurrPorts is a simple and portable freeware to check open ports that comes in a zip file and takes no time to download on your PC. Since it is portable software, you do not need to install it. Simply download it, extract all the files and run it. Make sure you download the correct version as per your machine’s configuration.
CurrPorts is a network monitoring software that displays the entire list of all open ports of your PC. Apart from the port number and its State, the freeware also shows detailed information about the processes using the open ports, the complete path of the process, file description, product name, file version, date and time it was created, and much more.
Once you download CurrPorts and run it, the main overview has it all. It displays the entire thing in one single window. You can check all the currently opened TCP and UDP ports and the program using that particular port in a single window. Check the screenshot below. You can select one or more processes at a time, check their ports and kill them if they seem to be unwanted. It also allows you to save the port information to an HTML/XML/Text file.
Furthermore, CurrPorts also lets you kill the process from the same window. Simply select the processes you want to kill, right-click and select ‘Kill processes of selected ports’ from the dropdown menu.
Another benefit of using CurrPorts is that it marks the suspicious TCP/UDP ports owned by the unidentified applications. So you can directly kill them and save your PC from a possible attack.
Certainly, using this freeware is an easier option as compared to the Command Prompt option mentioned above. You can download the software from the official website Nirsoft.net. Please note that there is a separate download link for x64 versions of Windows. This utility works fine with almost every version of Windows. It is a standalone executable utility so doesn’t require any installation.