You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to set up a lab to teach ethical hacking using Azure Lab Services.
4
+
description: Learn how to set up a lab to teach ethical hacking using Azure Lab Services. The lab includes nested VMs for students to use in a standard environment.
5
5
services: lab-services
6
6
ms.service: lab-services
7
-
author: ntrogh
8
-
ms.author: nicktrog
7
+
author: RoseHJM
8
+
ms.author: rosemalcolm
9
9
ms.topic: how-to
10
-
ms.date: 01/24/2023
10
+
ms.date: 03/04/2024
11
+
#customer intent: As an administrator or educator, I want to set up a lab by using Azure Lab Services so that students can practice ethical hacking techniques.
11
12
---
12
13
13
14
# Set up a lab to teach ethical hacking class by using Azure Lab Services
This article shows you how to set up a class that focuses on the forensics side of ethical hacking with Azure Lab Services. In an ethical hacking class, students can learn modern techniques for defending against vulnerabilities. Penetration testing, a practice that the ethical hacking community uses, occurs when someone attempts to gain access to the system or network to demonstrate vulnerabilities that a malicious attacker may exploit.
16
+
This article shows you how to set up a class that focuses on the forensics side of ethical hacking with Azure Lab Services. In an ethical hacking class, students can learn modern techniques for defending against vulnerabilities. Penetration testing, a practice that the ethical hacking community uses, occurs when someone attempts to gain access to the system or network to demonstrate vulnerabilities that a malicious attacker might exploit.
18
17
19
-
Each student gets a Windows host virtual machine (VM) that has two nested virtual machines: one VM with [Metasploitable3](https://github.com/rapid7/metasploitable3) image and another VM with the [Kali Linux](https://www.kali.org/) image. You use the Metasploitable VM for exploiting purposes. The Kali VM provides access to the tools you need to execute forensic tasks.
This article has two main sections. The first section covers how to create the lab. The second section covers how to create the template machine with nested virtualization enabled and with the tools and images needed. In this case, a Metasploitable image and a Kali Linux image on a machine that has Hyper-V enabled to host the images.
20
+
Each student gets a Windows host virtual machine (VM) that has two nested virtual machines: one VM with Metasploitable3 image and another VM with the Kali Linux image. Use the Metasploitable VM for exploiting purposes. The Kali VM provides access to the tools you need to run forensic tasks.
22
21
23
22
## Prerequisites
24
23
25
-
[!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
24
+
-[!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
25
+
-[!INCLUDE [must have lab plan](./includes/lab-services-class-type-lab-plan.md)]
26
26
27
-
[!INCLUDE [must have lab plan](./includes/lab-services-class-type-lab-plan.md)]
27
+
## Configure your lab
28
28
29
-
## Lab configuration
30
-
31
-
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Use the following settings when creating the lab.
29
+
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Use the following settings when creating the lab.
32
30
33
31
| Lab settings | Value |
34
32
| ------------ | ------------------ |
35
33
| Virtual machine (VM) size | Medium (Nested Virtualization) |
To configure the template VM, complete the following three tasks:
43
-
44
-
1. Set up the machine for nested virtualization. You enable all the appropriate windows features, like Hyper-V.
45
-
46
-
2. Set up the [Kali](https://www.kali.org/) Linux image. Kali is a Linux distribution that includes tools for penetration testing and security auditing.
40
+
To configure the template VM, complete the following tasks:
47
41
48
-
3. Set up the Metasploitable image. For this example, you use the [Metasploitable3](https://github.com/rapid7/metasploitable3) image. This image is created to purposely have security vulnerabilities.
42
+
- Set up the machine for nested virtualization. Enable all the appropriate windows features, like Hyper-V.
43
+
- Set up the [Kali](https://www.kali.org/) Linux image. Kali is a Linux distribution that includes tools for penetration testing and security auditing.
44
+
- Set up the Metasploitable image. For this example, use the [Metasploitable3](https://github.com/rapid7/metasploitable3) image. This image is created to purposely have security vulnerabilities.
49
45
50
46
# [PowerShell](#tab/powershell)
51
47
52
48
### Prepare template machine for nested virtualization
> The script might require the machine to restart. Follow instructions from the script and re-run the script until you see **Script completed** in the output.
58
59
59
60
### Set up nested virtual machine images
60
61
61
62
Kali is a Linux distribution that includes tools for penetration testing and security auditing.
62
63
63
-
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You use this image to test and find issues. The following instructions show you how to use a precreated Metasploitable image. However, if a newer version of the Metasploitable image is needed, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
64
+
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. Use this image to test and find issues. The following instructions show you how to use a precreated Metasploitable image. However, if you need a newer version of the Metasploitable image, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
64
65
65
-
To install Kali Linux and Metasploitable on the template VM, run the following command:
66
+
-To install Kali Linux and Metasploitable on the template VM, run the following command:
@@ -79,85 +80,97 @@ Follow the instructions to [enable nested virtualization](how-to-enable-nested-v
79
80
80
81
Kali is a Linux distribution that includes tools for penetration testing and security auditing. To install the Kali nested VM on the template VM:
81
82
82
-
1. Connect to the template VM by using remote desktop.
83
+
1. Connect to the template VM by using Remote Desktop.
84
+
85
+
1. Download the image from [Offensive Security Kali Linux VM images](https://www.kali.org/get-kali/#kali-virtual-machines). The default username and password are noted on the download page.
83
86
84
-
1. Download the image from [Offensive Security Kali Linux VM images](https://www.kali.org/get-kali/#kali-virtual-machines). Remember the default username and password are noted on the download page.
85
-
1. Download the **Kali Linux Hyper-V 64-Bit (7z)** image for Hyper-V.
86
-
1. Extract the .7z file. If you don’t already have 7-zip, download it from [https://www.7-zip.org/download.html](https://www.7-zip.org/download.html).
87
+
1. Download the **Kali Linux Hyper-V 64-Bit (7z)** image for Hyper-V.
88
+
1. Extract the .7z file. If you don’t already have 7-zip, download it from [https://www.7-zip.org/download.html](https://www.7-zip.org/download.html).
87
89
88
-
1. Follow the instructions to [import a premade Kali Linux image](https://www.kali.org/docs/virtualization/import-premade-hyperv/) into Hyper-V.
90
+
1. Follow the instructions to [import a premade Kali image](https://www.kali.org/docs/virtualization/import-premade-hyperv/) into Hyper-V.
89
91
90
-
1. The Kali-Linux image is now ready for use. From **Hyper-V Manager**, choose **Action**-> **Start**, then choose **Action**-> **Connect** to connect to the virtual machine. The default username is `kali` and the password is `kali`.
92
+
1. The Kali image is now ready for use. From **Hyper-V Manager**, choose **Action** > **Start**, then choose **Action** > **Connect** to connect to the virtual machine. The default username is `kali` and the password is `kali`.
91
93
92
94
### Set up a nested VM with Metasploitable image
93
95
94
-
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. You use this image to test and find issues. The following instructions show you how to use a precreated Metasploitable image. However, if a newer version of the Metasploitable image is needed, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
96
+
The Rapid7 Metasploitable image is an image purposely configured with security vulnerabilities. Use this image to test and find issues. The following instructions show you how to set up a particular Metasploitable image. If you need a newer version of the Metasploitable, see [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
95
97
96
98
To install the Metasploitable nested VM on the template VM:
97
99
98
-
1. Connect to the template VM by using remote desktop.
100
+
1. Connect to the template VM by using Remote Desktop.
99
101
100
102
1. Download the Metasploitable image.
101
-
1. Navigate to [https://information.rapid7.com/download-metasploitable-2017.html](https://information.rapid7.com/download-metasploitable-2017.html). Fill out the form to download the image and select the **Submit** button.
102
103
103
-
> [!NOTE]
104
-
> You can check for newer versions of the Metasploitable image at [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
104
+
1. Navigate to [https://information.rapid7.com/download-metasploitable-2017.html](https://information.rapid7.com/download-metasploitable-2017.html). Fill out the form to download the image and select the **Submit** button.
105
105
106
-
2. Select the **Download Metasploitable Now** button.
107
-
3. When the download finishes, extract the zip file, and remember the location of the *Metasploitable.vmdk* file.
106
+
> [!NOTE]
107
+
> You can check for newer versions of the Metasploitable image at [https://github.com/rapid7/metasploitable3](https://github.com/rapid7/metasploitable3).
108
+
109
+
1. Select **Download Metasploitable Now**.
110
+
1. When the download finishes, extract the zip file, and remember the location of the *Metasploitable.vmdk* file.
108
111
109
112
1. Convert the extracted vmdk file to a Hyper-V vhdx file with StarWind V2V Converter.
110
-
1. Download and install [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter#download).
111
-
1. Start **StarWind V2V Converter**.
112
-
1. On the **Select location of image to convert** page, choose **Local file**. Select **Next**.
113
-
1. On the **Source image** page, navigate to and select the Metasploitable.vmdk extracted in the previous step for the **File name** setting. Select **Next**.
114
-
1. On the **Select location of destination image**, choose **Local file**. Select **Next**.
115
-
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
116
-
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
117
-
1. On the **Select destination file name** page, accept the default file name. Select **Convert**.
118
-
1. On the **Converting** page, wait for the image to be converted. Conversion can take several minutes. Select **Finish** when the conversion is completed.
113
+
114
+
1. Download and install [StarWind V2V Converter](https://www.starwindsoftware.com/starwind-v2v-converter#download).
115
+
1. Start **StarWind V2V Converter**.
116
+
1. On the **Select the location of image to convert** page, choose **Local file**. Select **Next**.
117
+
1. On the **Source image** page, navigate to and select *Metasploitable.vmdk* extracted in the previous step for the **File name** setting. Select **Next**.
118
+
1. On the **Select the location of destination image**, choose **Local file**. Select **Next**.
119
+
1. On the **Select destination image format** page, choose **VHD/VHDX**. Select **Next**.
120
+
1. On the **Select option for VHD/VHDX image format** page, choose **VHDX growable image**. Select **Next**.
121
+
1. On the **Select destination file name** page, accept the default file name. Select **Convert**.
122
+
1. On the **Converting** page, wait for the image to be converted. Conversion can take several minutes. Select **Finish** when the conversion is completed.
1. On the **Before You Begin** page of the **New Virtual Machine Wizard**, select **Next**.
124
-
1. On the **Specify Name and Location** page, enter **Metasploitable** for the **name**, and select **Next**.
125
-
:::image type="content" source="./media/class-type-ethical-hacking/new-vm-wizard-1.png" alt-text="Screenshot of New Virtual Machine Wizard in Hyper V.":::
126
-
1. On the **Specify Generation** page, accept the defaults, and select **Next**.
127
-
1. On the **Assign Memory** page, enter **512 MB** for the **startup memory**, and select **Next**.
128
-
:::image type="content" source="./media/class-type-ethical-hacking/assign-memory-page.png" alt-text="Screenshot of Assign Memory page of New Virtual Machine Wizard in Hyper V.":::
129
-
1. On the **Configure Networking** page, leave the connection as **Not Connected**. You'll set the network adapter later.
130
-
1. On the **Connect Virtual Hard Disk** page, select **Use an existing virtual hard disk**. Browse to the location for the **metasploitable.vhdx** file created in the previous step, and select **Next**.
131
-
:::image type="content" source="./media/class-type-ethical-hacking/connect-virtual-network-disk.png" alt-text="Screenshot of Connect Virtual Hard Disk page of New Virtual Machine Wizard in Hyper V.":::
132
-
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
133
-
1. Once the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the machine yet.
134
-
1. Choose **Action** -> **Settings**.
135
-
1. On the **Settings for Metasploitable** dialog for, select **Add Hardware**.
136
-
1. Select **Legacy Network Adapter**, and select **Add**.
137
-
:::image type="content" source="./media/class-type-ethical-hacking/network-adapter-page.png" alt-text="Screenshot of settings dialog for Hyper V VM.":::
138
-
1. On the **Legacy Network Adapter** page, select **Default Switch** for the **Virtual Switch** setting, and select **OK**.
139
-
:::image type="content" source="./media/class-type-ethical-hacking/legacy-network-adapter-page.png" alt-text="Screenshot of Legacy Network adapter settings page for Hyper V VM.":::
140
-
1. The Metasploitable image is now ready for use. From **Hyper-V Manager**, choose **Action** -> **Start**, then choose **Action** -> **Connect** to connect to the virtual machine. The default username is `msfadmin` and the password is `msfadmin`.
1. On the **Before You Begin** page of the **New Virtual Machine Wizard**, select **Next**.
129
+
1. On the **Specify Name and Location** page, enter **Metasploitable** for the **name**, and select **Next**.
130
+
131
+
:::image type="content" source="./media/class-type-ethical-hacking/new-vm-wizard-1.png" alt-text="Screenshot of New Virtual Machine Wizard in Hyper V.":::
132
+
133
+
1. On the **Specify Generation** page, accept the defaults, and select **Next**.
134
+
1. On the **Assign Memory** page, enter **512 MB** for the **startup memory**, and select **Next**.
135
+
136
+
:::image type="content" source="./media/class-type-ethical-hacking/assign-memory-page.png" alt-text="Screenshot of Assign Memory page of New Virtual Machine Wizard in Hyper V.":::
137
+
138
+
1. On the **Configure Networking** page, leave the connection as **Not Connected**. Set the network adapter later.
139
+
1. On the **Connect Virtual Hard Disk** page, select **Use an existing virtual hard disk**. Browse to the location for the *Metasploitable.vhdx* file in the previous step, and select **Next**.
140
+
141
+
:::image type="content" source="./media/class-type-ethical-hacking/connect-virtual-network-disk.png" alt-text="Screenshot of Connect Virtual Hard Disk page of New Virtual Machine Wizard in Hyper V.":::
142
+
143
+
1. On the **Completing the New Virtual Machine Wizard** page, and select **Finish**.
144
+
1. After the virtual machine is created, select it in the Hyper-V Manager. Don't turn on the VM yet.
145
+
1. Choose **Action** > **Settings**.
146
+
1. On the **Settings for Metasploitable** page, select **Add Hardware**.
147
+
1. Select **Legacy Network Adapter**, and select **Add**.
148
+
149
+
:::image type="content" source="./media/class-type-ethical-hacking/network-adapter-page.png" alt-text="Screenshot of settings dialog for Hyper V VM.":::
150
+
151
+
1. On the **Legacy Network Adapter** page, select **Default Switch** for the **Virtual Switch** setting, and select **OK**.
152
+
153
+
:::image type="content" source="./media/class-type-ethical-hacking/legacy-network-adapter-page.png" alt-text="Screenshot of Legacy Network adapter settings page for Hyper V VM.":::
154
+
155
+
1. The Metasploitable image is now ready for use. From **Hyper-V Manager**, choose **Action** > **Start**, then choose **Action** > **Connect** to connect to the virtual machine. The default username is `msfadmin` and the password is `msfadmin`.
141
156
142
157
---
143
158
144
159
The template is now updated and has the nested VM images needed for an ethical hacking penetration testing class: an image with tools to do the penetration testing, and another image with security vulnerabilities to discover. You can now [publish the template VM](how-to-create-manage-template.md#publish-the-template-vm) to the class.
145
160
146
-
## Cost
161
+
## Estimate cost
147
162
148
163
If you would like to estimate the cost of this lab, you can use the following example:
149
164
150
165
For a class of 25 students with 20 hours of scheduled class time and 10 hours of quota for homework or assignments, the price for the lab would be:
151
166
152
167
25 students \* (20 + 10) hours \* 55 Lab Units \* 0.01 USD per hour = 412.50 USD
153
168
154
-
>[!IMPORTANT]
155
-
>This cost estimate is for example purposes only. For current details on pricing, see [Azure Lab Services Pricing](https://azure.microsoft.com/pricing/details/lab-services/).
169
+
>[!IMPORTANT]
170
+
>This cost estimate is for example purposes only. For current details on pricing, see [Azure Lab Services Pricing](https://azure.microsoft.com/pricing/details/lab-services/).
156
171
157
-
## Conclusion
172
+
## Related content
158
173
159
174
In this article, you went through the steps to create a lab for ethical hacking class. The lab VM contains two nested virtual machines to practice penetrating testing.
160
175
161
-
## Next steps
162
-
163
176
[!INCLUDE [next steps for class types](./includes/lab-services-class-type-next-steps.md)]
0 commit comments