18 Vulnerability Analysis
18 Vulnerability Analysis
Vulnerability Analysis
Introduction
Lab Topology
Exercise 1 - Performing a Vulnerability Scan
Exercise 2 - Introducing Microsoft Baseline Security Analyzer
(MBSA)
Exercise 3 - Implementing Recommendations
Exercise 4 - Saving Microsoft Baseline Security Analyzer Reports
Exercise 5 - Analyze Vulnerability Scan Results and Prioritize
Activities
Review
Introduction
Vulnerability Scanning
Vulnerability Analysis
OpenVAS
Ethical Hacking
Microsoft Baseline Security Analyser (MBSA)
Nikto
Lynis
Welcome to the Vulnerability Analysis Practice Lab. In this module, you will be
provided with the instructions and devices needed to develop your hands-on skills.
Learning Outcomes
In this module, you will complete the following exercises:
Exam Objectives
The following exam objectives are covered in this lab:
Note: Our main focus is to cover the practical, hands-on aspects of the exam
objectives. You recommend referring to course material or a search engine to
research theoretical topics in more detail.
Lab Duration
It will take approximately 1 hour to complete this lab.
Lab Topology
During your session, you will have access to the following lab configuration.
Depending on the exercises, you may or may not use all of the devices, but they are
shown here in the layout to get an overall understanding of the topology of the lab.
PLABDC01 - (Windows Server 2019 - Domain Server)
PLABDM01 - (Windows Server 2019 - Domain Controller)
PLABWIN10 - (Windows 10 - Workstation)
PLABKALI01 - (Kali 2019.2 - Linux Kali Workstation)
Learning Outcomes
After completing this exercise, you will be able to:
Your Devices
You will be using the following devices in this lab. Please power these on now.
Nikto is a vulnerability scanner that is part of Kali Linux. It is widely used by ethical
hackers and penetration testers to find the vulnerabilities in Web applications. In
this task, you will learn to use Nikto for vulnerability scanning.
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to
PLABKALI01.
Credentials are:
Username:
root
Password:
Passw0rd
The desktop of PLABKALI01 is displayed.
Figure 1. 1 Screenshot of PLABKALI01: Showing the desktop of
PLABKALI01.
Step 2
On the desktop, double-click the Terminal icon
Figure 1.2 Screenshot of PLABKALI01: Double-clicking the Terminal icon
towards the left side of the screen.
Step 3
To scan a Website for vulnerabilities, type the following command:
Note: Instead of the -host parameter, you can also use the -h parameter.
Both provide the same result.
Press Enter.
Figure 1.3 Screenshot of PLABKALI01: Entering the nikto command with a
host IP.
Step 4
The vulnerability scanning process starts. Depending on the number of
vulnerabilities, the process may run for a few minutes.
Figure 1.4 Screenshot of PLABKALI01: Showing the running process of the
nikto command.
Step 5
A detailed list of vulnerabilities is listed as the output.
Figure 1.5 Screenshot of PLABKALI01: Showing the output of the nikto
command.
Step 6
Clear the screen by entering the following command:
clear
To scan a Website for vulnerabilities and save the output to an HTML file, type the
following command:
nikto -host http://192.168.0.10 -o plab.html
Press Enter.
Step 7
Let the vulnerability scanning process complete.
Press Enter.
Figure 1.7 Screenshot of PLABKALI01: Opening the output file name with
Firefox.
Step 8
A new Firefox window opens. Notice that the vulnerabilities are listed on the HTML
Webpage.
Figure 1.8 Screenshot of PLABKALI01: Showing the nikto output file in
Firefox.
Kali Linux provides a tool named the Open Vulnerability Assessment System
(OpenVAS) for vulnerability scanning. OpenVAS is a framework that consists of
multiple services and tools. The first step is getting information about a Web server.
The Footprinting process can also help you grab banners on the Web server.
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to
PLABKALI01.
clear
Next, you need to setup OpenVAS. To do this, type the following command:
openvas-setup
Press Enter.
Figure 1.9 Screenshot of PLABKALI01: Entering the openvas-setup script
command to setup and configure openvas.
Step 2
The setup process for OpenVAS now starts. This process will setup OpenVAS and
download many signatures and vulnerability tests.
Step 3
After the setup process is complete, a Firefox window is opened.
Click Advanced…
Step 4
The Greenbone Security Assistant login page is displayed.
admin
Click Login.
Step 5
The dashboard for OpenVAS is displayed.
Figure 1.13 Screenshot of PLABKALI01: Showing the dashboard screen for
OpenVAS.
Step 6
You will now perform a scan. Hover over Configuration and select Targets.
Figure 1.14 Screenshot of PLABKALI01: Selecting Targets from the
Configuration menu.
Step 7
The Targets page is displayed. First, you need to define a target.
Click New Target (*) on the upper left side - just below the menu.
Figure 1.15 Screenshot of PLABKALI01: Clicking * or New Target on the
Targets page.
Step 8
The New Target dialog box is displayed. In the Name text box, type the following:
PLABDC01
192.168.0.1
Click Create.
Figure 1.16 Screenshot of PLABKALI01: Enter the name in the Name text
box and click Create.
Step 9
Notice that the target is now created.
Figure 1.17 Screenshot of PLABKALI01: Showing the newly created task.
Step 10
Next, create a task. Hover over Scans and then select Tasks.
Figure 1.18 Screenshot of PLABKALI01: Selecting Tasks from the Scans
menu.
Step 11
The Tasks page is displayed.
Note: A dialog box will appear for 10 seconds and then disappear
automatically.
Click the Task icon just below the menu bar and select Task Wizard.
Figure 1.19 Screenshot of PLABKALI01: Selecting Task Wizard from the
menu.
Step 12
The Task Wizard is displayed. Input the IP address as 192.168.0.1 and click Start
Scan.
Figure 1.20 Screenshot of PLABKALI01: Clicking Start Scan on the Task
Wizard dialog box.
Step 13
Notice that a new task is created.
After a few minutes, the task starts to run. The Status column now shows the
percentage of task run.
Step 14
Finally, the scan completes, and the Tasks page displays the status.
Step 15
The finished task details are displayed. Click 1 next to Reports.
Figure 1.23 Screenshot of PLABKALI01: Clicking 1 next to Reports.
Step 16
Click the link provided under the Date column.
Figure 1.24 Screenshot of PLABKALI01: Clicking the link in the Date
column.
Step 17
Notice that the vulnerability is now displayed. It also displays the Severity level of
vulnerability.
Figure 1.25 Screenshot of PLABKALI01: Showing the vulnerability with the
severity level.
Security auditing
Compliance testing
Penetration testing
Vulnerability detection
System hardening
It can perform several types of system auditing, such as system binaries, boot
loaders, startup services, run level, loaded modules, kernel configuration, core
dumps, and so on.
In this task, you will learn to use Lynis for system vulnerability scanning. To do this,
perform the following steps:
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to
PLABKALI01.
Press Enter.
Note: If you are shown an error such as 404 not found in the output, execute
the command apt-get update and then reattempt the command at this step
being apt-get install lynis.
Figure 1.26 Screenshot of PLABKALI01: Showing the command apt-get
install lynis inputted to install lynis.
Step 2
After the installation has completed and you are shown the next prompt.
clear
By default, Lynis will perform a local system scan. You have the option to run a
normal audit scan or can run the entire system scan.
Let’s first run the normal audit scan. Type the following command:
Press Enter.
Alert: If you are shown a not found error, please reattempt Step 1 following the
alert located within.
Step 3
The auditing process starts. Notice that it has already detected the operating system
version, its hostname, and so on.
Step 4
During the scan process, you will notice that the results are categorized under
different categories.
Figure 1.29 Screenshot of PLABKALI01: Showing the output of the lynis
command.
Step 5
The audit process completes.
Figure 1.30 Screenshot of PLABKALI01: Showing the completed status of
lynis command.
Step 6
You will need to scroll up to review the results. Notice that there are vulnerabilities
that are located. Lynis also provides a suggestion to close the vulnerabilities. For
example, it is hardening the SSH configuration. It has a setting PermitRootLogin
set to Yes. Lynis audit suggests that it should be set to No.
Note: Take a few minutes and go through the audit report. If time permits,
then you should use the following command to perform a full audit scan: lynis
audit system -c
Figure 1.31 Screenshot of PLABKALI01: Showing the list of vulnerabilities.
The PLABWIN10 system does not have MBSA installed. MBSA will be installed from
the Intranet within the following task.
Learning Outcomes
After completing this exercise, you will be able to:
Install MBSA
Configure MBSA
Review the results of the scan
Your Devices
You will be using the following devices in this lab. Please power these on now.
You can use MBSA to track the missing updates and security misconfiguration on a
Windows system. MBSA does not come installed by default. You need to download
and install it on a Windows system.
In this task, you will learn to install MBSA on PLABWIN10. To do this, perform the
following steps:
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to
PLABWIN10. The desktop of PLABWIN10 is displayed.
Step 2
Click Microsoft Edge, located on the taskbar.
Figure 2.2 Screenshot of PLABWIN10: Showing the desktop of
PLABWIN10. Microsoft Edge is highlighted.
Step 3
The Intranet page is opened by default.
Step 4
Scroll down the page and select the link for Windows_Server_2012.
Figure 2.4 Screenshot of PLABWIN10: Showing the Intranet page,
Windows_Server_2012 is highlighted.
Step 5
Click the link for MBSA.
Figure 2.5 Screenshot of PLABWIN10: Showing the Intranet page, MBSA is
highlighted.
Step 6
Click the link for MBSA Setup-x64-EN.msi
Once indicated that the setup has finished downloading, close the notification and
close Microsoft Edge.
Figure 2.6 Screenshot of PLABWIN10: Showing the Intranet page, MBSA
Setup-x64-EN-msi is highlighted and showing the pop-up at the bottom of
the Microsoft Edge window.
Step 7
From the taskbar, click File Explorer.
Figure 2.7 Screenshot of PLABWIN10: Clicking the File Explorer icon in
the taskbar.
Step 8
The File Explorer window is displayed. In the left pane, click Downloads.
Figure 2.8 Screenshot of PLABWIN10: Selecting the Downloads option in
the left pane of File Explorer.
Step 9
In the Downloads folder. Double-click the MBSASetup-x64-EN file.
Figure 2.9 Screenshot of PLABWIN10: Double-clicking the MBSA installer
file.
Step 10
The MBSA Setup dialog box is displayed. On the Welcome to the Microsoft
Baseline Security Analyzer page, click Next.
Figure 2.10 Screenshot of PLABWIN10: Clicking the Next button on the
Welcome to the Microsoft Baseline Security Analyzer page.
Step 11
On the License Agreement page, select I accept the license agreement and
click Next.
Figure 2.11 Screenshot of PLABWIN10: Selecting the I accept the license
agreement option on the License Agreement page.
Step 12
On the Destination folder page, keep the default path and click Next.
Figure 2.12 Screenshot of PLABWIN10: Clicking Next on the Destination
Folder page.
Step 13
On the Start Installation page, click Install.
Figure 2.13 Screenshot of PLABWIN10: Clicking Install on the Start
Installation page.
Step 14
On the Installation Progress page, the installation progress is displayed.
Figure 2.14 Screenshot of PLABWIN10: Showing the installation progress
on the Installation Progress page.
Step 15
After the installation progress is completed, the MBSA Setup dialog box is
displayed. Click OK.
Figure 2.15 Screenshot of PLABWIN10: Clicking OK on the MBSA Setup
dialog box.
Step 16
Close the File Explorer window.
Figure 2.16 Screenshot of PLABWIN10: Closing the File Explorer window.
Step 17
Notice that the MBSA icon appears on the desktop.
Figure 2.17 Screenshot of PLABWIN10: Showing the MBSA icon on the
desktop.
Step 1
Ensure all the lab devices stated in the introduction are powered on.
Connect to PLABWIN10.
Double-click on the Microsoft Baseline Security Analyzer 2.3 desktop
shortcut.
Step 2
The Microsoft Baseline Security Analyzer 2.1 window is displayed.
Step 3
The Which computers do you want to scan? page is displayed.
192.168.0.1
Figure 2.20 Screenshot of PLABWIN10: Showing the MBSA configuration
page with IP range added.
Step 4
Change the Security Report Name to something preferable and identifiable such
as:
%IP%
This will bring into effect the IP values as the report name.
When working on a live system, you can scan for the following problems within a
Windows environment:
Windows administrative vulnerabilities
Weak passwords
IIS administrative vulnerabilities
SQL administrative vulnerabilities
Step 5
Next, press the Start Scan button on the bottom right-hand side of the window.
Figure 2.22 Screenshot of PLABWIN10: Clicking the Start Scan button.
Step 6
You will notice that Windows begins the scanning process.
Step 7
After about 5-7 minutes, a summary of scanned devices will be displayed in
descending order.
MBSA generates a report file and sends it to the profile directory under the name
titled by the MBSA tool. The results display several Icons.
Step 1
Ensure that the required systems are powered on. Connect to PLABWIN10. After
clicking the outcome of the report for PLABDC01, you can see a generated report
for this device.
Figure 2.25 Screenshot of PLABWIN10: Showing the MBSA scan report.
Step 2
On each Issue, you will find a Result tab typically providing 3 options of “What was
scanned”, “result details” and “How to correct this”.
Figure 2.26 Screenshot of PLABWIN10: Showing the MBSA scan report.
Step 3
Under the Administrative Vulnerabilities subsection of the Windows Scan
Results section, click the What was scanned link for Password Expiration.
Figure 2.27 Screenshot of PLABWIN10: Clicking the What was scanned
option for Password Expiration.
Step 4
This will automatically open up a page in Internet Explorer where further
information can be read.
Step 5
Click the Result details link.
Figure 2.29 PLABWIN10: Clicking the Result details of Password
Expiration.
Step 6
You are presented with information detailing the user accounts with non-expiring
passwords; these accounts will need to be checked.
Step 7
Click the How to correct this link.
Figure 2.31 Screenshot of PLABWIN10: Clicking the How to correct this
link.
Step 8
You are presented with the issue and even a caution on changing account details for
specific situations. Finally, you are presented with the solution to correct the
problem.
You will now follow these steps to make sure you are protected against this for the
Guest and Administration accounts.
Figure 2.32 Screenshot of PLABWIN10: Displaying the Password
Expiration remediation page.
Step 9
Close the MBSA window.
Figure 2.33 Screenshot of PLABWIN10: Closing the MBSA window.
Your Devices
You will be using the following devices in this lab. Please power these on now.
In the previous task, you notice that there are local user accounts that have non-
expiring passwords. You need to ensure that these settings are cleared so that the
passwords should be changed at a periodic interval. To do this, perform the following
steps:
Step 1
Ensure that the required devices are powered on. Connect to PLABWIN10.
Step 2
The Run dialog box is displayed. In the Open text box, type the following:
compmgmt.msc
Click OK.
Figure 3.2 Screenshot of PLABWIN10: Entering compmgmt.msc command
in the Open text box of the Run dialog box.
Step 3
The Computer Management window is displayed. In the left-hand pane, expand
Local Users and Groups and select Users.
Figure 3.3 Screenshot of PLABWIN10: Showing the user accounts in the
Users node.
Step 4
In the middle pane, right-click Guest and select Properties.
Figure 3.4 Screenshot of PLABWIN10: Right-clicking the Guest account
and selecting Properties from the context menu.
Step 5
The Guest Properties dialog box is displayed. On the General tab, deselect the
Password never expires option.
Click OK.
Figure 3.5 Screenshot of PLABWIN10: Showing the Guest Properties dialog
box to change the Password Expiration setting.
Step 6
Perform the same action for the Administrator role.
Click OK.
Figure 3.6 Screenshot of PLABWIN10: Showing the Administrator
Properties dialog box to change the Password Expiration setting.
Step 7
As seen above, you have now completed security actions for both the Guest and
Administrator roles.
Figure 3.7 Screenshot of PLABWIN10: Closing the Computer Management
window.
Your Devices
You will be using the following devices in this lab. Please power these on now.
In this task, you will save a generated report as an XPS document, which is an open
format designed and supported by Microsoft.
Step 1
Ensure that the required devices are powered on. Connect to PLABWIN10.
Step 2
In the MBSA window, click the View existing security scan reports link.
Figure 4.2 Screenshot of PLABWIN10: Clicking the View existing security
scan reports link.
Step 3
On the Choose a security scan report to view page, you may get to see one or
more reports. The number of reports depends on the time you have run the scan.
Click a report.
Figure 4.3 Screenshot of PLABWIN10: Clicking the listed reports.
Step 4
The report contents are displayed. Click the Print this report link, located towards
the bottom left-hand corner of the window.
Figure 4.4 Screenshot of PLABWIN10: Clicking the Print this report link.
Step 5
The Print dialog box is displayed. In the Select Printer section, scroll across and
select Microsoft XPS Document Writer and click Print.
Figure 4.5 Screenshot of PLABWIN10: Clicking the Print button in the
Print dialog box.
Step 6
Name the file PLABDC01, keep the extension as .oxps and save the file to the
Documents.
Figure 4.6 Screenshot of PLABWIN10: Saving the MBSA report in the Save
Print Output As dialog box.
Step 7
Now minimize the MBSA window.
Figure 4.7 Screenshot of PLABWIN10: Minimizing the MBSA window.
Step 8
From the taskbar, click File Explorer and then navigate to the Documents folder
in the left pane.
Figure 4.8 Screenshot of PLABWIN10: Showing the MBSA scan report in
the Downloads folder.
Step 9
Notice that a file named PLABDC01 is present in the Documents folder. Double-
click the file to read the output of the report.
Figure 4.9 Screenshot of PLABWIN10: Double-clicking the scan report in
File Explorer.
Step 10
The PLABDC01.oxps - XPS Viewer window is displayed. It displays the contents
of the PLABDC01 report.
This file is, in fact, part of the auditing performed against windows machines, and
typically it would be kept as a record of actions that have been taken and recognized.
Figure 4.10 Screenshot of PLABWIN10: Showing the MBSA report in XPS
Viewer.
Note: You can run MBSA once again to review the vulnerabilities. The
password expiration should not appear on the list.
In this exercise, you will learn about analyzing the vulnerability scan results.
Learning Outcomes
After completing this exercise, you will be able to:
As a pentester, you must be able to identify false positives. Each scan result should
be researched and calculated, whether it is a false positive or not. You will not know
about every vulnerability that you discover, but researching can certainly prevent
wastage of hours of work.
Review
Well done, you have completed the Vulnerability Analysis Practice Lab.
Summary
You completed the following exercises:
Feedback
Shutdown all virtual machines used in this lab. Alternatively, you can log out of
the lab platform.