Команда Windows Netstat для проверки открытых портов в Windows

Maybe you’re troubleshooting a network connectivity issue for a specific program, and you need to check whether its port access is open. What if you need to confirm that your NAS device can communicate with your Windows 10 PC? Whatever reason you need to look for open ports, this article provides detailed steps to check them on Windows 10 using several available tools, either built-in or free to download and use.


Команда Windows Netstat для проверки открытых портов в Windows

There are a couple of handy tools to scan open ports in Windows. You’ll see how to do so on NetStat, PortQry.exe, and NirSoft CurrPorts.

На компьютере может быть установлено довольно много программ и все они резервируют в операционной системе определенный порт для взаимодействия с другим программным обеспечением по сети. В большинстве случаев пользователь заранее знает какой порт использует программа. Это может быть официально зарезервированный порт, под определенный сетевой протокол. Например почтовые программы используют для приема почты протокол POP3 и резервируют порт 110. Бывают неофициально резервируемые порты, например порт 1540 используемый агентом сервера 1С:Предприятие. Информацию об используемых неофициальных портах разработчики программного обеспечения указывают в документации.


Команда Windows Netstat для проверки открытых портов в Windows

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.

The command displays lots of information. What you should pay attention to are Local Addresses that are in the LISTENING state.


Команда Windows Netstat для проверки открытых портов в Windows

As you can see in the previous screenshot, In my Windows 10 computer, port 22 (SSH) is open.


Команда Windows Netstat для проверки открытых портов в Windows

The Foreign Address column of the output shows the IP address and port of the computer/server at the remote end of the connection.

telnet IP_ADDRESS 22

Replace IP_ADDRESS with the actual IP Address of the Windows computer.


Команда Windows Netstat для проверки открытых портов в Windows

Filtering netstat using findstr

The /I option is for the case insensitive matching.


Команда Windows Netstat для проверки открытых портов в Windows

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.

Using the netstat command

List all Active TCP connections:

Check open ports:

Only want to see information about TCP protocol:

netstat -a -p tcp

Show network statistics:

netstat -n 5

If you need more information about the Windows netstat command, type netstat ? in the command prompt.

Как проверить открыт ли сетевой порт

Открытые сетевые порты компьютера являются основной дырой для попадания вирусов из интернета. Контроль над ними является важной задачей для обеспечения безопасности. Для устранения уязвимости следует выявить подозрительные процессы, использующие порты. Посмотрим как это сделать в Windows.

Под портом в сетевых технологиях подразумевается виртуальная дверь, в которую можно постучаться из сети и получить определенный ответ от программы, следящей за этой дверью.

Для нахождения открытых портов будем использовать консоль Windows со встроенными утилитами.

Нажмите + , чтобы вызвать диалоговое окно «Выполнить», и введите «cmd» для запуска консоли.

:/>  Программы увеличения скорости интернета на ПК и Андройде


Команда Windows Netstat для проверки открытых портов в Windows

Команда для получения списка открытых портов:


Команда Windows Netstat для проверки открытых портов в Windows

Типы адресов

Локальный адрес указывает на IP вашего устройства, а внешний — того, кто к нему подключен. Условно их можно разделить на несколько типов:

Состояние порта

Возможны следующие состояния:

PID

PID в последнем столбце указывает на идентификатор процесса, который следит за портом. Для вывода детальной информации наберите команду:

tasklist /FI “PID eq 3984”


Команда Windows Netstat для проверки открытых портов в Windows

Как осуществлять проверку

Просмотрев поочередно все процессы, специалист может выявить подозрительную активность и закрыть доступ к лишним портам или удалить приложение, которое инициирует запуск процесса.

Конкретные рекомендации обычным пользователям дать в этом случае не получится, так как набор работающих процессов и приложений у всех индивидуален. Но в некоторых случаях каждый может попробовать завершить работу подозрительного процесса и посмотреть, как это повлияет на работу компьютера.

taskkill /f /t /pid 3984


Команда Windows Netstat для проверки открытых портов в Windows

В примерах был обнаружен процесс «daemonu.exe» с PID 3984, который отвечает за обновление драйверов «NVIDIA». Угрозы не представляет и будет перезапущен после перезагрузки операционной системы

29 people found this article helpful

You can use a Windows command or third-party utilities

What to Know

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.

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 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 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

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.

:/>  Как включить расширение файлов в Windows 7

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Программы для просмотра сетевых соединений

Этот способ подойдет для тех, кто не хочет погружаться в работу утилит командной строки Windows, а желает быстро и просто получить информацию о портах, которые использует программа, в графическом интерфейсе.

Без труда в интернете можно найти 2 бесплатные программы для полчения списка сетевых соединений операционной системы – это “TCPView” и “Curr ports”.

TCPView

Из мелких недостатков – отсутствие русского языка.

CurrPorts

