Navigating Cyber Enchantments with Nmap

CybersecurityCybersecurityBeginner
Practice Now

Introduction

In the mystical realm of Bennister Island, a place teeming with magic and untold secrets, there exists a curious character, a fantasy botanist, known amongst the rarefied circles as 'The Sage of the Silent Glade'. With an insatiable curiosity for discovering and cataloging the island's fantastical flora, the Sage has stumbled upon an ancient digital artifact, a relic from the cyber realms, that hinted at the existence of 'Cyber Seeds' - digital entities capable of sprouting into wondrous virtual plants, offering unheard-of protective capabilities against dark cyber entities.

However, accessing these 'Cyber Seeds' is no ordinary feat. It requires navigating through a labyrinth of ancient servers, hidden deep within the island's digital underbelly, protected by layers of cyber enchantments. The Sage, though unparalleled in the knowledge of fantastical botany, finds themselves at the threshold of an unfamiliar domain - Cybersecurity.

To assist The Sage in their quest, you are tasked with mastering the arcane art of Nmap, deploying various scanning techniques to navigate through the server's defenses, and unveil the locations of the fabled 'Cyber Seeds'. Your journey into the cybernetic unknown begins now.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL cybersecurity(("`Cybersecurity`")) -.-> cybersecurity/NmapGroup(["`Nmap`"]) cybersecurity/NmapGroup -.-> cybersecurity/nmap_scan_types("`Nmap Scan Types and Techniques`") subgraph Lab Skills cybersecurity/nmap_scan_types -.-> lab-280256{{"`Navigating Cyber Enchantments with Nmap`"}} end

Setting up the Environment

In this step, you'll establish the foundational setup required for your quest to assist the Sage. You'll create a fictional server within the local scope of your machine to simulate the ancient server mentioned in the narrative. This will serve as your practice ground for deploying Nmap scans.

1.Setting the working directory

Open a terminal and navigate to the /home/labex/project directory. This will be your working directory for this lab.

cd /home/labex/project

Then, simulate a server endpoint by setting up a Docker container with an open port. Donโ€™t worry if you havenโ€™t done this before, follow the steps below:

2. Creating the Dockerfile

In your working directory, create a new file named Dockerfile. This file will contain the instructions for building your Docker image.

touch Dockerfile

Open the Dockerfile in a text editor of your choice and add the following content:

## Use the nginx image as the base
FROM nginx

## Expose port 80
EXPOSE 80

Save and close the file.

3.Building the Docker image

Now you will build your Docker image, using the Dockerfile you just created. In your terminal, run the following command:

docker build -t cyber-seed-portal .

This command tells Docker to build an image using the current directory (.) as the context, and to tag the image as "cyber-seed-portal".

4.Running the Docker container

Now that your image is built, you can create and run a new container from it. Use the following command to do this:

docker run --name cyber-seed-server -d -p 8080:80 cyber-seed-portal

This command tells Docker to run a new container in detached mode (-d), map port 8080 of your machine to port 80 of the container (-p 8080:80), name the container "cyber-seed-server" (--name cyber-seed-server), and use the "cyber-seed-portal" image.

Now, you have a locally accessible server mimicking the ancient server's endpoint for your practice.

Discovering the Portal

In this step, you will employ the Nmap scanning tool to locate the open port on your local server, which symbolizes the gateway to the digital domain enclosing the 'Cyber Seeds'.

Execute an Nmap scan to discover open ports on your localhost:

nmap -p- localhost

The results look like the following:

Starting Nmap 7.80  at 2024-03-15 10:59 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00011s latency).
Not shown: 65529 closed ports
PORT      STATE SERVICE
22/tcp    open  ssh
3000/tcp  open  ppp
3001/tcp  open  nessus
3002/tcp  open  exlm-agent
8080/tcp  open  http-proxy
36921/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 2.12 seconds

Look for the open port 8080/tcp in the scan results. This open port represents the portal through which you'll venture deeper into your quest.

Summary

In this lab, you embarked on a journey blending the mystical with the cybernetic, aiding the enigmatic Sage of the Silent Glade in their quest to uncover the mythical Cyber Seeds. Starting with setting up a simulated server environment, you honed your skills in executing basic to advanced Nmap scanning techniques, each step uncovering a piece of the digital puzzle lying in wait. Your endeavors not only brought enlightenment to the Sage but also ingrained in you the significance and versatility of Nmap within the Cybersecurity domain. Through your journey, you've wielded these newfound skills with precision, potentially unlocking doorways to your own cyber quests in future.

Other Cybersecurity Tutorials you may like