Scanning Subnet with Nmap

NmapBeginner
Practice Now

Introduction

In this challenge, you'll apply your knowledge of network scanning using Nmap, a powerful and versatile tool used by cybersecurity professionals. Nmap is essential for discovering hosts, services, and potential vulnerabilities on a network. Your task is to perform a series of scans on localhost addresses, demonstrating your understanding of Nmap's capabilities and interpreting the results.

Perform Network Scans

In this step, you'll use Nmap to scan a range of localhost addresses and analyze the results.

Tasks

  • Use Nmap to scan the first 10 IP addresses in the localhost range (from 127.0.0.1 to 127.0.0.10). This is for simulation purposes.
  • Identify the number of active hosts in this range.
  • Find a host with an SSH service running.

Requirements

  • Execute all commands from the ~/project directory.
  • Use appropriate Nmap options to scan for open ports and identify services.
  • Save the output of the scan to a file named scan_results.txt in the ~/project directory.

Example

After running the scan, your scan_results.txt file might contain output similar to this:

Starting Nmap 7.80 ( https://nmap.org )
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00021s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Nmap scan report for 127.0.0.5
Host is up (0.00025s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 10 IP addresses (2 hosts up) scanned in 1.25 seconds
✨ Check Solution and Practice

Summary

In this challenge, you applied your knowledge of Nmap to perform a network scan on a range of localhost addresses. You learned how to execute a basic Nmap scan, save the results to a file, and interpret the output to gather important information about local services.

This exercise reinforces the importance of network scanning in cybersecurity and system administration. By identifying active hosts and open services on the localhost range, you've simulated a common task performed by professionals to maintain system security and service inventory.

Remember, in real-world scenarios, always ensure you have proper authorization before scanning any network. Unauthorized scanning can be illegal and unethical.