Nmap NSE vulnerability scanning with MSF exploitation
There may also be occasions where it might be helpful to develop a script that combines vulnerability scanning with exploitation. Vulnerability scanning can often turn up false positives, so by performing subsequent exploitation of vulnerability scan findings, one can have immediate validation of the legitimacy of those findings. In this recipe, a bash script will be used to execute the smb-check-vulns.nse
script to determine if a host is vulnerable to the MS08-067 NetAPI exploit, and if the NSE script indicates that it is, Metasploit will be used to automatically attempt to exploit it for verification.
Getting ready
To use the script demonstrated in this recipe, you will need to have access to a system that is running a vulnerable service that can be identified using an Nmap NSE script and can be exploited with Metasploit. In the example provided, a Windows XP system running an SMB service that is vulnerable to the MS08-067 NetAPI exploit...