Detect the number of machines on a network with Nmap

detect the number of machines on a network with nmap

Nmap, for those unfamiliar with it, is an open source port scanner that allows network browsing and obtaining information about the operating system from a remote computer.

It is available under Linux, Windows and Mac OS. If you still haven't read my article on how to use nmap, I advise you to go there now.

In this article, we will see a tip which consists of using the Nmap software to scan a network and then know the number of computers under Windows, Linux or Mac. The goal will be to get an idea of ​​the operating systems that are used around you.

Here is the command that launches this analysis. You must of course adapt the range of IP addresses to scan according to that of your local network:

nmap -O | grep “Running:” | fate | uniq -c

The -O option is used to detect the operating system. The latter will then send TCP packets with abnormal sets of IP options. And by examining the responses received, it will be able to know the operating system used.

In my case I got the following result:

1 Linux
1 window
1 Apple

The Nexus 5, the iPad and my personal machine being under Windows.