Introduction
In this challenge, you'll step into the role of a junior network engineer tasked with identifying an open port on a critical server at Luna Gateway Spaceport. The server, located at IP address localhost, is experiencing network issues, and your mission is to use Nmap to scan for open ports and record the findings.
Your task involves using the nmap command with the appropriate options to scan all ports on the target IP address and save the complete Nmap scan output to the file /home/labex/project/luna_server_scan.txt. The goal is to pinpoint the open port number and ensure the scan was performed correctly on the specified IP address.
Find Open Port on Luna Server
A critical server at Luna Gateway Spaceport is experiencing network issues. As a junior network engineer, use Nmap to find the open port on the server and report it to the team.
Prerequisites
Run the following command to start the dummy service on port 7777:
while true; do nc -n -lvp 7777; done &
Tasks
- Use Nmap to scan the Luna server at IP address
localhostfor open ports. - Identify and record the open port number in the file
/home/labex/project/luna_server_scan.txt.
Requirements
- You must use the
nmapcommand to scan the target IP address. - You must specify the target IP address as
localhost. - You must save the Nmap scan output to the file
/home/labex/project/luna_server_scan.txt. - You must scan all ports.
- You must execute the
nmapcommand in the~/projectdirectory.
Examples
The /home/labex/project/luna_server_scan.txt file should contain output similar to:
Starting Nmap ...
Nmap scan report for localhost
Host is up (0.00010s latency).
PORT STATE SERVICE
7777/tcp open cbt
...
Hints
- Remember to use the correct Nmap syntax to specify the target IP address and save the output to a file.
- Use the
-p-option to scan all ports. - Check the Nmap output carefully to identify the open port.
Summary
In this challenge, the task involves using Nmap to identify an open port on the Luna server at IP address localhost. The process includes setting up a dummy service on port 7777 for testing, performing a full port scan using the nmap command with the -p- option, and saving the scan output to the /home/labex/project/luna_server_scan.txt file.
The key learning points are understanding how to use Nmap for port scanning, specifically targeting a specific IP address and saving the output to a file. The challenge also emphasizes the importance of verifying the scan results to ensure the correct IP address was targeted and that the output file exists.



