Enumerating target is a process that is used to find and collect information about ports, operating systems, and services available on the target machines. This process is usually done after we have discovered that the target machines are available. In penetration testing practice, this task is conducted at the time of the discovery process.
In this chapter, we will discuss the following topics related to the target enumeration process:
The goal of performing the enumeration process is to collect information about the services available on the target systems. Later on, we will use this information to identify the vulnerabilities that exist on these services.
In its simplest definition, port scanning can be defined as a method used to determine the state of the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) ports on the target machines. An open port may mean that there is a network service listening on the port and the service is accessible, whereas a closed port means that there is no network service listening on that port.
After getting the port's state, an attacker will then check the version of the software used by the network service and find out the vulnerability of that version of software. For example, suppose that server A has web server software version 1.0. A few days ago, there was a security advisory released. The advisory gave information about the vulnerability in web server software version 1.0. If an attacker finds out about server A's web server and is able to get the version information, the attacker can use this information to attack the server. This is just a simple example of what an attacker can do after getting information about the services available on the machine.
Before we dig into the world of port scanning, let us discuss a little bit of the TCP/IP protocol theory.