NMAP, PING vs Test-Connection, Test-NetConnection

Most of the basic network checks start generally with name resolution (nslookup) , ping and trace route (tracert). These tools are powerful enough to check if everything is working as expected: i.e. NIC, DNS, FIREWALL or in general any SW or HW device is configured correctly or is having any issue.

Nmap
It’s a very powerful network scanner.  It’s not installed by default, except from some gnu/linux security distribution.

“With great power comes great responsibility” [Superman], so use this tool just on you networks due port scanning legal implications.

Installing nmap with APT (debian, ubuntu, wsl , etc.):

With YUM (redhat, centos, etc.):

Check if a multiple hosts are alive:

Ping

Ping command operates on ICMP protocol and check if a host, identified by name or IP, is alive and how fast is responding.

But what if we want to check if a port is open or not with PowerShell? That can be handy for testing not just security purpose and that can be integrated in other scripts.

 PowerShell : Test-Connection

Do you need a boolean value as rusult?

Checking open ports on multiple hosts:

IP range and network

Checking if specific ports are open

 PowerShell : Test-NetConnectionTest

 

Third Party

There are other useful tools such netscanner from softperfect included in sysinternals.

Final Consideration

Firewalls can block Ping (ICMP Echo requests), this tools are used also to start to test them. Nmap it’s a very powerful tool, ping is highly used as well. PowerShell has simple and similar cmdlets that can make your scripts more robust.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.