NMAP – Find Machines On Your Network

| | | | | | | | | |

NMAP (a form of ARP list) is a tool for scanning your network for machines that are up or down along with pulling some helpful information from the machines that are up.

Similar to Remotely Find Raspberry Pi IP but this is a bit more in-depth

First install nmap if needed

sudo apt-get install nmap
sudo yum install nmap
brew install nmap iproute2mac

Now you need to know your IP range to do a proper scan

ip addr show
# look for inet, something like 192.168.1.0/24
ip addr show | grep inet | grep -v "inet6" |sed "s/^[ \t]*//"| cut -d " " -f2 | grep -v "127.0.0.1/8"
#Scan a network to find out which servers/devices are up
nmap -sP 192.168.1.0/24

#Scan a Single Host
nmap 192.168.1.2

#Scan multiple IP address or subnet
nmap 192.168.1.1 192.168.1.2 192.168.1.3

#Scan Excluding a Host
nmap 192.168.1.0/24 --exclude 192.168.1.10

#Fast Nmap Scanning for a Network range
nmap -F 192.168.1.10/24

#To See Packets send and receiving using Nmap
nmap --packet-trace 192.168.1.10

#Scan for a Port
nmap -p 22 192.168.1.10

#Scan for multiple ports
nmap -p 80,22,21,111

#Scan all Ports Using Nmap
nmap -p "*" 192.168.1.10
Originally Posted on March 23, 2017
Last Updated on May 22, 2019
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.