In addition to the many other scanning functions integrated into the Nmap tool, there is also an option to perform layer 4 discovery. This specific recipe will demonstrate how to use Nmap to perform layer 4 discovery with both TCP and UDP protocols.
Using Nmap to perform layer 4 discovery does not require a lab environment, as many systems on the Internet will reply to both TCP and UDP traffic. However, it is highly recommended that you perform any type of network scanning exclusively in your own lab unless you are thoroughly familiar with the legal regulations imposed by any governing authorities to whom you are subject to.
If you wish to perform this technique within your lab, you will need to have at least one system that will respond to TCP and/or UDP traffic. Systems that are running at least one TCP and UDP service are preferable. In the examples provided, a combination of Linux and Windows systems are used. For more information on...