Open In App

How To Check Open TCP/IP Ports in Windows?

Last Updated : 01 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Certain apps and processes in Windows 10 can cause problems if you’re not properly connected to the internet. Firewalls can cause these connection issues when they cannot determine whether incoming and outgoing connections pose a threat. Work around this issue and open ports for incoming and outgoing connections. We will know to check whether a TCP port is open or closed on the Windows operating system.

Basically, many times we need to check the port status when any of the below issues results in closing the port.

  1. They may not be properly working.
  2. External IP addresses that are in use may be set to private IPs.
  3. Firewall rules may block the network.

There are several ways to check open TCP/IP ports in Windows. Here are a few options:

Using Telnet Client:

Step 1: Check whether the telnet client feature is ON or not. In order to check, open the Turn Windows feature on or off settings from the search bar. OR press the ‘window’ key and type ‘windows’ features. Then press on “Turn Windows features on or off”.

Windows Features Option

A new prompt will be opened. Search for “Telnet Client” and check the box in front of ‘telnet Client’.

Windows Features

Step 2: Open the command prompt. Press the ‘windows’ key and type ‘cmd’. Press “Command Prompt”.

Command Prompt Option

Step 3: On the command prompt, type the command “telnet + IP address or hostname + port number” and check the status of the provided TCP port.

Telnet Command

Step 4: If only the blinking cursor is visible, then the port is open.

Port is Open

Step 5: If you get the message “connection failed” then the port is closed.

Port is close

Using built-in netstat command-line utility:

Step 1: Open the command prompt. 

Step 2: Run the following command:

netstat -an

 

Using TcpView

Another option is to use the TcpView utility from Microsoft’s Sysinternals suite of tools. This utility provides a more user-friendly interface for viewing active TCP/IP connections, along with additional information such as the process ID and process name for each connection. Steps to be followed:

Step 1: Download the TcpView utility from the Microsoft Sysinternals website. You can find the download link on the TcpView page of the Sysinternals website.

Download Page

Step 2: Extract the downloaded file and run the TcpView.exe file to launch the TcpView utility. This will open the TcpView window, which shows a list of all active TCP/IP connections on your machine.

Extracted FIles

Step 3: Open the tcpview.exe (application).

By default, TcpView will display the following columns in the list of connections:

Protocol: Shows the protocol being used for the connection (TCP or UDP)

Local Address: Shows the local address and port being used for the connection

Remote Address: Shows the remote address and port being connected to

State: Shows the current state of the connection (e.g. Established, Listen, etc.)

You can use the “Local Address” and “Remote Address” columns to see which ports are being used by which applications. For example, if you see a connection with a local address of “127.0.0.1:80”, this means that the local application is using port 80 for outgoing connections.

Windows PowerShell

You can also use Windows PowerShell to check open TCP/IP ports. To do this, use the Get-NetTCPConnection cmdlet, which allows you to view a list of active TCP/IP connections and the local and remote addresses and ports being used. For example, you can run the following command to view a list of all active TCP/IP connections:

Get-NetTCPConnection | 
Select-Object LocalAddress,
LocalPort, RemoteAddress, RemotePort

Get-NetTCPConnection cmdlet

Nmap

To install Nmap in the Windows command line, follow these steps:

Step 1: Download the latest version of Nmap from the Nmap website. You can find the download link on the Nmap download page: 

https://nmap.org/download.html

Step 2: Extract the downloaded file to a location on your computer. This will create a new folder containing the Nmap files.

Step 3: Open a command prompt and navigate to the directory where you extracted the Nmap files. For example, if you extracted the files to the C:\nmap directory, you would run the following command:

cd C:\nmap

Step 4: Once you are in the Nmap directory, you can install Nmap by running the nmap.exe file. To do this, run the following command:

nmap.exe -V

This will display the version number of Nmap, indicating that it has been installed successfully.

Step 5: To use nmap to scan for open TCP/IP ports, run the “nmap -sT” command, followed by the IP address or hostname of the machine you want to scan.

nmap -sT localhost

 

This will scan the specified host or IP address and display the results. You can also use the -h option to view a list of available options and arguments for the nmap command. Overall, installing Nmap in the Windows command line is a straightforward process. You can download the latest version of Nmap from the Nmap website, extract the files, and then run the nmap.exe file to install it. Once it is installed, you can use the nmap command to scan hosts and IP addresses and view the results.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads