Skip to content
Home » nmap: A Beginner’s Guide to Network Mapping and Scanning

nmap: A Beginner’s Guide to Network Mapping and Scanning

Are you looking to improve your network security or just want to learn more about network mapping tools? Look no further than nmap!

nmap, short for Network Mapper, is a free and open-source tool that allows you to scan networks and gather information about the hosts that are connected to it. It can be used to detect live hosts, open ports, and running services on a network, as well as to discover vulnerabilities and misconfigurations. nmap is a powerful tool that is widely used by network administrators and security professionals, but it is also accessible for anyone to learn and use.

Tips

  1. Scan a single host: To scan a single host, use the following command: nmap <ip address>
  2. Scan a range of hosts: To scan a range of hosts, use the following command: nmap <start ip address>-<end ip address>
  3. Scan a subnet: To scan a subnet, use the following command: nmap <subnet>/<mask>
  4. Scan using a list of hosts: To scan a list of hosts, create a text file with one IP address or hostname per line, and use the following command: nmap -iL <input file>
  5. Scan using hostnames: To scan using hostnames, use the following command: nmap -sn <hostname>

Examples

Example 1: Scan a single host

nmap 192.168.1.1

Starting Nmap 7.80 ( <https://nmap.org> ) at 2022-12-29 14:00 EST
Nmap scan report for 192.168.1.1
Host is up (0.0056s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

In this example, we used nmap to scan the host with the IP address 192.168.1.1. The output shows that the host is up and that it has two open ports: 22 for ssh and 80 for http.

Example 2: Scan a range of hosts

nmap 192.168.1.1-192.168.1.255

Starting Nmap 7.80 ( <https://nmap.org> ) at 2022-12-29 14:05 EST
Nmap scan report for 192.168.1.1
Host is up (0.0054s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Nmap scan report for 192.168.1.2
Host is up (0.0072s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

...

Nmap scan report for 192.168.1.255
Host is up (0.041s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

In this example, we used nmap to scan a range of hosts from 192.168.1.1 to 192.168.1.255. The output shows that all 255 hosts are up and have two open ports: 22 for ssh and 80 for http.

Example 3: Scan a subnet

nmap 192.168.1.0/24

Starting Nmap 7.80 ( <https://nmap.org> ) at 2022-12-29 14:10 EST
Nmap scan report for 192.168.1.1
Host is up (0.0055s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Nmap scan report for 192.168.1.2
Host is up (0.0071s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

...

Nmap scan report for 192.168.1.255
Host is up (0.041s latency).
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

In this example, we used nmap to scan the subnet 192.168.1.0/24. The output shows that all 255 hosts in the subnet are up and have two open ports: 22 for ssh and 80 for http.

Key takeaways

  • nmap is a powerful and versatile tool for network mapping and scanning
  • It can be used to detect live hosts, open ports, and running services on a network
  • It can also be used to discover vulnerabilities and misconfigurations
  • It is easy to learn and use, even for beginners
  • For stealth scanning, read this article.

Challenge

Try using nmap to scan your own network and see what information you can gather. Can you find any open ports or running services?

In conclusion, nmap is a valuable tool for anyone looking to improve their network security or learn more about network mapping. Whether you are a network administrator or just starting out in the field, nmap is a useful tool to have in your toolkit.

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × five =