Windows testing open ports

Проверка порта

PortScaner.ru Port Checker — это бесплатный онлайн инструмент, чтобы найти открытые порты в вашей системе или на удаленном сервере. Этот инструмент позволяет сканировать открытые порты, которые могут оказаться дырами в безопасности и послужить лазейкой для хакеров. Вы также можете проверить, работает ли перенаправление портов на вашем роутере или нет.

Что такое проверка открытых портов?

Этот инструмент полезен для проверки порта в маршрутизаторе открыт он или закрыть. Это онлайн инструмент безопасности проверки порта открыт или заблокирован в вашей системе брандмауэром.

Какие порты бывают?

Порты являются виртуальными путями, по которым информация передается от компьютера к компьютеру. Всего есть 65536 портов на выбор..

Порты 0 до 1023 — Самые известные номера портов. Наиболее популярные службы работающие на портах: база данных MS SQL (1433), почтовые услуги POP3 (110), IMAP (143), SMTP (25), веб-сервисы HTML (80).

Порты от 1024 до 49151 — зарезервированные порты; это означает, что они могут быть зарезервированные для конкретных протоколов программного обеспечения.

Порты 49152 по 65536 — динамические или частные порты; это означает, что они могут быть использованы кем угодно.

Что такое проброс портов? (Port Forwarding)

Переадресация портов (Port Forwarding) имеется специальная функция на маршрутизаторе которая позволяет передачу пакетов данных извне (из Интернета) к устройствам или компьютерам в вашей локальной сети (LAN). По умолчанию все порты на маршрутизаторе закрыты, чтобы предотвратить взлом компьютеров вашей локальной сети. Но когда вы используете службу для подключения через порт на маршрутизаторе вам нужно открыть его. Например: Yahoo! Messenger вам необходимо чтобы один из следующих портов был открытым: 5061, 443, 80.

Test-NetConnection: проверка открытых/закрытых TCP портов из PowerShell

В PowerShell 4.0 (Windows 2012 R2, Windows 8.1 и выше) появился встроенный командлет для проверки сетевых соединений — Test-NetConnection. С помощью данного командлета вы можете проверить доступность удаленного сервера или сетевой службы на нем, блокировку TCP портов файерволами, проверить доступность по ICMP и маршрутизацию. По сути, командлет Test-NetConnection позволяет заменить сразу несколько привычных сетевых утилит: ping, traceroute, сканер TCP портов и т.д.

Основное преимущество командлета Test-NetConnection – он уже входит в состав всех современных версий Windows и вам не нужно устанавливать его отдельно. Командлет входит в состав модуля NetTCPIP (начиная с PoSh v4.0).

Значение 4 в столбце Major говорит о том, что на компьютере установлен PowerShell 4.0.

TCP Port Ping: Использование Test-NetConnection для проверки открытых портов и доступности серверов

Проверим, открыт ли порт TCP 25 (SMTP протокол) на почтовом сервере с помощью Test-NetConnection:

Test-NetConnection -ComputerName msk-msg01 -Port 25

В сокращенном виде аналогичная команда выглядит так:

TNC msk-mail1 -Port 25

Разберем результат команды:

Как вы видите, командлет выполняет разрешение имени сервера в IP адрес, выполняется проверка ответа ICMP (аналог ping) и доступность TCP порта. Указанный сервер доступен по ICMP ( PingSucceeded = True ) и 25 TCP порт также отвечает ( RemotePort=25, TcpTestSucceeded= True ).

Читайте также:  Openjdk ��� mac os

У командлета есть специальный параметр –CommonTCPPort, позволяющий указать наименование известного сетевого протокола (HTTP, RDP, SMB, WINRM).

Например, чтобы проверить доступность веб-сервера, можно использовать команду:

Test-NetConnection -ComputerName winitpro.ru -CommonTCPPort HTTP

Test-NetConnection msk-rds1 –CommonTCPPort RDP

Можно вывести все параметры, которые возвращает командлет Test-NetConnection:

Test-NetConnection msk-man01 -port 445|Format-List *

Если нужна только информация по доступности TCP порта, в более лаконичном виде проверка может быть выполнена так:

TNC msk-mail1 -Port 25 -InformationLevel Quiet

Командлет вернул True, значит удаленный порт доступен.

(New-Object System.Net.Sockets.TcpClient).Connect(‘msk-msg01’, 25)

В Windows 10/ Windows Server 2016 вы можете использовать командлет Test-NetConnection для трассировки маршрута до удаленного сервера при помощи параметра TraceRoute (аналог tracert). С помощью параметра Hops можно ограничить максимальное количество хопов при проверке.

Test-NetConnection msk-man01 –TraceRoute

Командлет вернул сетевую задержку при доступе к серверу в милисекундах ( PingReplyDetails (RTT) : 41 ms ) и все IP адреса маршрутизаторов на пути до целевого сервера.

Test-NetConnection в скриптах мониторинга

Следующая команда позволить проверить доступность определенного порта на множестве серверов, список которых хранится в текстовом файле servers.txt. Нас интересуют сервера, где искомая служба не отвечает:

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

Например, вы можете проверить доступность основных служб на всех контроллеров домена (список DC можно получить командлетом Get-ADDomainController). Проверим следующие службы на DC (в утилите PortQry есть аналогичное правило Domain and trusts):

  • RPC – TCP/135
  • LDAP – TCP/389
  • LDAP – TCP/3268
  • DNS – TCP/53
  • Kerberos – TCP/88
  • SMB – TCP/445

$Ports = «135»,»389″,»636″,»3268″,»53″,»88″,»445″,»3269″, «80», «443»
$AllDCs = Get-ADDomainController -Filter * | Select-Object Hostname,Ipv4address,isGlobalCatalog,Site,Forest,OperatingSystem
ForEach($DC in $AllDCs)
<
Foreach ($P in $Ports)<
$check=Test-NetConnection $DC -Port $P -WarningAction SilentlyContinue
If ($check.tcpTestSucceeded -eq $true)
«>
else
» -ForegroundColor Red>
>

Скрипт проверит указанные TCP порты на контроллерах домена, и, если один из портов недоступен, выделит его красным цветом (с небольшими доработками можно запустить данный PowerShell скрипт как службу Windows).

Сканер сети на PowerShell

Также вы можете реализовать простой сканер портов и IP подсетей для сканирования удаленных серверов или подсетей на открытые/закрытые TCP порты.

Просканируем диапазон IP адресов на открытый порт 3389:

foreach ($ip in 5..30)

Просканируем диапазон TCP портов от 1 до 1024 на указанном сервере:

How to Check Open Ports in Windows 10 Using CMD

In this article, you will see the procedure to Check Open Ports in Windows 10 Using CMD (or Command Prompt). When an app uses a TCP/IP port on your device in order to access a network, that port would be locked out – no other program may be able to use it. And while everything related to ports and traffic is usually taken care of on its own by the system, there might be situations when you might have to know the application that is blocking a specific port.

Here you can find some built-in ways to do so- specifically the ways to check open ports using CMD or Command Prompt. Apart from using the Command Prompt, you can even consider using some third-party applications that can easily list the ports and the apps or processes that are using them.

Way to Check Open Ports in Windows 10 Using CMD

Here is how to check open Ports in Windows 10 Using CMD –

Читайте также:  Windows конвертировать диск gpt to mbr

To find port-use with process names

Follow along with these steps to get the list of ports in use and the names of the processes tied up with them respectively.

Step-1: Open Run dialog box by pressing Win+R hotkeys. Type cmd in the text box and hit Shift + Ctrl + Enter keys altogether.

Step-2: Hit Yes on the UAC prompt.

Step-3: This will let you access an elevated Command Prompt on the screen. Here, type in or copy-paste the below-given code and hit Enter.

Wait for the entire result to load. Once you successfully run this command, simply scroll down to the port number you want to check. As shown below, you’ll be able to see the process’ name respectively below the port it is linked to.

To find port-use with the process identifiers

Usually, identifying the application which represented by a specific process name can be tricky. This method might help you identify the application that a process relates to.

Here also, first of all, launch the “Command Prompt” with admin rights using any of your preferred methods.

Copy-paste or type the below code and ensure to hit Enter.

Finally, the result now will contain the “PID” or the process identifiers instead of the names. Simply scroll down to the port you want to check and note the PID corresponding to it.

