Как посмотреть список открытых портов в Windows
Статья обновлена: 10 сентября 2021
ID: 101
Чтобы посмотреть список открытых портов:
- Откройте командную строку. Инструкция в статье.
- Выполните команду:
netstat -a
- Нажмите Enter на клавиатуре.
Вы получите список открытых портов в Windows.
Спасибо за ваш отзыв, вы помогаете нам становиться лучше!
Спасибо за ваш отзыв, вы помогаете нам становиться лучше!
Checking open TCP/IP ports on your Windows computer is crucial for managing network security and ensuring smooth connectivity. Certain apps and processes in Windows may face issues due to closed or misconfigured ports, often caused by firewalls or private IP addresses. This guide will walk you through step-by-step methods to check whether a TCP port is open or closed using built-in tools and third-party utilities.
Why You Should Check TCP/IP Ports?
Here are some common scenarios where checking ports is necessary:
- Troubleshooting connectivity issues for applications or services.
- Configuring firewalls to ensure necessary connections are allowed.
- Detecting suspicious activity that might indicate a security breach.
Methods to Check Open TCP/IP Ports
There are several ways to check open TCP/IP ports in Windows. Here are a few options:
Method 1. 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
Method 2: Using built-in netstat command-line utility:
Step 1: Open the command prompt.
Step 2: Run the following command:
netstat -an
Method 3. 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.
Method 4. Using 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
Method 5. Using 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.
Common Issues That Close Ports
- Applications not functioning as expected.
- Misconfigured firewall rules blocking connections.
- IP addresses improperly set as private.
Troubleshooting Common Issues
Here are some common issues that may occur during opening TCP/IP Ports in Windows:
- Telnet Not Listed in Features: Ensure your system version supports Telnet or enable it via PowerShell.
- Firewall Blocking Ports: Temporarily disable the firewall to test port connectivity.
- Command Not Recognized: Verify tool installation and environment variables.
Conclusion
Checking open TCP/IP ports on your Windows computer is an important step for maintaining your system’s security and efficiency. By regularly monitoring these ports, you can identify any unwanted or suspicious connections that might put your computer at risk. Windows provides several simple tools, like Command Prompt and PowerShell, which make it easy to see which ports are open and what applications are using them. Taking the time to check your open ports helps ensure that your computer runs smoothly and stays protected from potential threats. Staying proactive about monitoring your network connections is a key part of keeping your digital environment safe and reliable.
In this tutorial, we will learn how to run the netstat command to check open ports in Windows Operating System. We will also look at command options and how to use the findstr command (similar to grep) to filter the netstat output.
To check open ports, open a command prompt (or PowerShell) as administrator and run the netstat command as follows:
netstat -aon
The command displays lots of information. What you should pay attention to are Local Addresses that are in the LISTENING state.
As you can see in the previous screenshot, In my Windows 10 computer, port 22 (SSH) is open.
Administrators can run the following command to show opened ports only without all other details:
netstat -aon | findstr /i listening
One important point is that the Windows Firewall may block a port even if it is in the listening state. In the Windows Defender Firewall with Advanced Security, there has to be a corresponding inbound firewall rule to match the listening port (Anything with a green checkmark is an open rule).
The Foreign Address column of the output shows the IP address and port of the computer/server at the remote end of the connection.
To check that the port is open from a remote computer, an administrator can run the telnet command from a remote computer against the IP address of the Windows computer.
For example, to check if port 22 is open, I will run the telnet command from a remote computer as follows:
telnet IP_ADDRESS 22
Replace IP_ADDRESS with the actual IP Address of the Windows computer.
Filtering netstat using findstr
Administrators can use the findstr CMD command (which is similar to grep) to filter netstat command data based on string patterns.
For example, run the following command to check TCP connections in TIME_WAIT State.
netstat -a | findstr /i TIME_WAIT
The /I option is for the case insensitive matching.
Command Options
Windows netstat command, without any command-line arguments, displays active TCP connections.
It also includes some useful command options to show network connections and ports in various forms, such as show connections and opened ports based on the protocol, find the process id of a connection/port, view network statics, and find the application that utilizes connections and ports.
| -a | displays all network connections and ports on which Windows is listening (include both IPv4 or IPv6 addresses). |
| -b | The output shows you which applications are using each active connection and ports (need administrative privileges). |
| -e | Displays network statistics, such as the Errors, the number of bytes, and packets sent and received. |
| -n | Displays addresses and ports in numerical format. |
| -f | When used, the output will contain Fully Qualified Domain Names (FQDNs) of IP addresses, if available. |
| -o | Displays an additional column that contains the Process ID (PID). |
| -p | Display data for a specific protocol (e.g., -p TCP). The Protocol can be one of the following: TCP, UDP, TCPv6, or UDPv6. If combined with the -s option, Protocol can be TCP, UDP, ICMP, IP, TCPv6, UDPv6, ICMPv6, or IPv6. |
| -r | Check Windows routing table. |
| -s | Displays detailed network statistics for each protocol (IPv4, IPv6, ICMPv4, ICMPv6, TCP, and UDP). |
| interval | Sets Time interval (in seconds) to automatically update the output. See examples to learn more. |
Examples: Using the netstat command
List all Active TCP connections:
netstat
Check open ports:
netstat -aon | findstr /i listening
Only want to see information about TCP protocol:
netstat -a -p tcp
Show network statistics:
netstat -s
Real-time network monitoring — In the following example, we set a 5 second time interval to check active network connections in real-time. The number 5 causes the command to repeat every five seconds (Press CTRL+C to quit).
netstat -n 5
If you need more information about the Windows netstat command, type netstat \? in the command prompt.
Как проверить, открыт ли порт
- Что такое порт
- Как проверить, открыт ли порт
В этой статье мы расскажем, что такое порт, какие они бывают и как проходит проверка порта на локальном и удаленном компьютере.
Вы можете узнать, открыт ли порт, с помощью нашего сервиса проверки доступности портов.
Что такое порт
Порт — это числовой идентификатор программы или процесса, который обслуживает сетевые соединения на заданном IP-адресе. Номера портов могут быть от 0 до 65 535.
Каждое устройство (компьютер, ноутбук, мобильный телефон и др.) имеет свой IP-адрес. Он дает возможность организовывать сетевые соединения между устройствами. Но на отдельном устройстве может быть запущено несколько сетевых приложений одновременно. Например, есть интернет-сервер с IP-адресом. На нем расположен: веб-сервер, почтовый сервер, FTP-сервер. Как сделать так, чтобы мы могли связаться именно с почтовым сервером? Для этого и нужен порт. Порты предоставляют возможность идентифицировать сетевые приложения на отдельно взятом компьютере.
Есть стандартные порты, такие как:
- порт 80 — для веб-сервера, который работает по протоколу HTTP,
- порт 443 — для защищенного SSL-сертификатом веб-сервера, который работает по протоколу HTTPS,
- порт 21 — для FTP-протокола (протокола передачи файлов).
Как проверить, открыт ли порт
Проверка порта на доступность возможна как для своего (локального) компьютера , так и для удаленного.
Как узнать, какие порты открыты на локальном компьютере в Windows
-
Вызовите командную строку сочетанием клавиш Win+R.
-
Введите команду «cmd» и нажмите ОК:
-
Пропишите команду netstat -a и кликните Enter:
Готово, перед вами список открытых портов на вашем компьютере.
Как узнать, какие порты открыты на удаленном компьютере
Провести проверку портов на открытость удаленного компьютера можно при помощи команды telnet.
Telnet — это утилита, с помощью которой можно соединиться с удаленным портом любого компьютера. Telnet позволяет установить связь, чтобы передавать команды и получать ответы (например, сделать проброс портов).
В Windows 7/8/10 и Vista утилита telnet отключена по умолчанию. Утилиту можно установить по инструкции.
Как проверить доступность порта с помощью команды telnet в Windows:
-
Вызовите командную строку сочетанием клавиш Win+R.
-
Введите команду «cmd» и нажмите ОК.
-
В окне терминала введите команду: telnet имя_сервера номер_порта (например, telnet mysite.ru 31).
Можно проверить порт на доступность по IP, если ввести команду telnet IP_сервера номер_порта (например, telnet 10.0.119.127 31).
-
Если на экране появится текст «“telnet” не является внутренней или внешней командой, исполняемой программой или пакетным файлом», то на вашем компьютере отключена утилита и ее надо установить по инструкции:
-
Если на экране командной строки появится ошибка, значит порт закрыт:
- Если экран станет полностью пустым или появится приглашение сервера, значит порт открыт:
33
33 people found this article helpful
You can use a Windows command or third-party utilities
What to Know
- Easiest: Open the Start menu > type command > right-click the Command Prompt app > Run as administrator.
- Type netstat -ab > press Enter > look for items in the «LISTENING» state.
- The alternative is to use a third-party app: We like TCPView, Nirsoft CurrPorts, and PortQry Command Line Port Scanner.
This article outlines how to check for open ports in Windows 10, which is necessary if an application cannot access the internet or you want to block an application.
How to Check If a Port Is Open With Netstat
The easiest way to check if a port is open on Windows 10 is by using the Netstat command. ‘Netstat’ is short for network statistics. It will show you what ports each internet protocol (like TCP, FTP, etc.) is currently using.
The command has many parameters, but the ones you’ll need to use to check if a port is open are (a), which provides the active ports, and (b), which will tell you the name of the processes using those ports.
-
Select the Start menu and type «command.» Right-click on the Command Prompt app and select Run as administrator.
-
Type netstat -ab and press Enter. You’ll see a long list of results, depending on what’s currently connecting to the network. You’ll see a list of running processes. The open port numbers will be after the last colon on the local IP address (the one on the left).
-
Look for the items on the list with a state of «LISTENING.» These are the processes that are communicating via one of the currently opened ports.
-
If you want to know the program’s name that has a specific port open, then type netstat -aon and press Enter. This command will show the protocol the app is using, the local and remote IP addresses, and most importantly, the PID of the application using that port (the number on the far right). Remember to look for the LISTENING status.
-
To find the application related to that PID, right-click the task manager and select Task Manager. Select the Details tab. Look in the PID field for the PID you noted from the command prompt screen.
How to Check If a Port Is Working Using Third-Party Apps
If you don’t want to use the command prompt to check for open ports, there are very easy-to-use third-party apps that can help.
TCPView
TCPView is a utility included in Microsoft Sysinternals that shows you a list of all running processes and their associated open ports. This app displays ports opening and closing and packet transfers, all in real-time.
Nirsoft CurrPorts
Nirsoft CurrPorts is another utility to see all ports currently being used by applications and services on your system. Just look for the local ports column to see which of your computer’s ports are active.
The list also includes ports that are being connected to on the remote end (the server out on the internet).
PortQry Command Line Port Scanner
Install PortQry Command Line Port Scanner for another command-line utility dedicated to scanning your computer for open ports. Once you install it, open Command Prompt in administrator mode. PortQry automatically installs in the C:\PortQryV2 directory, so change the directory of your command prompt to that directory.
Type the command portqry.exe -local to see all open TCP and UDP ports for your machine. It’ll show you everything you can see with the NetStat command, plus port mappings and how many ports are in each state.
What Is a Port?
Applications running on your computer reach out and get information and data from servers elsewhere on the internet. These applications and the server know how to communicate based on their IP address and the port number.
Think of the IP address as a street address and the port number as the apartment number. If either the server or application attempts to communicate using any other port number, it won’t work. Every other door will be «locked» because other ports are closed.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
