Проверить открыт ли порт windows cmd

Обмен данными по локальной сети или через интернет осуществляется путем подключения друг к другу двух компьютеров. Чтобы получить данные с удаленного сервера, требуется соблюсти несколько условий – наличие IP-адреса у источника и получателя, выбор конкретного протокола приема-передачи и открытые порты на обоих компьютерах.

Что такое порт компьютера

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

Проверка порта на доступность

Особенности портов:

  1. Иногда порты путают с разъемами на материнской плате (формально они и являются ими, но там речь идет о подключении физических устройств).
  2. Общее количество портов составляет 65535. Они имеют определенное назначение, например, 20-21 «по умолчанию» используется для соединения по FTP, а 110 выделен под почтовый протокол POP3.
  3. Сочетание IP-адреса и порта принято называть сокетом или файловым дескриптором, при помощи которого программа передает данные.

Перед подключением к какому-либо порту рекомендуется проверить, свободен ли он. Если нет, то операционная система выдаст ошибку, и соединение прервется. Многие программы делают проверку в автоматическом режиме и сами пытаются менять номера в поиске незанятого подключения. Но в ряде случаев это требуется сделать вручную, например, при отладке собственного кода.

Комьюнити теперь в Телеграм

Подпишитесь и будьте в курсе последних IT-новостей

Подписаться


Как проверить, открыт ли порт для подключения

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

Открыт ли порт

Существует три основных способа проверки открытых портов:

  1. Специализированные онлайн-сервисы.
  2. Прикладные приложения, запускаемые на компьютере.
  3. Встроенные в операционную систему утилиты.

Выбор решения зависит от задач. Так, если требуется открыть доступ к своему компьютеру извне, можно воспользоваться сервисами 2ip.ru или portscan.ru. При локальных работах удобнее приложения типа Portforward Network Utilities или штатная утилита TELNET. Она поставляется в «стандартной» сборке Windows и доступна для запуска в консоли CMD.

Перечень открытых портов на локальном компьютере

Открытый порт на домашнем или рабочем компьютере – это фактически «дыра» в безопасности и риски утраты контроля над ситуацией. Именно через них проникают трояны и иные вирусы, которые имеют цель предоставить злоумышленнику возможность удаленного подключения к ПК без разрешения владельца. 

Командная строка

Проверить занятые порты легко:

  1. Нужно нажать комбинацию клавиш <Win+R>.
  2. Ввести команду CMD и нажать кнопку Enter.
  3. Ввести команду netstat –a и повторно нажать Enter.

В консоли отобразится перечень занятых портов с указанием, какое приложение или служба ими «распоряжается». Такой вариант проверки интересен тем, что он дает объективную картину. Если рассчитывать только на онлайн-сервисы, иногда создается впечатление, что открытых портов нет. Эффект создается из-за блокировки внешних запросов брандмауэром Windows или другим ПО.

Порт телнет

Если хочется изучить список на предмет «посторонних» программ, его лучше выгрузить в файл при помощи команды netstat –a >имя.txt. По умолчанию список сохраняется в каталоге пользователя, в аккаунте которого происходил запуск утилиты (типа C:\\Пользователи\User\). При желании перед запуском утилиты можно перейти в корень диска командой cd c:\.

VDS Timeweb арендовать

Просмотр открытых портов на удаленном компьютере

При взаимодействии с удаленным сервером используется другая утилита – TELNET. В Windows она по умолчанию отключена, потому что не относится к пользовательским приложениям. Перед первым запуском придется провести «активацию». Существует два способа включения – в консоли или через графический интерфейс.

Запуск утилиты telnet

Активация заключается во вводе специальной команды:

dism /online /Enable-Feature /FeatureName:TelnetClient

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

  1. Нажать комбинацию клавиш <Win+X>.
  2. Выбрать пункт «Командная строка (администратор)».
  3. В открывшемся окне ввести команду активации telnet.

Команда telnet

Если пользователь предпочитает управлять компьютером через графический интерфейс, нужно запустить панель управления, а в ней утилиту «Удаление программы». В открывшемся окне нужно перейти в раздел «Включение или отключение компонентов Windows», далее в общем списке найти строку «Telnet», поставить в ней галочку и нажать кнопку ОК. Все, служба активирована и готова к использованию (даже в консоли).