The second option(netstat -aon) includes process IDs, which you’ll use to identify a task/application in the Task Manager. Some processes may be challenging to identify using netstat -ab, so netstat -aon gets used. As referenced above, “a” represents all connections and ports, “o” represents the owning process ID, and “n” represents the addresses and port numbers as numerals.

Определения порта программы стандартными средствами Windows

Узнать какой порт использует программа в операционной системе Windows можно используя инструменты командной строки – tasklist и netstat. С помощью tasklist узнаем номер идентификатора процесса – PID, затем в netstat находим номер порта этого процесса.

Поиск идентификатора процесса PID

2. Запускаем tasklist и находим PID процесса.

Если необходимо отобразить полный список процессов, в том числе служебных и системных, необходимо использовать tasklist без аргументов.

Команда tasklist /fi “status eq running” найдет только те процессы, которые были запущенны программами. Это сократит список процессов и облегчит поиск.

Находим в списке нужную программу, например OneDrive.exe и запоминаем соответствующий PID.

Поиск порта процесса

Для получения списка используемых портов воспользуемся утилитой командной строки netstat.

B netstat были использованы слtдующие аргументы:

-a – показывает все сокеты, используемые процессами-o – показывает PID процесса-n – показывает адреса в числовом формате

В результате будет получен довольно крупный список активных сетевых соединений, среди которых необходимо найти соединение с нужным PID.

Чтобы отфильтровать список и сразу найти сетевое соединение с нужным PID перенаправим результаты netstat в утилиту findstr “PID_number”, где PID_number – идентификатор искомого процесса.

В найденных результатах видно, что процесс c PID 15304 (программа OneDrive.exe) использует несколько сетевых портов: 11906, 11907, 11908.

Обращайте внимание на то, для какого траспортного протокола открыт порт: ТСР или UDP. Это информация будет важна, когда будете пробрасывать порт через межсетевой экран.

Using NetStat to Check for Open Ports in Windows 10

One of the simplest ways to check for open ports is to use NetStat.exe. You can find this tool in the System32 folder on Windows 10. With NetStat, you can see open ports or ports that a specific host uses.

Netstat is short for network statistics. It shows protocol statistics and the current TCP and IP network connections. The two commands needed to identify open ports in netstat -ab and netstat -aon.

Here’s an explanation of what each letter from the commands means.

Two commands are helpful, depending on your needs. The second option (netstat -aon) additionally provides a process ID you can later search for in the Task Manager.

Using ‘netstat -ab’ to Identify Open Ports

The first option you’ll use (netstat -ab) lists all active ports and the process’s name that uses them.

:/>  Скачать Directx 11 для Windows 10 64 bit

Checking for Open Ports Using PortQry. exe

With portqry.exe, you insert specific parameters that you find in the executable’s folder.

How to Run PortQry. exe using Command Prompt

For those that prefer to use a graphical interface instead of commands when using PortQry.exe, Microsoft offers an add-on named PortQryUI.


Команда Windows Netstat для проверки открытых портов в Windows

The PortQryUI add-on already includes the necessary version of PortQry, so you don’t need both downloads to use it.

In closing, knowing how to check whether a specific port is open or not can come in handy if you’re troubleshooting a program’s network connection or need a port for a particular game. Luckily, it’s not as challenging to do as it looks.

Out of all the options listed above, Netstat is recommended as it’s built into the OS and usually gives you all the details you need. There might be a few extra steps required compared to CurrPorts, but you don’t have to download anything, and there’s nothing to screw up.

How do I check if Port 3306 is open in Windows 10?

To verify if port 3306 is open, you can use NetStat, CurrPorts, or PortQry.

To check if port 3306 is open via CurrPorts, just sort by Local Port, then find port 3306. If the port is available, it will show in the list.

What are Predefined Services in PortQueryUI?

Predefined Services offers details on a small handful of predefined services such as Domains and Trusts, Networking, Exchange Server, etc. The option queries all required ports for the specified services and displays them in the window of the UI.

For those who don’t know where Predefined Services resides, it is directly under the Help tab and in the UI. Both serve different needs.

The Help tab option immediately displays all predefined services without testing any ports. It is a quick reference to each port name, value, and protocol used for each listed service.

The UI option lets you specify what service you want to view and see port statuses.

Checking for Open Ports with NirSoft CurrPorts

If you find the Command Prompt solution too tricky, a simpler alternative is to use NirSoft CurrPorts. This tool displays your currently opened ports (TCP, IP, and UDP). You’ll also see information about a specific process, such as name, path, version info, etc.

This tool has been around for quite a while and is available for Windows 10. You can find the NirSoft Currports download link at Nirsoft’s website towards the bottom.


Команда Windows Netstat для проверки открытых портов в Windows

Note: Ensure you download the correct version. They have and versions. The app is portable. Unzip the folder, then run the executable file.

Другой способ — дважды щелкнуть процесс, чтобы увидеть его детали в одном окне.

Оставьте комментарий