Performing a Nessus scan via Metasploit

Now that we have patched the Metasploit library, let's perform a Nessus scan using Metasploit:

  1. After patching the gem, we can now create a vulnerability scanning task using the nessus_scan_new <UUID of Policy> <Scan name> <Description> <Targets> command, as shown here:
  1. Once the task is created, we can confirm it by executing the nessus_scan_list command. Scan ID will be used to launch the task, so let's make a note of it, as shown here:

  1. Let's confirm the same by accessing the Nessus web interface:

As we can see in the preceding screenshot, the scanning task is created but it has not yet launched.

  1. To launch the scanning task, we need to execute the nessus_scan_launch <scan ID> command:

We have successfully launched the scanning task.

  1. Let's confirm it on the Nessus web interface:

  1. We can see the same details from the preceding screenshot in msfconsole by executing the nessus_scan_details <scan ID> <category> command:

The available categories that can be used to view the scanning details are the following:

The following screenshot shows the output of the vulnerabilities command:

The following screenshot shows the output of the history command:

  1. Let's confirm the scanning details from the Nessus web interface:

  1. Let's now execute the nessus_report_hosts <scan ID> command to see an overall summary of the scan, as shown here:
  1. To get a list of the vulnerabilities identified, we can execute the nessus_report_vulns <scan ID> command, as shown here:

Using Nessus from Metasploit comes with a perk: being able to use the Metasploit DB for the scan. This can be very useful in cases where we have a list of targets stored in the Metasploit DB and we want to perform a vulnerability scan on those targets.