Lab Solution
Step 1: Open the lab link to access the Kali Linux terminal instance
Step 2: Identify the target IP address
Before we begin performing a port scan with Nmap, we will need to identify the target IP address.
We can identify the target IP address by running the following command:
Command
ip a
As shown in the following screenshot, identify the IP address associated with the eth1 interface, this is the Kali Linux IP. The target IP address is always the next IP in the subnet.
So if the Kali Linux IP is 192.206.172.2 the target IP will be 192.206.172.3.
Note: In your case, the target IP address will be different, ensure you replace the IP of the target system in your lab environment with the IP address outlined below.
We can ping the target IP to verify that it is active, this can be done by running the following command:
Command
ping 192.206.172.3
As shown in the following screenshot, the host is online and is reachable from our Kali Linux system.
Step 3: Port scanning with Nmap
To begin with, we can perform an Nmap port scan on the target system to identify whether the BIND DNS server is open. This can be done by running the following command:
Command
nmap 192.206.172.3 -p 177 -A
As shown in the following screenshot, the DNS BIND server is running on port 177.
We can now perform a UDP port scan on the port range 1-250, this can be done by running the following command:
Command
nmap 192.206.172.3 -p 1-250 -sU
As shown in the following screenshot, the Nmap scan reveals that the target system has 3 open UDP ports.
Step 4: Service detection with Nmap
Now that we have identified the open UDP ports on the target, we can learn more about the services running on the open ports by performing a service detection scan with Nmap.
This can be done by running the following command:
Command
nmap 192.206.172.3 -p 134,177,234 -sUV
As shown in the following screenshot, the Nmap service detection scan reveals the names and versions of the services running on the open UDP ports on the target system.
The Nmap scan reveals the services running on ports 177 and 234, but not 134. We can perform an Nmap script scan to enumerate information from port 134 by running the following command:
Command
nmap 192.206.172.3 -p 134 -sUV --script=discovery
As shown in the following screenshot, the Nmap script scan does not reveal any useful information regarding the service running on port 134.
Given that we have discovered that UDP ports 177 and 234 are running a DNS and SNMP server respectively, we can assume that port 134 is running the TFTP server.
We can confirm this by running the following command:
Command
tftp 192.206.172.3 134
As shown in the following screenshot, the authentication with the TFTP server is successful and we are provided with an FTP console.
We have successfully been able to identify the ports running the BIND DNS server, SNMP server and TFTP server.
Conclusion
In this lab, we explored the process of performing port scanning and service detection with Nmap.