Metasploit has auxiliary modules that can be used to perform UDP, SYN, and TCP connect scanning. Using Metasploit for scanning as well as exploitation can be an effective way to cut down on the total number of tools required to complete a penetration test. This specific recipe demonstrates how we can use Metasploit to perform port scanning.
Port scanning with Metasploit(UDP, stealth, and connect)
Getting ready
To use Metasploit to perform UDP, TCP stealth, and TCP full connect scans, you will need to have a remote system that is running network services over UDP and TCP. In the examples provided, an instance of Metasploitable2 is used to perform this task. For more information on how to set up Metasploitable2, refer to Chapter 1, Getting Started.