howtothings.co.uk

Full Version: [nmap] How to perform a ping scan on a network
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

There are times when you need to know what devices / machines are on your network, this is how you can find out using a simple ping scan. (-sP)

The following tutorial is for use in Linux and via the Terminal.

1. Open the terminal.

Run as root;

Code:
sudo su

Then we start a simple ping scan.

Code:
nmap -sP 192.168.2.1/24 | grep 192

My result is:

Host wl.Belkin (192.168.2.1) is up (0.00040s latency). (My Router)
Host 192.168.2.2 is up. (Me)
Host 192.168.2.4 is up (0.0028s latency). (Laptop)

Explanation:

nmap: The program we're using
-sP: Ping Scan - go no further than determining if host is online
192.168.2.1: Your routers IP address
/24: A Class C network = 255.255.255.0 = 256 IP addresses
grep: Another program built in to Linux, it means i only want "192" to be taken from the information we receive.
192: The information we want, in this case the IP addresses.