Moving ahead, open Task Manager. To do so, perform a right-click on the taskbar and select the option namely “Task Manager”.

Go to the Processes tab. Right-click on the Name column and choose PID (see snapshot).

You just need to find the PID you note earlier. The ‘Name’ column corresponding to the PID must reveal the application associated with the port.

Scanning Open Ports in Windows: A Quick Guide (Part 2)

This post has been reviewed and the information is still relevant as of June 2018.

In early 2012, I wrote an article called Scanning Open Ports in Windows: A Quick Guide that covered how to use NetStat.exe, Tasklist.exe, TCPView.exe and PortQry.exe and Scanning Open Ports in Windows: Part 3 that covered how to use NMAP to view open ports and troubleshoot client or server side application network connectivity issues. This article is a continuation of that and discusses three more free tools you can use to check for open ports – Telnet, CurrPorts.exe and TCPEye.exe.
[ulp >

Telnet

To get started, one tool I thought would be worthy of a brief mention is Telnet. Using the telnet command you can quickly test if a specific port is open on a host in your network. To do this:

  1. Open a command prompt window
  2. Type telnethostnameport_number or telnetip_address port_number

Replace hostname or ip_address with the name or IP address of the machine you wish to connect to, and port_number with the port number you want to test. You will see a blank screen if the connection was successful (indicating that the specified port is open).

Note: On Windows Vista/7/8, Telnet is disabled by default. To enable it:

  1. Go to the Control Panel >Programs and Features >Turn Windows features on or off
  2. Check Telnet Server and Telnet Client
  3. Click OK to have the features installed.

CurrPorts

Another handy tool to add to your collection is CurrPorts. CurrPorts runs as a standalone application that displays all open TCP and UDP ports on your local computer and detailed information about which process opened those ports. Using this tool, you can also:

  1. Close unwanted TCP connections (when run under an admin account)
  2. Kill the process that opened the port
  3. Export the TCP/UDP port information to a file
  4. Filter the information that is displayed to show or hide TCP/UDP ports, ports that are listening, established, closed, and even flag ports that are not associated with a known application.
Читайте также:  Консольный яндекс диск для windows

To open CurrPorts, simply extract the ZIP file and run CurrPorts.exe. It will immediately list information about all currently open ports. Use the Options menu to filter out which port information you wish to view.

The image below shows what a suspicious connection might look like if you were investigating a local machine. In this example, I created a small console application in C# to simulate client/server network connectivity that connects to port 6996 on the local IP address. You can use the “Remote IP Country” column on the far right of the window to give you a quick indication of where the remote server is located.

Note: In the real-world, a malicious process (e.g. botnet) would have a different remote address (for the purposes of this example the client and server processes are running on the same machine).

Whatever it is that you are investigating, look at the process name and port number together to determine if something seems out of the ordinary. Alternatively, if you are looking for a specific open port, sort the “Local Port” or “Remote Port” column and search for the port number in question.

The status bar at the bottom of the CurrPorts window shows the total amount of ports in use and the number of established remote connections.

TCPEye

Finally, similar to CurrPorts is an application called TCPEye. TCPEye also displays a list of all currently opened TCP/UDP ports on your local computer and shows detailed information about the process that opened the port. Like CurrPorts, TCPEye also allows you to:

  1. View which country the remote server is located
  2. Close unwanted TCP connections
  3. Save TCP/UDP port information into an HTML, XML or CSV file.

One standout feature in TCPEye is that if you notice a suspicious process (e.g. one that is connected to an open port and a remote address), you can right click on it and select “Check with VirusTotal” for the process information to be uploaded and analysed by VirusTotal (as shown in the image below).

One thing to note about TCPEye is that it does not run as a standalone application and will require installation first.

Do you know of any other free or open source tools you use to check for open ports? If so, we’d love to hear from you.

Get your free 30-day trial

Get immediate results. Identify where you’re vulnerable with your first scan on your first day of a 30-day trial. Take the necessary steps to fix all issues.

Get your free 30-day trial

Get immediate results. Identify where you’re vulnerable with your first scan on your first day of a 30-day trial. Take the necessary steps to fix all issues.

Оцените статью