First, you'd need to understand the command you're running..
breaking it down...
nmap (network tool)
-O (OS detection)
-F (Fast mode)
172.x.x.* (the network you're scanning)
| (a pipe)
grep (search for a string in the results)
"Running" (the string you're searching for)
Knowing this, you can figure out that you're hiding the IP from yourself by grepping for only the word 'Running'.
Run it w/o the grep at the end and you'll get something like this:
Code:
Nmap scan report for Chromecast-Audio.blahblahblah.com (192.168.2.210)
Host is up (0.0053s latency).
Not shown: 97 closed ports
PORT STATE SERVICE
8008/tcp open http
8009/tcp open ajp13
8443/tcp open https-alt
MAC Address: 54:60:09:E6:D7:30 (Google)
Device type: general purpose
Running: Linux 2.6.X|3.X
OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3
OS details: Linux 2.6.32 - 3.10
Network Distance: 1 hop
Here, you'll see that if you grep also for a word in that top line.. or the IP you'll get all your info..
Code:
root@kali-arm64:~# nmap -O -F 192.168.2.*| grep 'scan report\|Runn'
Nmap scan report for u1 (192.168.2.163)
Running: Linux 3.X|4.X
Nmap scan report for cc (192.168.2.167)
Running: Linux 2.6.X|3.X
Nmap scan report for ctc-ilo (192.168.2.169)
Running: HP iLO 4.X
Nmap scan report for ctc (192.168.2.170)
Running: Linux 3.X|4.X
Nmap scan report for 192.168.2.209
Nmap scan report for Chromecast-Audio.blahblahblah.com (192.168.2.210)
Running: Linux 2.6.X|3.X
Further, if you use -A instead of -O, you'll not only get OS detection, but also version detection, script scanning, and traceroute results.. giving you more info.. and giving you more to grep for.
Rob