About nmap
aka ‘Network Mapper’
- Tool for network discovery and security audit
- Port scanner
- OS detection
- Version detection
- Audit Webservers and Databases
- Audit mail servers
- Extend it with Nmap Scripting Engine (NSE)
- and much more
Jargon
Pre-requisite installations
Install the nmap
tool
1
sudo apt-get install nmap
Exercises
Pre-requisite
Find the following for your host:
- IP Address
- Subnet Mask
- MAC address
- Interface Name
Use the following command:
1
ifconfig
Here is a snapshot of the output for one of the interfaces on my host.
Here is a sample information filled for my host. You can note the details for your host. You can take up the quiz and fill the details here. Please mask the last two octets of the MAC address as xx
as shown below.
Name | My host value | Your host value |
---|---|---|
IP Address | 192.168.1.13 | |
Subnet Mask | 255.255.255.0 | |
MAC address | 08:00:27:f0:xx:xx | |
Interface Name | enp0s10 |
Note: Many a times you may have number of interfaces and hence you may see multiple interfaces enumerated after you give the
ifconfig
command.
Exercise #1: Scan all devices connected to network aka network reconnaissance
Objective of the exercise is to find what are the other devices that are connected on the network. These could PCs, laptops, routers, switches, IoT devices including smart bulbs, smart switches, Alexa enabled device, Google Home device etc.
Fire the following command to scan devices in your network. The option -sn
is for performing a ping scan and disable port scan.
1
nmap -sn 192.168.1.1/24
As you see there are seven hosts (with corresponding IP addresses) that are connected on the network.