Challenge 1: Network Scanning
Procedure:
The first step is always reconnaissance. We need to identify all of the relevant targets in our network and find out what they're running.
- Use Nmap to run a basic scan on the subnet your Kali machine is connected to. You should find four hosts in your results, not including your own Kali machine.
- Hint: Where can you find the subnet range of your Kali VM?
- Reminder: Running Nmap with root privileges might give you a lot more results than intended, showing hosts that are online but with no open ports. Re-run the scan as a normal user (without sudo) or ignore the results with no ports open.
- Next, run service and version detection scans on the specific IP addresses found in your first scan. Scan for services beginning at port 1 and ending at port 5000.
- Hint: How do you perform a service and version scan in Nmap?
- Hint: How do you specify a range of ports to scan in Nmap?
- Reminder: You can scan all four IP addresses in a single command, or scan them each individually. Remember that the more you do in one scan, the longer it will take.
Interpret your results and determine the following:
-
Which host is running a web server on a non-standard port? What port is it running on?
-
Which host is running an SSH server on a non-standard port? What port is it running on?
-
Which machines are running Windows-based operating systems?
Solution:
- Run a basic scan to check the subnet:
Based on the output provided from
ip addr
command, we can see that the Kali Linux machine is configured with the IP address172.31.39.126
on theeth0
interface, and it's within the/20
subnet. This means the address range you can scan is from172.31.32.0
to172.31.47.255
. Theeth0
interface is configured with an IP in the172.31.32.0/20
subnet, indicating it can communicate with any devices whose IP addresses fall within this range. The subnet setup allows your machine to interact with potentially 4094 hosts (from172.31.32.1
to172.31.47.254
, excluding the network and broadcast addresses).
- Identify which hosts are up in the
172.31.32.0/20
subnet, you can start with a ping sweep using Nmap. This is a non-intrusive way to discover active hosts.
Now that you have identified the active hosts, you can perform more in-depth scans on each of these IP addresses. The goal here is to discover which services are running on each host and to identify any potential vulnerabilities associated with these services. For each host, you might run the following Nmap command, which scans for service versions on commonly used ports:
- Next, run service and version detection scans on the specific IP addresses found in your first scan. Scan for services beginning at port 1 and ending at port 5000.
Which host is running a web server on a non-standard port? What port is it running on?
Host at 172.31.40.22 HTTP (1013/tcp): Running Apache httpd 2.4.52 on Ubuntu. While this is a modern version, Apache servers can be vulnerable to misconfigurations, outdated modules, or specific flaws depending on the site setup.
Which host is running an SSH server on a non-standard port? What port is it running on?
Host at 172.31.40.22 SSH (22/tcp): Running OpenSSH 8.9p1 on Ubuntu. This version is relatively up-to-date, so vulnerabilities are likely minimal. However, ensure that only strong, secure authentication methods (e.g., key-based authentication) are enabled.
Which machines are running Windows-based operating systems?
Host at 172.31.43.103 and 172.31.45.94 Microsoft Windows RPC (135/tcp) NetBIOS Session Service (139/tcp) Microsoft DS (445/tcp): These services are indicative of a Windows environment and are typical in Windows networking but can be vectors for attacks like SMB Relay, Pass the Hash, etc. Microsoft Terminal Services (3389/tcp): Remote desktop protocol service is running, which could be vulnerable to brute force attacks or exploits depending on the RDP configuration and patch level.