клиент Телнет

Синтаксис:

telnet опции хост порт

Хост – это домен или его IP-адрес, порт – виртуальное дополнение для образования сокета, опции же позволяют менять режим подключения. Их основные варианты:

  1. -4 – использовать адреса стандарта IPV4;
  2. -6 – использовать адреса стандарта IPV6;
  3. -8 – применять 8-битную кодировку типа Unicode;
  4. -E – отключение поддержки Escape-последовательностей;
  5. -a – вход с именем пользователя из переменного окружения User;
  6. -b – использовать локальный сокет;
  7. -d – включить режим отладки;
  8. -p – режим эмуляции rlogin;
  9. -e – задать символ начала Escape-последовательности;
  10. -l – пользователь для авторизации на удаленном сервере.

Простейший вариант проверки открытых портов – это ввод команды без опций:

telnet 10.0.119.127 80

Если на экран будет выведено сообщение «Сбой подключения», порт закрыт, нужно подбирать другой номер. Если порт открыт, пользователь увидит пустой экран или приглашение со стороны сервера ввести логин и пароль.

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.

Как посмотреть список открытых портов в Windows

Статья обновлена: 10 сентября 2021
ID: 101

Чтобы посмотреть список открытых портов:

  1. Откройте командную строку. Инструкция в статье.
  2. Выполните команду:

netstat -a

  1. Нажмите Enter на клавиатуре.

Переход к просмотру списка открытых портов

Вы получите список открытых портов в Windows.

Спасибо за ваш отзыв, вы помогаете нам становиться лучше!

Спасибо за ваш отзыв, вы помогаете нам становиться лучше!

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

  • Что такое порт
  • Как проверить, открыт ли порт

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

Вы можете узнать, открыт ли порт, с помощью нашего сервиса проверки доступности портов.

Что такое порт

Порт — это числовой идентификатор программы или процесса, который обслуживает сетевые соединения на заданном IP-адресе. Номера портов могут быть от 0 до 65 535.

Каждое устройство (компьютер, ноутбук, мобильный телефон и др.) имеет свой IP-адрес. Он дает возможность организовывать сетевые соединения между устройствами. Но на отдельном устройстве может быть запущено несколько сетевых приложений одновременно. Например, есть интернет-сервер с IP-адресом. На нем расположен: веб-сервер, почтовый сервер, FTP-сервер. Как сделать так, чтобы мы могли связаться именно с почтовым сервером? Для этого и нужен порт. Порты предоставляют возможность идентифицировать сетевые приложения на отдельно взятом компьютере.

Есть стандартные порты, такие как:

  • порт 80 — для  веб-сервера, который работает по протоколу HTTP,
  • порт 443 — для защищенного SSL-сертификатом веб-сервера, который работает по протоколу HTTPS,
  • порт 21 — для FTP-протокола (протокола передачи файлов).

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

Проверка порта на доступность возможна как для своего (локального) компьютера , так и для удаленного.

Как узнать, какие порты открыты на локальном компьютере в Windows

  1. Вызовите командную строку сочетанием клавиш Win+R

  2. Введите команду «cmd» и нажмите ОК:

  1. Пропишите команду netstat -a и кликните Enter:

Готово, перед вами список открытых портов на вашем компьютере.

Как узнать, какие порты открыты на удаленном компьютере

Провести проверку портов на открытость удаленного компьютера можно при помощи команды telnet.

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

В Windows 7/8/10 и Vista утилита telnet отключена по умолчанию. Утилиту можно установить по инструкции.

Как проверить доступность порта с помощью команды telnet в Windows:

  1. Вызовите командную строку сочетанием клавиш Win+R.

  2. Введите команду «cmd» и нажмите ОК.

  3. В окне терминала введите команду:  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.

  1. Select the Start menu and type «command.» Right-click on the Command Prompt app and select Run as administrator.

  2. 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).

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

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

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

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Время блокировки рабочего стола windows 10
  • Ошибка пакета windows installer при удалении itunes
  • Какие объекты образуют графический пользовательский интерфейс ос windows
  • Проблема с установкой windows на asus x541n
  • Windows 64 bit jdk download 64 bit