Lab 07.0 - Nessus
Lab 07.0 - Nessus
LAB ID: 7
NESSUS
POLICY AND SCAN CONFIGURATION
AUTHENTICATED SCANS
PLUGIN SELECTION
NESSUS AND METASPLOIT INTEGRATION
[Nessus] LAB ID: 7
1. LAB
You’re asked to perform a Vulnerability assessment against the internal
network of FooCompany. Note that your machine is directly connected to
the company LAN. You are indeed at your client premises.
2. GOALS
Perform a vulnerability assessment
4. RECOMMENDED TOOLS
Nessus
Metasploit
5. TASKS
Task 1. Nessus GUI – Internal network scan
Start Nessus and run a new scan on the target network 192.168.78.0/24,
using the existing policy “Internal Network Scan”.
Once the scan is finished fill in the following table with the discovered
hosts and the number of high/medium vulnerability found for each.
Note that you can also perform host discovery using tools like Nmap and
then feed Nessus with the right IP addresses.
Metasploit offers the ability to use Nessus directly from the msfconsole.
This is a very useful feature that allows us to load existing Nessus scans
and then exploit existing vulnerabilities.
Once you have loaded the previous scan (Task 1) into Metasploit, find
exploitable vulnerability ( or use plugins such as “auto_exploit” or
“db_autopwn” (NOTE: this plugin has been removed from recent versions
of Metasploit) ) in order to obtain one or more meterpreter shells.
Once the scan is finished, you can notice that the report differs from the
previous obtained (Task 1). This happens because, Nessus is now able to
scan the remote host using credentials thus running checks with local
privileges.
Please fill the next table with the results of the new scan:
Create a new Nessus policy and perform a Web App scan. Don’t use
existing policy but think about which plugins are useless and which are
not. Moreover, in the Preferences tab, you also have further configuration
options.
Solutions
Once the service is running, we can access the Nessus GUI, at the address:
https://127.0.0.1:8834
We can now start our scan against the network. To do that let’s open the
“Scans” tab and then click “Add”.
Here we can setup the name of the scan, the policy to use and a list of
hosts to scan. Note that since we are within the target network, if we set
the whole subnet to 192.168.78.0/24, our machine will be scanned too.
To avoid this we can use tools like Nmap to perform an host discovery,
and then manually provide Nessus with IP address to scan:
As you can see from the results, different vulnerabilities have been found
on the target machines. You can navigate them, clicking the IP addresses.
Instead of using the web browser GUI, we can also use Nessus from
Metasploit. This will help us in case we want to try assess and exploit any
vulnerability. Since we have already performed the scan, we will just load
the Nessus results in MSF and automatically exploit vulnerabilities.
host
Username Password
Now that we are connected with Nessus, we can run basic commands
such as run a new scan, navigate reports and so on.
Since we already have a report, we can load it so that Metasploit can load
the list of vulnerabilities. Let’s first list all Nessus reports with the
command nessus_report_list and then load the one we want to import
with the command nessus_report_get.
Now vulnerabilities and targets have been imported into the database.
Now we should be able to dump password hashes and then use them to
run a new Nessus scans with credentials:
The next step is to create and configure a new Nessus policy in order to
scan targets using the credentials obtained with the previous hashdump
command. Remember that the string obtained with hashdump is
composed as follow:
Dumped hashes
Moreover we have SSH credentials too. So let’s choose SSH Settings from
the top-down menu and let’s insert the given credentials:
We can leave the rest of the options as they are. Let’s run the scan and
see if we are able to obtain more information than before:
As you can see, configuring Nessus with the right credentials, allow us to
scan target hosts locally, and find many more vulnerabilities. In this case
the credentials worked for three hosts.
First let’s create a new policy and start configuring it. Since we want to
scan the web applications, and we don’t want to generate too much
traffic on the network, we can start configuring ports to scan:
After that, we can skip the Credentials tab and start configuring the
Plugins. In this case we have enabled the following plugins:
We can move on to the last step (Preferences tab). The first plugin we will
configure is Global variable settings:
Another useful plugin is the HTTP login page. This plugin provides control
over login forms within the web application. If you are given a login to the
web application, you should put it here to scan authenticated
functionalities:
The last plugin we will enable is “Web mirroring”. With this plugin, Nessus
will mirror web content to better analyze the contents for vulnerabilities:
Now that we have our policy set up, we can run the scan against the
webserver.
Now that you are more confident with Nessus, you can try to create
custom Nessus policies in order to check which plugins and which
configurations fit better for different situations. You can also practice
scanning and exploiting targets directly from Metasploit.